All problems
Two-Stream Fusion Score
Problem
Fuse the class probabilities of a two-stream video model.
Return the elementwise blend alpha * spatial_probs + (1 - alpha) * temporal_probs, rounded to 4 decimal places. The two probability vectors have the same length.
Hint
alpha = 1 keeps only the spatial stream, alpha = 0 keeps only the temporal stream.
Test cases
case 1
in: [[0.8,0.2],[0.6,0.4],0.5]
expected: [0.7,0.3]
case 2
in: [[1],[0],0.3]
expected: [0.3]
case 3
in: [[0.1,0.9],[0.9,0.1],0]
expected: [0.9,0.1]
case 4
in: [[0.2,0.3,0.5],[0.4,0.4,0.2],1]
expected: [0.2,0.3,0.5]
Starter codePython
def two_stream_fusion(spatial_probs, temporal_probs, alpha):
# Your code here
pass4 test cases · run your code against them in the editor