All problems
Min-SNR Gamma Weight
Problem
Compute the min-SNR loss weight: min(SNR, gamma) / SNR, which caps the emphasis on high-SNR (easy) timesteps.
The signature is min_snr_weight(alpha_bar_t, gamma=5.0).
Hint
The cap prevents easy low-noise steps from dominating the training gradient.
Test cases
case 1
in: [0.5,5]
expected: 1
case 2
in: [0.9,5]
expected: 0.5555555556
case 3
in: [0.25,5]
expected: 1
case 4
in: [0.99,5]
expected: 0.0505050505
Starter codePython
def min_snr_weight(alpha_bar_t, gamma=5.0):
# Your code here
pass4 test cases · run your code against them in the editor