All problems
Cumulative Alpha Bar
Problem
Compute the cumulative product of (1 - beta_t) over the noise schedule: alpha_bar_t = prod_{i<=t} (1 - beta_i).
The signature is cumulative_alpha_bar(betas). Return the list of cumulative values.
Hint
alpha_bar measures how much of the original signal survives after t steps.
Test cases
case 1
in: [[0.1,0.1,0.1]]
expected: [0.9,0.81,0.729]
case 2
in: [[0,0.5]]
expected: [1,0.5]
case 3
in: [[1]]
expected: [0]
case 4
in: [[0.2,0.1,0.4,0]]
expected: [0.8,0.72,0.432,0.432]
Starter codePython
def cumulative_alpha_bar(betas):
# Your code here
pass4 test cases · run your code against them in the editor