What is: Contrastive Predictive Coding?
Source | Representation Learning with Contrastive Predictive Coding |
Year | 2000 |
Data Source | CC BY-SA - https://paperswithcode.com |
Contrastive Predictive Coding (CPC) learns self-supervised representations by predicting the future in latent space by using powerful autoregressive models. The model uses a probabilistic contrastive loss which induces the latent space to capture information that is maximally useful to predict future samples.
First, a non-linear encoder maps the input sequence of observations to a sequence of latent representations , potentially with a lower temporal resolution. Next, an autoregressive model summarizes all in the latent space and produces a context latent representation .
A density ratio is modelled which preserves the mutual information between and as follows:
where stands for ’proportional to’ (i.e. up to a multiplicative constant). Note that the density ratio can be unnormalized (does not have to integrate to 1). The authors use a simple log-bilinear model:
Any type of autoencoder and autoregressive can be used. An example the authors opt for is strided convolutional layers with residual blocks and GRUs.
The autoencoder and autoregressive models are trained to minimize an InfoNCE loss (see components).