Papers · Representation learning and distillation · 2018

Representation Learning with Contrastive Predictive Coding

Aaron van den Oord, Yazhe Li, Oriol Vinyals

The notation of the CPC (InfoNCE) paper, explained: its 16 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.

Read the paper on arXiv

Read from arXiv's HTML version: 16 displayed equations and 43 pieces of inline math. 22 symbols and constructs from the catalog.

The paper's displayed equations

Open any of them in the decoder for a symbol-by-symbol reading.

  1. (1)
    I(x;c)=∑x,cp(x,c)log⁡p(x∣c)p(x).I(x;c) =\sum_{x,c}p(x,c)\log\frac{p(x|c)}{p(x)}.
    Decode →
  2. (2)
    fk(xt+k,ct)∝p(xt+k∣ct)p(xt+k)f_{k}(x_{t+k},c_{t})\propto\frac{p(x_{t+k}|c_{t})}{p(x_{t+k})}
    Decode →
  3. (3)
    fk(xt+k,ct)=exp⁡(zt+kTWkct),f_{k}(x_{t+k},c_{t})=\exp\Big(z_{t+k}^{T}W_{k}c_{t}\Big),
    Decode →
  4. (4)
    LN=−EX[log⁡fk(xt+k,ct)∑xj∈Xfk(xj,ct)]\mathcal{L_{\text{N}}} =-\mathop{{}\mathbb{E}}_{X}\left[\log\frac{f_{k}(x_{t+k},c_{t})}{\sum_{x_{j}\in X}f_{k}(x_{j},c_{t})}\right]
    Decode →
  5. (5)
    p(d=i∣X,ct)=p(xi∣ct)∏l≠ip(xl)∑j=1Np(xj∣ct)∏l≠jp(xl)=p(xi∣ct)p(xi)∑j=1Np(xj∣ct)p(xj).\begin{gathered}p(d=i|X,c_{t}) =\frac{p(x_{i}|c_{t})\prod_{l\neq i}p(x_{l})}{\sum^{N}_{j=1}p(x_{j}|c_{t})\prod_{l\neq j}p(x_{l})} \\ =\frac{\frac{p(x_{i}|c_{t})}{p(x_{i})}}{\sum^{N}_{j=1}\frac{p(x_{j}|c_{t})}{p(x_{j})}}.\end{gathered}
    Decode →
  6. I(xt+k,ct)≥log⁡(N)−LN,I(x_{t+k},c_{t})\geq\log(N)-\mathcal{L_{\text{N}}},
    Decode →
  7. (6)
    LNopt=−EXlog⁡[p(xt+k∣ct)p(xt+k)p(xt+k∣ct)p(xt+k)+∑xj∈Xnegp(xj∣ct)p(xj)]\mathcal{L^{\text{opt}}_{\text{N}}} =-\mathop{{}\mathbb{E}}_{X}\log\left[\frac{\frac{p(x_{t+k}|c_{t})}{p(x_{t+k})}}{\frac{p(x_{t+k}|c_{t})}{p(x_{t+k})}+\sum_{x_{j}\in X_{\text{neg}}}\frac{p(x_{j}|c_{t})}{p(x_{j})}}\right]
    Decode →
  8. (7)
    =EXlog⁡[1+p(xt+k)p(xt+k∣ct)∑xj∈Xnegp(xj∣ct)p(xj)]=\mathop{{}\mathbb{E}}_{X}\log\left[1+\frac{p(x_{t+k})}{p(x_{t+k}|c_{t})}\sum_{x_{j}\in X_{\text{neg}}}\frac{p(x_{j}|c_{t})}{p(x_{j})}\right]
    Decode →
  9. (8)
    ≈EXlog⁡[1+p(xt+k)p(xt+k∣ct)(N−1)Exjp(xj∣ct)p(xj)]\approx\mathop{{}\mathbb{E}}_{X}\log\left[1+\frac{p(x_{t+k})}{p(x_{t+k}|c_{t})}(N-1)\mathop{{}\mathbb{E}}_{x_{j}}\frac{p(x_{j}|c_{t})}{p(x_{j})}\right]
    Decode →
  10. (9)
    =EXlog⁡[1+p(xt+k)p(xt+k∣ct)(N−1)]=\mathop{{}\mathbb{E}}_{X}\log\left[1+\frac{p(x_{t+k})}{p(x_{t+k}|c_{t})}(N-1)\right]
    Decode →
  11. (10)
    ≥EXlog⁡[p(xt+k)p(xt+k∣ct)N]\geq\mathop{{}\mathbb{E}}_{X}\log\left[\frac{p(x_{t+k})}{p(x_{t+k}|c_{t})}N\right]
    Decode →
  12. (11)
    =−I(xt+k,ct)+log⁡(N),=-I(x_{t+k},c_{t})+\log(N),
    Decode →

Famous equations in this paper

Symbols, by category

Most used first. The examples are written as the paper writes them.

Notation conventions

  1. xx, cc, ff

    Italic letters (variables) 229 uses

    A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).

  2. fkf_{k}, xt+kx_{t+k}, ctc_{t}

    Subscript (index or label) 171 uses

    A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).

  3. LN\mathcal{L_{\text{N}}}, LNopt\mathcal{L^{\text{opt}}_{\text{N}}}

    Calligraphic letters 6 uses

    A script capital usually names a set, a space, a distribution or a loss.

  4. …\dots

    Dots (ellipsis) 1 use

    “And so on”: continue the pattern.

  5. L\mathcal{L}

    Loss (ℒ) 1 use

    The loss: the number training tries to make small. Also written L, J(θ) or ℓ.

Vectors and matrices

  1. zt+kTz_{t+k}^{T}, WkTW_{k}^{T}

    Transpose 2 uses

    Swap rows and columns. xᵀy is a dot product; xyᵀ is an outer product.

Probability and statistics

  1. pp

    Probability p(x) 45 uses

    A probability or probability density; p is usually the true or model distribution, q an approximation.

  2. ∣|

    Given (conditional bar) 24 uses

    “Given”: p(y | x) is the probability of y given that x is known.

  3. log⁡\log

    Logarithm 17 uses

    A logarithm, almost always the natural log (base e) in ML papers.

  4. exp⁡\exp, eF(xj,c)e^{F(x_{j},c)}, eF(x,c)e^{F(x,c)}

    Exponential 7 uses

    The exponential function eˣ, with e ≈ 2.718. Always positive.

  5. ∝\propto

    Proportional to 2 uses

    Equal up to a constant factor that does not depend on the variable of interest.

  6. II

    Mutual information 1 use

    I(X; Y) is how much knowing Y tells you about X, in bits or nats. Zero means independent.

  7. ;;

    Semicolon (parameterized by) 1 use

    In p(x; θ), the semicolon separates the variable x from fixed parameters θ.

Functions and operators

  1. p(x∣c)p(x)\frac{p(x|c)}{p(x)}, p(xt+k∣ct)p(xt+k)\frac{p(x_{t+k}|c_{t})}{p(x_{t+k})}, p(xi∣ct)p(xi)\frac{p(x_{i}|c_{t})}{p(x_{i})}

    Fraction 22 uses

    Division: the top divided by the bottom.

  2. ∑x,c\sum_{x,c}, ∑xj∈X\sum_{x_{j}\in X}, ∑j=1N\sum^{N}_{j=1}

    Summation 12 uses

    Add up the expression for every value of the index, from the bottom limit to the top.

  3. ∏l≠i\prod_{l\neq i}, ∏l≠j\prod_{l\neq j}

    Product 2 uses

    Multiply the expression for every value of the index.

  4. [d=i][d=i]

    Iverson bracket 1 use

    Square brackets around a condition: 1 if it is true, 0 if it is false.

Sets, shapes and definitions

  1. ∈\in

    Element of 8 uses

    “Is in” or “belongs to”: x ∈ S says x is a member of the set S.

  2. ≥\geq, ≤\leq

    Inequalities 6 uses

    Less than / greater than (or equal). ≪ means “much smaller than”.

  3. ≠\neq

    Not equal 2 uses

    The two sides are different.

  4. ≈\approx

    Approximately equal 1 use

    Approximately equal: often a Monte Carlo estimate or a Taylor approximation.

  5. {x1,…xN}\{x_{1},\dots x_{N}\}

    Set braces 1 use

    A set: a collection of items. {x | condition} is every x that satisfies the condition.

1 thing the catalog has no entry for yet
  • E\mathop{{}\mathbb{E}} {}\mathbb{E} 16

Formulas from arXiv's HTML version of the paper, © their authors; the explanations are this site's. Title and authors as arXiv lists them.