Contrastive Predictive Coding (van den Oord et al., 2018) predicts future latent codes from the present context. Among many candidate futures, the true one should get the highest score, which is a softmax classification problem.
Implement cpc_loss(scores, pos), the softmax cross-entropy of the true future among the candidates.
logsumexp for stability.Compute logsumexp(scores) - scores[pos].
No results yet
Run your code to check it against the examples, or submit to run every test.