All problems
Posterior Collapse Check
Problem
Return True when the KL divergence of a latent variable's variational posterior from its prior falls below the given threshold, which signals posterior collapse: the latent is ignored by the decoder.
Hint
Collapsed latents carry almost no information about the data.
Test cases
case 1
in: [0.001,0.01]
expected: true
case 2
in: [0.1,0.01]
expected: false
case 3
in: [0,0]
expected: false
case 4
in: [0.009,0.01]
expected: true
Starter codePython
def posterior_collapse_check(kl_value, threshold):
# Your code here
pass4 test cases · run your code against them in the editor