Self-Supervised Learning
Self-supervised learning trains a network on unlabeled data by making the labels from the data itself. Each example supplies both an input and a target , and both are computed from . A network with parameters learns to predict the target from the input:
Here is a loss suited to the data, such as squared error for real values or cross-entropy for words. This prediction problem is called a pretext task. It uses the same losses and backpropagation as supervised learning. No person writes a label. Often the pretext task matters less than the representation the network builds to solve it. That representation later serves a downstream task, which may have few labels. The common pretext tasks differ in how they form the input and the target:
- Next-thing prediction: in a causal sequence , predict from . One sequence gives training pairs. Language models use this task with words as the elements.
- Masking: hide random parts of the input, such as words, image patches or graph nodes, and predict them from the rest. Filling in a hidden image region is called inpainting.
- Reconstruction: pass the whole input through a narrow code and reproduce it, as an autoencoder does.
- Denoising: corrupt the input with noise and predict the clean version.
Two lessons from the learned Kalman filter apply to pretext tasks in general. A network can learn a partial pattern, such as a hidden state known only up to a change of basis. Such a pattern can still be useful. The pretext model may also need scaffolding, meaning extra parts or assumptions that exist only to make the task trainable.
Classical unsupervised learning also uses no labels. Its two main problems are dimensionality reduction, such as PCA, and clustering, such as k-means. Self-supervised learning recasts such problems as prediction problems, so the tools of supervised deep learning apply. Methods that hide part of the data and predict it are called generative self-supervised learning. The other main family is contrastive self-supervised learning.
Not Taught in Lecture
Contrastive self-supervised learning has not been covered yet. It compares pairs of examples that share something with unrelated pairs. A related pair might be two transformed versions of one image (Prince, Understanding Deep Learning, section 9.3.7). SimCLR (Chen et al., 2020) maps two versions of the same image to nearby representations. It pushes versions of different images apart.
Note Will Be Extended
The course continues self-supervised learning in the following lecture. This note covers the material up to that point and will be extended.
Intuition
Labeled data are expensive, since a person must write each label. Unlabeled data, such as text, images and sensor logs, are plentiful. Self-supervised learning uses the unlabeled data by hiding part of each example and asking the network to guess it. A good guess requires knowledge. To predict a hidden word, the network must track grammar and meaning. To fill in a dog’s hidden ear, it must know what dogs look like. The network learns this knowledge while solving the pretext task, and a later task can reuse it.
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\definecolor{hot}{HTML}{D9483B}
\definecolor{cold}{HTML}{2F80ED}
\begin{tikzpicture}[x=1cm,y=1cm,>=Stealth]
\node[left] at (-0.2,0) {next-thing};
\foreach \i in {1,...,5} {
\draw[cold,thick] (\i*1.1-1.1,-0.4) rectangle (\i*1.1-0.3,0.4);
\node at (\i*1.1-0.7,0) {$\mathbf x_{\i}$};
}
\draw[hot,very thick] (5.5,-0.4) rectangle (6.3,0.4);
\node at (5.9,0) {$\mathbf x_6$};
\draw[->,thick] (0.4,0.5) .. controls (1.5,1.3) and (4.5,1.3) .. (5.8,0.5);
\node at (3.1,1.35) {predict from the past only};
\node[left] at (-0.2,-2.0) {masking};
\foreach \i/\c in {1/cold,2/hot,3/cold,4/cold,5/hot,6/cold} {
\draw[\c,thick] (\i*1.1-1.1,-2.4) rectangle (\i*1.1-0.3,-1.6);
}
\foreach \i in {1,3,4,6} \node at (\i*1.1-0.7,-2.0) {$\mathbf x_{\i}$};
\foreach \i in {2,5} {
\draw[hot,very thick] (\i*1.1-1.1,-2.4) rectangle (\i*1.1-0.3,-1.6);
\node at (\i*1.1-0.7,-2.0) {$\mathbf m$};
}
\draw[->,thick] (0.4,-2.5) .. controls (0.6,-3.0) and (1.3,-3.0) .. (1.5,-2.5);
\draw[->,thick] (2.6,-2.5) .. controls (2.4,-3.0) and (1.7,-3.0) .. (1.5,-2.5);
\draw[->,thick] (3.7,-2.5) .. controls (3.9,-3.0) and (4.6,-3.0) .. (4.8,-2.5);
\draw[->,thick] (5.9,-2.5) .. controls (5.7,-3.0) and (5.0,-3.0) .. (4.8,-2.5);
\node at (3.1,-3.35) {predict hidden entries from both sides};
\end{tikzpicture}
\end{document}The figure shows the two main ways to hold data back. Blue boxes are visible, and red boxes are the targets. Next-thing prediction hides the future and suits causal models, such as an RNN that reads a sequence in order. Masking replaces random entries with a mask vector and lets the network use context on both sides. The same idea works on graphs. A message-passing network replaces a hidden node’s features with a learnable mask vector and predicts what was there.
Images allow many more pretext tasks. The animation turns one unlabeled picture into six training pairs. Lecture covered masking. The other five tasks come from the chapter 9 notes in Prince.
\usepackage{tikz}
\usetikzlibrary{animations, arrows.meta}
\begin{document}
\definecolor{hot}{HTML}{D9483B}
\definecolor{cold}{HTML}{2F80ED}
\definecolor{mid}{HTML}{8A8A8A}
\newcommand{\house}[5]{\filldraw[draw=black, fill=#4] ({#1+0.2*#3},{#2+0.1*#3}) rectangle ({#1+0.8*#3},{#2+0.55*#3}); \filldraw[draw=black, fill=#5] ({#1+0.12*#3},{#2+0.55*#3}) -- ({#1+0.5*#3},{#2+0.88*#3}) -- ({#1+0.88*#3},{#2+0.55*#3}) -- cycle; \filldraw[draw=black, fill=white] ({#1+0.43*#3},{#2+0.1*#3}) rectangle ({#1+0.57*#3},{#2+0.33*#3}); \filldraw[draw=black, fill=white] ({#1+0.27*#3},{#2+0.36*#3}) rectangle ({#1+0.37*#3},{#2+0.46*#3}); \draw (#1,#2) rectangle ({#1+#3},{#2+#3});}
\begin{tikzpicture}[font=\small, >={Stealth[length=2.2mm]}]
\node[anchor=west] at (0.00,2.45) {\textbf{Masking}};
\node[anchor=west] at (5.90,2.45) {\textbf{Rotation}};
\node[anchor=west] at (11.80,2.45) {\textbf{Jigsaw}};
\node[anchor=west] at (0.00,-1.85) {\textbf{Colorization}};
\node[anchor=west] at (5.90,-1.85) {\textbf{Relative position}};
\node[anchor=west] at (11.80,-1.85) {\textbf{Contrastive pair}};
\begin{scope}[animate = {myself: = {:visible = {0s = "true", 1.4s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\begin{scope}[rotate around={0.0:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.000,0.000)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,1.333) rectangle (12.467,2.000);
\begin{scope}[shift={(0.000,0.000)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,1.333) rectangle (13.133,2.000);
\begin{scope}[shift={(0.000,0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.333) rectangle (13.800,2.000);
\begin{scope}[shift={(0.000,0.000)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,0.667) rectangle (12.467,1.333);
\begin{scope}[shift={(0.000,0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.000)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.667) rectangle (13.800,1.333);
\begin{scope}[shift={(0.000,0.000)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,0.000) rectangle (12.467,0.667);
\begin{scope}[shift={(0.000,0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.000) rectangle (13.133,0.667);
\begin{scope}[shift={(0.000,0.000)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.000) rectangle (13.800,0.667);
\house{0.000}{-4.300}{2.000}{cold}{hot}
\house{5.900}{-4.300}{2.000}{cold}{hot}
\draw[mid] (6.567,-4.300) -- (6.567,-2.300);
\draw[mid] (5.900,-3.633) -- (7.900,-3.633);
\draw[mid] (7.233,-4.300) -- (7.233,-2.300);
\draw[mid] (5.900,-2.967) -- (7.900,-2.967);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.800,-3.750)}, scale=0.4750]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=0.4750, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Start: one unlabeled picture.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 1.4s = "true", 1.6s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.779,1.359) rectangle (0.861,1.441);
\fill[mid] (1.179,0.379) rectangle (1.261,0.461);
\begin{scope}[rotate around={11.2:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.083,-0.167)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.883,1.167) rectangle (12.550,1.833);
\begin{scope}[shift={(0.083,-0.083)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.550,1.250) rectangle (13.217,1.917);
\begin{scope}[shift={(-0.167,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.967,1.333) rectangle (13.633,2.000);
\begin{scope}[shift={(0.167,-0.083)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.967,0.583) rectangle (12.633,1.250);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.083)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.750) rectangle (13.800,1.417);
\begin{scope}[shift={(0.083,0.167)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.883,0.167) rectangle (12.550,0.833);
\begin{scope}[shift={(-0.083,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.383,0.000) rectangle (13.050,0.667);
\begin{scope}[shift={(-0.167,0.083)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.967,0.083) rectangle (13.633,0.750);
\house{0.000}{-4.300}{2.000}{cold}{hot}
\house{5.900}{-4.300}{2.000}{cold}{hot}
\draw[mid] (6.567,-4.300) -- (6.567,-2.300);
\draw[mid] (5.900,-3.633) -- (7.900,-3.633);
\draw[mid] (7.233,-4.300) -- (7.233,-2.300);
\draw[mid] (5.900,-2.967) -- (7.900,-2.967);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.792,-3.770)}, scale=0.4883]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=0.4342, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 1.6s = "true", 1.8s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.737,1.317) rectangle (0.902,1.482);
\fill[mid] (1.137,0.337) rectangle (1.302,0.502);
\begin{scope}[rotate around={22.5:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.167,-0.333)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.967,1.000) rectangle (12.633,1.667);
\begin{scope}[shift={(0.167,-0.167)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.633,1.167) rectangle (13.300,1.833);
\begin{scope}[shift={(-0.333,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.800,1.333) rectangle (13.467,2.000);
\begin{scope}[shift={(0.333,-0.167)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.133,0.500) rectangle (12.800,1.167);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.167)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.833) rectangle (13.800,1.500);
\begin{scope}[shift={(0.167,0.333)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.967,0.333) rectangle (12.633,1.000);
\begin{scope}[shift={(-0.167,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.300,0.000) rectangle (12.967,0.667);
\begin{scope}[shift={(-0.333,0.167)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.800,0.167) rectangle (13.467,0.833);
\house{0.000}{-4.300}{2.000}{cold}{hot}
\house{5.900}{-4.300}{2.000}{cold}{hot}
\draw[mid] (6.567,-4.300) -- (6.567,-2.300);
\draw[mid] (5.900,-3.633) -- (7.900,-3.633);
\draw[mid] (7.233,-4.300) -- (7.233,-2.300);
\draw[mid] (5.900,-2.967) -- (7.900,-2.967);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.772,-3.823)}, scale=0.5232]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=0.3266, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 1.8s = "true", 2s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.696,1.276) rectangle (0.944,1.524);
\fill[mid] (1.096,0.296) rectangle (1.344,0.544);
\begin{scope}[rotate around={33.8:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.250,-0.500)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.050,0.833) rectangle (12.717,1.500);
\begin{scope}[shift={(0.250,-0.250)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.717,1.083) rectangle (13.383,1.750);
\begin{scope}[shift={(-0.500,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.633,1.333) rectangle (13.300,2.000);
\begin{scope}[shift={(0.500,-0.250)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.300,0.417) rectangle (12.967,1.083);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.250)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.917) rectangle (13.800,1.583);
\begin{scope}[shift={(0.250,0.500)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.050,0.500) rectangle (12.717,1.167);
\begin{scope}[shift={(-0.250,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.217,0.000) rectangle (12.883,0.667);
\begin{scope}[shift={(-0.500,0.250)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.633,0.250) rectangle (13.300,0.917);
\house{0.000}{-4.300}{2.000}{cold}{hot}
\begin{scope}[shift={(-0.018,-0.005)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.549,-3.638) rectangle (7.216,-2.971);
\begin{scope}[shift={(0.018,-0.027)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.584,-2.994) rectangle (7.251,-2.327);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.748,-3.902)}, scale=0.5727]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=0.1744, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2s = "true", 2.2s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.655,1.235) rectangle (0.985,1.565);
\fill[mid] (1.055,0.255) rectangle (1.385,0.585);
\begin{scope}[rotate around={45.0:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.333,-0.667)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.133,0.667) rectangle (12.800,1.333);
\begin{scope}[shift={(0.333,-0.333)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.800,1.000) rectangle (13.467,1.667);
\begin{scope}[shift={(-0.667,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,1.333) rectangle (13.133,2.000);
\begin{scope}[shift={(0.667,-0.333)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.333) rectangle (13.133,1.000);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.333)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.000) rectangle (13.800,1.667);
\begin{scope}[shift={(0.333,0.667)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.133,0.667) rectangle (12.800,1.333);
\begin{scope}[shift={(-0.333,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.133,0.000) rectangle (12.800,0.667);
\begin{scope}[shift={(-0.667,0.333)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.333) rectangle (13.133,1.000);
\house{0.000}{-4.300}{2.000}{white}{mid}
\begin{scope}[shift={(-0.109,-0.030)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.458,-3.663) rectangle (7.124,-2.996);
\begin{scope}[shift={(0.109,-0.169)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.676,-3.135) rectangle (7.342,-2.469);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.724,-3.999)}, scale=0.6294]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=0.0190, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.2s = "true", 2.4s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.614,1.194) rectangle (1.026,1.606);
\fill[mid] (1.014,0.214) rectangle (1.426,0.626);
\begin{scope}[rotate around={56.2:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.417,-0.833)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.217,0.500) rectangle (12.883,1.167);
\begin{scope}[shift={(0.417,-0.417)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.883,0.917) rectangle (13.550,1.583);
\begin{scope}[shift={(-0.833,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.300,1.333) rectangle (12.967,2.000);
\begin{scope}[shift={(0.833,-0.417)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.633,0.250) rectangle (13.300,0.917);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.417)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.083) rectangle (13.800,1.750);
\begin{scope}[shift={(0.417,0.833)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.217,0.833) rectangle (12.883,1.500);
\begin{scope}[shift={(-0.417,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.050,0.000) rectangle (12.717,0.667);
\begin{scope}[shift={(-0.833,0.417)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.300,0.417) rectangle (12.967,1.083);
\house{0.000}{-4.300}{2.000}{white}{mid}
\begin{scope}[shift={(-0.246,-0.067)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.321,-3.700) rectangle (6.988,-3.034);
\begin{scope}[shift={(0.246,-0.380)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.812,-3.346) rectangle (7.479,-2.680);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.706,-4.102)}, scale=0.6861]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=-0.1744, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.4s = "true", 2.6s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.573,1.152) rectangle (1.067,1.647);
\fill[mid] (0.972,0.172) rectangle (1.468,0.667);
\begin{scope}[rotate around={67.5:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.500,-1.000)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.300,0.333) rectangle (12.967,1.000);
\begin{scope}[shift={(0.500,-0.500)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.967,0.833) rectangle (13.633,1.500);
\begin{scope}[shift={(-1.000,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.133,1.333) rectangle (12.800,2.000);
\begin{scope}[shift={(1.000,-0.500)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.800,0.167) rectangle (13.467,0.833);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.500)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.167) rectangle (13.800,1.833);
\begin{scope}[shift={(0.500,1.000)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.300,1.000) rectangle (12.967,1.667);
\begin{scope}[shift={(-0.500,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.967,0.000) rectangle (12.633,0.667);
\begin{scope}[shift={(-1.000,0.500)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.133,0.500) rectangle (12.800,1.167);
\house{0.000}{-4.300}{2.000}{white}{mid}
\begin{scope}[shift={(-0.390,-0.106)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.177,-3.740) rectangle (6.844,-3.073);
\begin{scope}[shift={(0.390,-0.602)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.956,-3.569) rectangle (7.623,-2.902);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.695,-4.197)}, scale=0.7355]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=-0.3266, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.6s = "true", 2.8s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.531,1.111) rectangle (1.109,1.689);
\fill[mid] (0.931,0.131) rectangle (1.509,0.709);
\begin{scope}[rotate around={78.8:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.583,-1.167)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.383,0.167) rectangle (13.050,0.833);
\begin{scope}[shift={(0.583,-0.583)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.050,0.750) rectangle (13.717,1.417);
\begin{scope}[shift={(-1.167,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.967,1.333) rectangle (12.633,2.000);
\begin{scope}[shift={(1.167,-0.583)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.967,0.083) rectangle (13.633,0.750);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.583)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.250) rectangle (13.800,1.917);
\begin{scope}[shift={(0.583,1.167)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.383,1.167) rectangle (13.050,1.833);
\begin{scope}[shift={(-0.583,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.883,0.000) rectangle (12.550,0.667);
\begin{scope}[shift={(-1.167,0.583)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.967,0.583) rectangle (12.633,1.250);
\house{0.000}{-4.300}{2.000}{white}{mid}
\begin{scope}[shift={(-0.504,-0.137)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.063,-3.771) rectangle (6.730,-3.104);
\begin{scope}[shift={(0.504,-0.778)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (7.070,-3.745) rectangle (7.737,-3.078);
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.689,-4.267)}, scale=0.7705]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=-0.4342, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.8s = "true", 3s = "false", 6.2s = "false", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.490,1.070) rectangle (1.150,1.730);
\fill[mid] (0.890,0.090) rectangle (1.550,0.750);
\begin{scope}[rotate around={90.0:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\begin{scope}[shift={(0.667,-1.333)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.000) rectangle (13.133,0.667);
\begin{scope}[shift={(0.667,-0.667)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.667) rectangle (13.800,1.333);
\begin{scope}[shift={(-1.333,-0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,1.333) rectangle (12.467,2.000);
\begin{scope}[shift={(1.333,-0.667)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.000) rectangle (13.800,0.667);
\begin{scope}[shift={(0.000,-0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.667)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.333) rectangle (13.800,2.000);
\begin{scope}[shift={(0.667,1.333)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,1.333) rectangle (13.133,2.000);
\begin{scope}[shift={(-0.667,-0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,0.000) rectangle (12.467,0.667);
\begin{scope}[shift={(-1.333,0.667)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,0.667) rectangle (12.467,1.333);
\house{0.000}{-4.300}{2.000}{white}{mid}
\begin{scope}[shift={(-0.550,-0.150)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.017,-3.783) rectangle (6.683,-3.117);
\begin{scope}[shift={(0.550,-0.850)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (7.117,-3.817) rectangle (7.783,-3.150);
\node[below] at (6.35,-3.78) {\scriptsize center};
\node[below] at (7.45,-3.82) {\scriptsize other};
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.687,-4.294)}, scale=0.7837]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=-0.4750, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[below] at (12.28,-3.75) {\scriptsize crop};
\node[below] at (13.36,-3.75) {\scriptsize flip};
\node[anchor=west] at (0,-4.95) {Make a training input from it.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 3s = "true", 6.2s = "true", repeats}}}]
\house{0.000}{0.000}{2.000}{cold}{hot}
\fill[mid] (0.490,1.070) rectangle (1.150,1.730);
\fill[mid] (0.890,0.090) rectangle (1.550,0.750);
\draw[->, very thick] (2.30,1.00) -- (2.85,1.00);
\node[anchor=west, align=left] at (2.90,1.00) {\footnotesize label: the hidden\\ pixels};
\begin{scope}[rotate around={90.0:(6.90,1.00)}]
\house{5.900}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw[->, very thick] (8.20,1.00) -- (8.75,1.00);
\node[anchor=west, align=left] at (8.80,1.00) {\footnotesize label: $90^\circ$, one of\\ $0^\circ, 90^\circ, 180^\circ, 270^\circ$};
\begin{scope}[shift={(0.667,-1.333)}]
\clip (11.800,1.333) rectangle (12.467,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.000) rectangle (13.133,0.667);
\begin{scope}[shift={(0.667,-0.667)}]
\clip (12.467,1.333) rectangle (13.133,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.667) rectangle (13.800,1.333);
\begin{scope}[shift={(-1.333,0.000)}]
\clip (13.133,1.333) rectangle (13.800,2.000);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,1.333) rectangle (12.467,2.000);
\begin{scope}[shift={(1.333,-0.667)}]
\clip (11.800,0.667) rectangle (12.467,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,0.000) rectangle (13.800,0.667);
\begin{scope}[shift={(0.000,0.000)}]
\clip (12.467,0.667) rectangle (13.133,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,0.667) rectangle (13.133,1.333);
\begin{scope}[shift={(0.000,0.667)}]
\clip (13.133,0.667) rectangle (13.800,1.333);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (13.133,1.333) rectangle (13.800,2.000);
\begin{scope}[shift={(0.667,1.333)}]
\clip (11.800,0.000) rectangle (12.467,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.467,1.333) rectangle (13.133,2.000);
\begin{scope}[shift={(-0.667,0.000)}]
\clip (12.467,0.000) rectangle (13.133,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,0.000) rectangle (12.467,0.667);
\begin{scope}[shift={(-1.333,0.667)}]
\clip (13.133,0.000) rectangle (13.800,0.667);
\house{11.800}{0.000}{2.000}{cold}{hot}
\end{scope}
\draw (11.800,0.667) rectangle (12.467,1.333);
\draw[->, very thick] (14.10,1.00) -- (14.65,1.00);
\node[anchor=west, align=left] at (14.70,1.00) {\footnotesize label: which shuffle\\ was used};
\house{0.000}{-4.300}{2.000}{white}{mid}
\draw[->, very thick] (2.30,-3.30) -- (2.85,-3.30);
\node[anchor=west, align=left] at (2.90,-3.30) {\footnotesize label: the colors};
\begin{scope}[shift={(-0.550,-0.150)}]
\clip (6.567,-3.633) rectangle (7.233,-2.967);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (6.017,-3.783) rectangle (6.683,-3.117);
\begin{scope}[shift={(0.550,-0.850)}]
\clip (6.567,-2.967) rectangle (7.233,-2.300);
\house{5.900}{-4.300}{2.000}{cold}{hot}
\end{scope}
\draw (7.117,-3.817) rectangle (7.783,-3.150);
\node[below] at (6.35,-3.78) {\scriptsize center};
\node[below] at (7.45,-3.82) {\scriptsize other};
\draw[->, very thick] (8.20,-3.30) -- (8.75,-3.30);
\node[anchor=west, align=left] at (8.80,-3.30) {\footnotesize label: above, one of\\ $8$ places around\\ the center};
\begin{scope}
\clip (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(11.687,-4.294)}, scale=0.7837]
\house{0.000}{0.000}{2.000}{cold}{hot}
\end{scope}
\end{scope}
\draw (11.800,-3.750) rectangle (12.750,-2.800);
\begin{scope}[shift={(13.355,-3.275)}, xscale=-0.4750, yscale=0.4750]
\house{-1.000}{-1.000}{2.000}{cold}{hot}
\end{scope}
\draw (12.880,-3.750) rectangle (13.830,-2.800);
\node[below] at (12.28,-3.75) {\scriptsize crop};
\node[below] at (13.36,-3.75) {\scriptsize flip};
\draw[->, very thick] (14.10,-3.30) -- (14.65,-3.30);
\node[anchor=west, align=left] at (14.70,-3.30) {\footnotesize label: same picture\\ or not (here: same)};
\node[anchor=west] at (0,-4.95) {The label comes from the picture itself. No person writes it.};
\end{scope}
\end{tikzpicture}
\end{document}Contrastive learning, described in the warning above, compares pairs instead of filling in gaps. In the next animation, four images each get two augmented views. Training pulls the two views of each image together and pushes different images apart. The cosine matrix on the right fills its diagonal as the loss falls.
\usepackage{tikz}
\usetikzlibrary{animations, arrows.meta}
\begin{document}
\definecolor{hot}{HTML}{D9483B}
\definecolor{cold}{HTML}{2F80ED}
\definecolor{mid}{HTML}{8A8A8A}
\newcommand{\mC}[2]{\filldraw[#2] (#1) circle (0.13);}
\newcommand{\mS}[2]{\filldraw[#2] (#1) ++(-0.12,-0.12) rectangle ++(0.24,0.24);}
\newcommand{\mT}[2]{\filldraw[#2] (#1) ++(0,0.16) -- ++(-0.14,-0.245) -- ++(0.28,0) -- cycle;}
\newcommand{\mD}[2]{\filldraw[#2] (#1) ++(0,0.16) -- ++(0.16,-0.16) -- ++(-0.16,-0.16) -- ++(-0.16,0.16) -- cycle;}
\newcommand{\hs}[3]{\filldraw[#3] (#1) ++({-#2},{-#2}) rectangle ++({2*#2},{2*#2});}
\begin{tikzpicture}[font=\small, >={Stealth[length=2.2mm]}]
\draw[thick] (0,0) circle (1.9);
\draw[mid] (1.65,-0.29) -- (1.72,-0.25) -- (1.79,-0.20) -- (1.84,-0.15) -- (1.87,-0.10) -- (1.89,-0.05) -- (1.90,-0.00);
\draw[mid] (-1.89,-0.05) -- (-1.87,-0.10) -- (-1.84,-0.15) -- (-1.79,-0.20) -- (-1.72,-0.25) -- (-1.65,-0.29) -- (-1.56,-0.34) -- (-1.46,-0.38) -- (-1.34,-0.42) -- (-1.22,-0.45) -- (-1.09,-0.48) -- (-0.95,-0.51) -- (-0.80,-0.53) -- (-0.65,-0.55) -- (-0.49,-0.57) -- (-0.33,-0.58) -- (-0.17,-0.58) -- (-0.00,-0.59) -- (0.17,-0.58) -- (0.33,-0.58) -- (0.49,-0.57) -- (0.65,-0.55) -- (0.80,-0.53) -- (0.95,-0.51) -- (1.09,-0.48) -- (1.22,-0.45) -- (1.34,-0.42) -- (1.46,-0.38) -- (1.56,-0.34) -- (1.65,-0.29) -- (1.65,-0.29);
\draw[mid, dashed] (1.89,0.05) -- (1.87,0.10) -- (1.84,0.15) -- (1.79,0.20) -- (1.72,0.25) -- (1.65,0.29) -- (1.56,0.34) -- (1.46,0.38) -- (1.34,0.42) -- (1.22,0.45) -- (1.09,0.48) -- (0.95,0.51) -- (0.80,0.53) -- (0.65,0.55) -- (0.49,0.57) -- (0.33,0.58) -- (0.17,0.58) -- (0.00,0.59) -- (-0.17,0.58) -- (-0.33,0.58) -- (-0.49,0.57) -- (-0.65,0.55) -- (-0.80,0.53) -- (-0.95,0.51) -- (-1.09,0.48) -- (-1.22,0.45) -- (-1.34,0.42) -- (-1.46,0.38) -- (-1.56,0.34) -- (-1.65,0.29) -- (-1.72,0.25) -- (-1.79,0.20) -- (-1.84,0.15) -- (-1.87,0.10) -- (-1.89,0.05) -- (-1.90,0.00);
\draw (3.6,1.5) rectangle (6.72,-1.62);
\mC{3.25,1.11}{draw=black, fill=cold}
\mC{3.99,1.85}{draw=black, fill=hot}
\mS{3.25,0.33}{draw=black, fill=cold}
\mS{4.77,1.85}{draw=black, fill=hot}
\mT{3.25,-0.45}{draw=black, fill=cold}
\mT{5.55,1.85}{draw=black, fill=hot}
\mD{3.25,-1.23}{draw=black, fill=cold}
\mD{6.33,1.85}{draw=black, fill=hot}
\node at (5.16,2.45) {cosine of view 1 (rows) and view 2 (columns)};
\begin{scope}[animate = {myself: = {:visible = {0s = "true", 0.32s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.60,-1.02) -- (-1.61,-1.00) -- (-1.60,-0.98) -- (-1.58,-0.94) -- (-1.53,-0.89) -- (-1.47,-0.83) -- (-1.39,-0.76) -- (-1.29,-0.69) -- (-1.18,-0.60);
\draw[dashed] (-0.45,1.52) -- (-0.01,1.56) -- (0.42,1.52) -- (0.83,1.39) -- (1.20,1.20) -- (1.51,0.94) -- (1.73,0.63) -- (1.86,0.29);
\draw[] (1.86,0.29) -- (1.90,-0.07);
\draw[dashed] (1.54,-0.36) -- (1.69,-0.03) -- (1.76,0.30) -- (1.76,0.62) -- (1.67,0.91);
\draw[] (1.67,0.91) -- (1.50,1.16) -- (1.26,1.35) -- (0.96,1.48) -- (0.62,1.53);
\draw[] (-1.73,0.78) -- (-1.75,0.71) -- (-1.72,0.62) -- (-1.64,0.51) -- (-1.52,0.40) -- (-1.35,0.27) -- (-1.15,0.13) -- (-0.92,-0.01) -- (-0.67,-0.15);
\mT{1.54,-0.36}{draw=cold, thick, fill=white}
\mS{-0.45,1.52}{draw=cold, thick, fill=white}
\mC{-1.60,-1.02}{draw=cold, thick, fill=white}
\mD{-1.73,0.78}{draw=cold, thick, fill=white}
\mS{1.90,-0.07}{draw=black, fill=hot}
\mT{0.62,1.53}{draw=black, fill=hot}
\mC{-1.18,-0.60}{draw=black, fill=hot}
\mD{-0.67,-0.15}{draw=black, fill=hot}
\hs{3.99,1.11}{0.22}{draw=black, fill=hot}
\hs{4.77,1.11}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.25}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=black, fill=cold}
\hs{3.99,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.09}{draw=hot, thick, fill=white}
\hs{5.55,0.33}{0.10}{draw=black, fill=cold}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.27}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.06}{draw=hot, thick, fill=white}
\hs{6.33,-0.45}{0.26}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.14}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.31}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.08}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.36$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.12$, \ different $-0.27$};
\node[anchor=west] at (-2.3,-3.35) {Before training: the views of one image are scattered.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 0.32s = "true", 0.64s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.52,-1.12) -- (-1.49,-1.10) -- (-1.45,-1.08) -- (-1.38,-1.04) -- (-1.30,-0.98) -- (-1.21,-0.92) -- (-1.10,-0.85) -- (-0.98,-0.76) -- (-0.85,-0.67);
\draw[dashed] (-0.74,1.48) -- (-0.33,1.55) -- (0.10,1.53) -- (0.53,1.44) -- (0.93,1.27) -- (1.28,1.03) -- (1.56,0.74) -- (1.76,0.40) -- (1.86,0.05);
\draw[dashed] (1.32,-0.27) -- (1.48,0.07) -- (1.58,0.41) -- (1.60,0.73) -- (1.55,1.01) -- (1.43,1.25);
\draw[] (1.43,1.25) -- (1.24,1.43) -- (0.99,1.54) -- (0.69,1.58);
\draw[] (-1.76,0.66) -- (-1.71,0.60) -- (-1.61,0.51) -- (-1.48,0.41) -- (-1.30,0.30) -- (-1.08,0.19) -- (-0.84,0.06) -- (-0.57,-0.06) -- (-0.29,-0.18);
\mT{1.32,-0.27}{draw=cold, thick, fill=white}
\mS{-0.74,1.48}{draw=cold, thick, fill=white}
\mS{1.86,0.05}{draw=hot, thick, fill=white}
\mC{-1.52,-1.12}{draw=black, fill=cold}
\mD{-1.76,0.66}{draw=black, fill=cold}
\mT{0.69,1.58}{draw=black, fill=hot}
\mC{-0.85,-0.67}{draw=black, fill=hot}
\mD{-0.29,-0.18}{draw=black, fill=hot}
\hs{3.99,1.11}{0.22}{draw=black, fill=hot}
\hs{4.77,1.11}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.25}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=black, fill=cold}
\hs{3.99,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.09}{draw=hot, thick, fill=white}
\hs{5.55,0.33}{0.10}{draw=black, fill=cold}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.27}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.06}{draw=hot, thick, fill=white}
\hs{6.33,-0.45}{0.26}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.14}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.31}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.08}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.36$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.12$, \ different $-0.27$};
\node[anchor=west] at (-2.3,-3.35) {Before training: the views of one image are scattered.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 0.64s = "true", 0.96s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.38,-1.21) -- (-1.31,-1.20) -- (-1.23,-1.16) -- (-1.13,-1.12) -- (-1.02,-1.06) -- (-0.90,-0.99) -- (-0.77,-0.91) -- (-0.63,-0.81) -- (-0.48,-0.71);
\draw[dashed] (-1.01,1.42) -- (-0.63,1.52) -- (-0.22,1.53) -- (0.20,1.46) -- (0.62,1.32) -- (0.99,1.10) -- (1.32,0.83) -- (1.58,0.51) -- (1.75,0.17);
\draw[dashed] (1.04,-0.19) -- (1.21,0.16) -- (1.33,0.51) -- (1.38,0.83) -- (1.37,1.11) -- (1.29,1.34) -- (1.16,1.51);
\draw[] (1.16,1.51) -- (0.97,1.60) -- (0.73,1.62);
\draw[] (-1.71,0.55) -- (-1.60,0.49) -- (-1.44,0.41) -- (-1.25,0.33) -- (-1.02,0.23) -- (-0.76,0.13) -- (-0.49,0.02) -- (-0.20,-0.09) -- (0.10,-0.19);
\mT{1.04,-0.19}{draw=cold, thick, fill=white}
\mS{-1.01,1.42}{draw=cold, thick, fill=white}
\mS{1.75,0.17}{draw=hot, thick, fill=white}
\mC{-1.38,-1.21}{draw=black, fill=cold}
\mD{-1.71,0.55}{draw=black, fill=cold}
\mT{0.73,1.62}{draw=black, fill=hot}
\mC{-0.48,-0.71}{draw=black, fill=hot}
\mD{0.10,-0.19}{draw=black, fill=hot}
\hs{3.99,1.11}{0.22}{draw=black, fill=hot}
\hs{4.77,1.11}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.25}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=black, fill=cold}
\hs{3.99,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.09}{draw=hot, thick, fill=white}
\hs{5.55,0.33}{0.10}{draw=black, fill=cold}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.27}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.06}{draw=hot, thick, fill=white}
\hs{6.33,-0.45}{0.26}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.14}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.31}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.08}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.36$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.12$, \ different $-0.27$};
\node[anchor=west] at (-2.3,-3.35) {Before training: the views of one image are scattered.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 0.96s = "true", 1.28s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.17,-1.30) -- (-1.07,-1.27) -- (-0.95,-1.23) -- (-0.83,-1.18) -- (-0.69,-1.11) -- (-0.55,-1.04) -- (-0.40,-0.94) -- (-0.24,-0.84) -- (-0.09,-0.73);
\draw[dashed] (-1.22,1.35) -- (-0.90,1.47) -- (-0.53,1.51) -- (-0.13,1.47) -- (0.28,1.35) -- (0.67,1.16) -- (1.02,0.91) -- (1.33,0.61) -- (1.56,0.28);
\draw[dashed] (0.72,-0.13) -- (0.89,0.23) -- (1.02,0.58) -- (1.10,0.91) -- (1.13,1.19) -- (1.11,1.42) -- (1.03,1.58);
\draw[] (1.03,1.58) -- (0.91,1.66) -- (0.74,1.67);
\draw[] (-1.58,0.44) -- (-1.41,0.39) -- (-1.21,0.33) -- (-0.97,0.25) -- (-0.70,0.17) -- (-0.41,0.09) -- (-0.12,0.00) -- (0.18,-0.09) -- (0.48,-0.17);
\mT{0.72,-0.13}{draw=cold, thick, fill=white}
\mS{1.56,0.28}{draw=hot, thick, fill=white}
\mS{-1.22,1.35}{draw=cold, thick, fill=white}
\mT{0.74,1.67}{draw=black, fill=hot}
\mC{-1.17,-1.30}{draw=black, fill=cold}
\mD{-1.58,0.44}{draw=black, fill=cold}
\mC{-0.09,-0.73}{draw=black, fill=hot}
\mD{0.48,-0.17}{draw=black, fill=hot}
\hs{3.99,1.11}{0.22}{draw=black, fill=hot}
\hs{4.77,1.11}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.25}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=black, fill=cold}
\hs{3.99,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.09}{draw=hot, thick, fill=white}
\hs{5.55,0.33}{0.10}{draw=black, fill=cold}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.27}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.06}{draw=hot, thick, fill=white}
\hs{6.33,-0.45}{0.26}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.14}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.31}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.08}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.36$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.12$, \ different $-0.27$};
\node[anchor=west] at (-2.3,-3.35) {Before training: the views of one image are scattered.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 1.28s = "true", 1.56s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.02,-1.31) -- (-0.87,-1.29) -- (-0.71,-1.24) -- (-0.54,-1.18) -- (-0.36,-1.11) -- (-0.18,-1.01) -- (0.01,-0.91) -- (0.20,-0.79) -- (0.38,-0.66);
\draw[dashed] (-1.35,1.27) -- (-1.09,1.38) -- (-0.76,1.43) -- (-0.40,1.40) -- (-0.02,1.29) -- (0.37,1.13) -- (0.73,0.90) -- (1.06,0.63) -- (1.34,0.32);
\draw[dashed] (0.31,-0.12) -- (0.46,0.26) -- (0.58,0.62) -- (0.68,0.96) -- (0.75,1.26) -- (0.78,1.49) -- (0.77,1.66) -- (0.73,1.75);
\draw[] (0.73,1.75) -- (0.66,1.76);
\draw[] (-1.37,0.35) -- (-1.16,0.32) -- (-0.91,0.27) -- (-0.64,0.21) -- (-0.36,0.15) -- (-0.06,0.09) -- (0.24,0.02) -- (0.53,-0.04) -- (0.80,-0.11);
\mT{0.31,-0.12}{draw=cold, thick, fill=white}
\mS{1.34,0.32}{draw=hot, thick, fill=white}
\mS{-1.35,1.27}{draw=cold, thick, fill=white}
\mT{0.66,1.76}{draw=black, fill=hot}
\mC{-1.02,-1.31}{draw=black, fill=cold}
\mD{-1.37,0.35}{draw=black, fill=cold}
\mD{0.80,-0.11}{draw=black, fill=hot}
\mC{0.38,-0.66}{draw=black, fill=hot}
\hs{3.99,1.11}{0.19}{draw=black, fill=hot}
\hs{4.77,1.11}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.25}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.08}{draw=black, fill=cold}
\hs{3.99,0.33}{0.19}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.08}{draw=hot, thick, fill=white}
\hs{5.55,0.33}{0.11}{draw=black, fill=cold}
\hs{6.33,0.33}{0.18}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.26}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.05}{draw=hot, thick, fill=white}
\hs{6.33,-0.45}{0.27}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.13}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.31}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.10}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.33$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.12$, \ different $-0.29$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 1.56s = "true", 1.84s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.04,-1.20) -- (-0.82,-1.19) -- (-0.58,-1.15) -- (-0.32,-1.09) -- (-0.06,-0.99) -- (0.20,-0.88) -- (0.46,-0.74) -- (0.71,-0.58) -- (0.94,-0.42);
\draw[dashed] (-1.42,1.16) -- (-1.19,1.24) -- (-0.91,1.25) -- (-0.58,1.21) -- (-0.22,1.11) -- (0.15,0.97) -- (0.51,0.77) -- (0.84,0.54) -- (1.14,0.29);
\draw[dashed] (-0.19,-0.19) -- (-0.11,0.20) -- (-0.03,0.59) -- (0.05,0.94) -- (0.13,1.26) -- (0.20,1.52) -- (0.27,1.71) -- (0.32,1.83) -- (0.36,1.87);
\draw[] (-1.06,0.30) -- (-0.82,0.27) -- (-0.56,0.25) -- (-0.29,0.22) -- (-0.02,0.18) -- (0.26,0.14) -- (0.53,0.10) -- (0.79,0.05) -- (1.04,0.00);
\mT{-0.19,-0.19}{draw=cold, thick, fill=white}
\mS{1.14,0.29}{draw=hot, thick, fill=white}
\mS{-1.42,1.16}{draw=cold, thick, fill=white}
\mT{0.36,1.87}{draw=hot, thick, fill=white}
\mC{-1.04,-1.20}{draw=black, fill=cold}
\mD{-1.06,0.30}{draw=black, fill=cold}
\mD{1.04,0.00}{draw=black, fill=hot}
\mC{0.94,-0.42}{draw=black, fill=hot}
\hs{3.99,1.11}{0.11}{draw=black, fill=hot}
\hs{4.77,1.11}{0.29}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.24}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.05}{draw=black, fill=cold}
\hs{3.99,0.33}{0.24}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.05}{draw=hot, thick, fill=white}
\hs{5.55,0.33}{0.15}{draw=black, fill=cold}
\hs{6.33,0.33}{0.21}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.29}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.24}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.04}{draw=hot, thick, fill=white}
\hs{6.33,-0.45}{0.30}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.12}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.32}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.13}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.28$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.11$, \ different $-0.32$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 1.84s = "true", 2.12s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.17,-0.97) -- (-0.86,-0.96) -- (-0.52,-0.92) -- (-0.16,-0.84) -- (0.21,-0.72) -- (0.57,-0.57) -- (0.91,-0.40) -- (1.20,-0.21) -- (1.45,-0.01);
\draw[dashed] (-1.47,0.96) -- (-1.25,0.99) -- (-0.99,0.97) -- (-0.68,0.92) -- (-0.35,0.82) -- (-0.00,0.70) -- (0.35,0.55) -- (0.68,0.37) -- (0.98,0.18);
\draw[dashed] (-0.72,-0.33) -- (-0.74,0.04) -- (-0.74,0.42) -- (-0.70,0.77) -- (-0.63,1.10) -- (-0.54,1.38) -- (-0.43,1.61) -- (-0.31,1.78) -- (-0.17,1.87);
\draw[] (-0.67,0.27) -- (-0.43,0.27) -- (-0.19,0.27) -- (0.06,0.26) -- (0.30,0.24) -- (0.54,0.22) -- (0.78,0.20) -- (0.99,0.17) -- (1.19,0.15);
\mT{-0.72,-0.33}{draw=cold, thick, fill=white}
\mS{0.98,0.18}{draw=hot, thick, fill=white}
\mS{-1.47,0.96}{draw=cold, thick, fill=white}
\mT{-0.17,1.87}{draw=hot, thick, fill=white}
\mC{-1.17,-0.97}{draw=black, fill=cold}
\mC{1.45,-0.01}{draw=black, fill=hot}
\mD{1.19,0.15}{draw=black, fill=hot}
\mD{-0.67,0.27}{draw=black, fill=cold}
\hs{3.99,1.11}{0.03}{draw=hot, thick, fill=white}
\hs{4.77,1.11}{0.30}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.18}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,0.33}{0.21}{draw=black, fill=cold}
\hs{6.33,0.33}{0.25}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.29}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.19}{draw=black, fill=cold}
\hs{6.33,-0.45}{0.32}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.32}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.17}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.24$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.10$, \ different $-0.35$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.12s = "true", 2.4s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.32,-0.60) -- (-0.96,-0.52) -- (-0.53,-0.40) -- (-0.07,-0.25) -- (0.40,-0.09) -- (0.84,0.08) -- (1.22,0.24) -- (1.52,0.38) -- (1.72,0.51);
\draw[dashed] (-1.46,0.65) -- (-1.24,0.63) -- (-0.99,0.59) -- (-0.70,0.53) -- (-0.39,0.46) -- (-0.07,0.37) -- (0.25,0.27) -- (0.57,0.16) -- (0.87,0.04);
\draw[dashed] (-1.19,-0.54) -- (-1.29,-0.22) -- (-1.35,0.11) -- (-1.36,0.44) -- (-1.34,0.75) -- (-1.27,1.03) -- (-1.16,1.29) -- (-1.01,1.50) -- (-0.84,1.67);
\draw[] (-0.21,0.29) -- (-0.01,0.30) -- (0.20,0.32) -- (0.40,0.32) -- (0.59,0.32) -- (0.78,0.32) -- (0.96,0.32) -- (1.13,0.31) -- (1.29,0.30);
\mS{0.87,0.04}{draw=hot, thick, fill=white}
\mT{-1.19,-0.54}{draw=cold, thick, fill=white}
\mS{-1.46,0.65}{draw=cold, thick, fill=white}
\mT{-0.84,1.67}{draw=hot, thick, fill=white}
\mC{1.72,0.51}{draw=black, fill=hot}
\mC{-1.32,-0.60}{draw=black, fill=cold}
\mD{1.29,0.30}{draw=black, fill=hot}
\mD{-0.21,0.29}{draw=black, fill=cold}
\hs{3.99,1.11}{0.17}{draw=hot, thick, fill=white}
\hs{4.77,1.11}{0.30}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.03}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.02}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.26}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.05}{draw=black, fill=hot}
\hs{5.55,0.33}{0.25}{draw=black, fill=cold}
\hs{6.33,0.33}{0.29}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.30}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.12}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.05}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.33}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.09}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.31}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.22}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.23$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.11$, \ different $-0.34$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.4s = "true", 2.68s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.44,-0.14) -- (-1.14,0.24) -- (-0.74,0.60) -- (-0.28,0.91) -- (0.20,1.14) -- (0.67,1.28) -- (1.08,1.30) -- (1.39,1.22);
\draw[dashed] (1.39,1.22) -- (1.60,1.03);
\draw[dashed] (-1.34,0.23) -- (-1.13,0.19) -- (-0.88,0.16) -- (-0.62,0.11) -- (-0.34,0.07) -- (-0.06,0.02) -- (0.23,-0.02) -- (0.51,-0.07) -- (0.78,-0.11);
\draw[dashed] (-1.50,-0.79) -- (-1.62,-0.54) -- (-1.71,-0.28) -- (-1.77,-0.01) -- (-1.78,0.26) -- (-1.75,0.52) -- (-1.69,0.77) -- (-1.59,1.00) -- (-1.45,1.22);
\draw[] (0.26,0.35) -- (0.41,0.37) -- (0.56,0.39) -- (0.71,0.41) -- (0.85,0.42) -- (0.98,0.43) -- (1.11,0.44) -- (1.23,0.44) -- (1.34,0.45);
\mS{0.78,-0.11}{draw=hot, thick, fill=white}
\mS{-1.34,0.23}{draw=cold, thick, fill=white}
\mT{-1.50,-0.79}{draw=cold, thick, fill=white}
\mT{-1.45,1.22}{draw=hot, thick, fill=white}
\mC{1.60,1.03}{draw=hot, thick, fill=white}
\mC{-1.44,-0.14}{draw=black, fill=cold}
\mD{1.34,0.45}{draw=black, fill=hot}
\mD{0.26,0.35}{draw=black, fill=cold}
\hs{3.99,1.11}{0.23}{draw=hot, thick, fill=white}
\hs{4.77,1.11}{0.30}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.16}{draw=black, fill=cold}
\hs{6.33,1.11}{0.04}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.11}{draw=black, fill=hot}
\hs{5.55,0.33}{0.23}{draw=black, fill=cold}
\hs{6.33,0.33}{0.31}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.29}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.04}{draw=black, fill=cold}
\hs{5.55,-0.45}{0.13}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.32}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.06}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.28}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.02}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.27}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.22$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.20$, \ different $-0.31$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.68s = "true", 2.96s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.49,0.34) -- (-1.34,0.81) -- (-1.11,1.23) -- (-0.79,1.56) -- (-0.42,1.78) -- (-0.03,1.89);
\draw[dashed] (-0.03,1.89) -- (0.37,1.86) -- (0.75,1.71) -- (1.07,1.44);
\draw[dashed] (-1.09,-0.20) -- (-0.89,-0.22) -- (-0.67,-0.24) -- (-0.44,-0.25) -- (-0.21,-0.26) -- (0.03,-0.27) -- (0.27,-0.27) -- (0.50,-0.27) -- (0.73,-0.26);
\draw[dashed] (-1.57,-1.03) -- (-1.68,-0.86) -- (-1.77,-0.67) -- (-1.84,-0.47) -- (-1.88,-0.27);
\draw[] (-1.88,-0.27) -- (-1.90,-0.06) -- (-1.89,0.15) -- (-1.86,0.35) -- (-1.80,0.56);
\draw[] (0.71,0.45) -- (0.80,0.47) -- (0.89,0.49) -- (0.98,0.51) -- (1.06,0.53) -- (1.14,0.54) -- (1.22,0.56) -- (1.29,0.57) -- (1.36,0.58);
\mS{0.73,-0.26}{draw=hot, thick, fill=white}
\mS{-1.09,-0.20}{draw=cold, thick, fill=white}
\mC{1.07,1.44}{draw=hot, thick, fill=white}
\mT{-1.57,-1.03}{draw=cold, thick, fill=white}
\mT{-1.80,0.56}{draw=black, fill=hot}
\mC{-1.49,0.34}{draw=black, fill=cold}
\mD{1.36,0.58}{draw=black, fill=hot}
\mD{0.71,0.45}{draw=black, fill=cold}
\hs{3.99,1.11}{0.17}{draw=hot, thick, fill=white}
\hs{4.77,1.11}{0.29}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.29}{draw=black, fill=cold}
\hs{6.33,1.11}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.04}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.18}{draw=black, fill=hot}
\hs{5.55,0.33}{0.14}{draw=black, fill=cold}
\hs{6.33,0.33}{0.32}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.20}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.28}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.03}{draw=black, fill=cold}
\hs{4.77,-1.23}{0.24}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.30}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $1.07$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.39$, \ different $-0.28$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.96s = "true", 3.24s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.50,0.73) -- (-1.42,1.04) -- (-1.28,1.31) -- (-1.09,1.53);
\draw[dashed] (-1.09,1.53) -- (-0.86,1.69) -- (-0.60,1.78) -- (-0.31,1.80) -- (-0.01,1.75) -- (0.29,1.63);
\draw[dashed] (-0.74,-0.52) -- (-0.57,-0.52) -- (-0.40,-0.51) -- (-0.22,-0.50) -- (-0.03,-0.49) -- (0.15,-0.47) -- (0.33,-0.44) -- (0.51,-0.41) -- (0.68,-0.38);
\draw[] (-1.40,-1.24) -- (-1.49,-1.13) -- (-1.56,-1.00) -- (-1.62,-0.88) -- (-1.68,-0.74) -- (-1.72,-0.60) -- (-1.75,-0.46) -- (-1.78,-0.31) -- (-1.79,-0.16);
\draw[] (1.08,0.58) -- (1.12,0.59) -- (1.16,0.61) -- (1.20,0.62) -- (1.24,0.64) -- (1.28,0.65) -- (1.31,0.66) -- (1.35,0.67) -- (1.38,0.68);
\mS{0.68,-0.38}{draw=hot, thick, fill=white}
\mS{-0.74,-0.52}{draw=cold, thick, fill=white}
\mC{0.29,1.63}{draw=hot, thick, fill=white}
\mT{-1.40,-1.24}{draw=black, fill=cold}
\mT{-1.79,-0.16}{draw=black, fill=hot}
\mC{-1.50,0.73}{draw=black, fill=cold}
\mD{1.38,0.68}{draw=black, fill=hot}
\mD{1.08,0.58}{draw=black, fill=cold}
\hs{4.77,1.11}{0.27}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.29}{draw=black, fill=cold}
\hs{6.33,1.11}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.04}{draw=black, fill=cold}
\hs{4.77,0.33}{0.24}{draw=black, fill=hot}
\hs{5.55,0.33}{0.03}{draw=black, fill=cold}
\hs{6.33,0.33}{0.30}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.25}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.10}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.27}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.23}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.19}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.10}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.75$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.62$, \ different $-0.28$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 3.24s = "true", 3.52s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.49,0.97) -- (-1.44,1.14) -- (-1.37,1.28) -- (-1.28,1.40);
\draw[dashed] (-1.28,1.40) -- (-1.16,1.50) -- (-1.02,1.57) -- (-0.86,1.61) -- (-0.69,1.62) -- (-0.50,1.61);
\draw[dashed] (-0.39,-0.69) -- (-0.26,-0.67) -- (-0.14,-0.65) -- (-0.01,-0.62) -- (0.12,-0.59) -- (0.25,-0.56) -- (0.38,-0.53) -- (0.51,-0.49) -- (0.63,-0.45);
\draw[] (-1.04,-1.39) -- (-1.10,-1.32) -- (-1.16,-1.26) -- (-1.22,-1.18) -- (-1.27,-1.11) -- (-1.32,-1.04) -- (-1.37,-0.96) -- (-1.41,-0.88) -- (-1.45,-0.80);
\draw[] (1.35,0.72) -- (1.36,0.73) -- (1.37,0.73) -- (1.37,0.74) -- (1.38,0.75) -- (1.38,0.75) -- (1.39,0.76) -- (1.40,0.77) -- (1.40,0.77);
\mS{0.63,-0.45}{draw=hot, thick, fill=white}
\mS{-0.39,-0.69}{draw=cold, thick, fill=white}
\mC{-0.50,1.61}{draw=hot, thick, fill=white}
\mC{-1.49,0.97}{draw=black, fill=cold}
\mT{-1.04,-1.39}{draw=black, fill=cold}
\mT{-1.45,-0.80}{draw=black, fill=hot}
\mD{1.40,0.77}{draw=black, fill=hot}
\mD{1.35,0.72}{draw=black, fill=cold}
\hs{3.99,1.11}{0.16}{draw=black, fill=hot}
\hs{4.77,1.11}{0.24}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.19}{draw=black, fill=cold}
\hs{6.33,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=black, fill=cold}
\hs{4.77,0.33}{0.28}{draw=black, fill=hot}
\hs{5.55,0.33}{0.05}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.26}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.22}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.31}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.05}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.14}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.41$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.81$, \ different $-0.30$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 3.52s = "true", 3.8s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.50,1.07) -- (-1.48,1.14) -- (-1.45,1.20) -- (-1.42,1.26);
\draw[dashed] (-1.42,1.26) -- (-1.37,1.31) -- (-1.32,1.36) -- (-1.26,1.39) -- (-1.19,1.42) -- (-1.11,1.43);
\draw[dashed] (-0.14,-0.71) -- (-0.06,-0.69) -- (0.03,-0.66) -- (0.11,-0.64) -- (0.20,-0.61) -- (0.29,-0.58) -- (0.37,-0.55) -- (0.46,-0.52) -- (0.54,-0.49);
\draw[] (-0.58,-1.46) -- (-0.63,-1.43) -- (-0.68,-1.41) -- (-0.73,-1.39) -- (-0.78,-1.36) -- (-0.82,-1.33) -- (-0.87,-1.30) -- (-0.92,-1.27) -- (-0.96,-1.24);
\draw[] (1.51,0.87) -- (1.50,0.87) -- (1.50,0.86) -- (1.49,0.86) -- (1.48,0.86) -- (1.47,0.85) -- (1.46,0.85) -- (1.45,0.85) -- (1.44,0.85);
\mS{-0.14,-0.71}{draw=cold, thick, fill=white}
\mS{0.54,-0.49}{draw=hot, thick, fill=white}
\mC{-1.11,1.43}{draw=hot, thick, fill=white}
\mC{-1.50,1.07}{draw=black, fill=cold}
\mD{1.51,0.87}{draw=black, fill=cold}
\mD{1.44,0.85}{draw=black, fill=hot}
\mT{-0.96,-1.24}{draw=black, fill=hot}
\mT{-0.58,-1.46}{draw=black, fill=cold}
\hs{3.99,1.11}{0.27}{draw=black, fill=hot}
\hs{4.77,1.11}{0.20}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=black, fill=cold}
\hs{6.33,1.11}{0.08}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.31}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.22}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.19}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.14}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.08}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.09}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.16}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.25$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.93$, \ different $-0.31$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 3.8s = "true", 4.08s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.52,1.05) -- (-1.52,1.07) -- (-1.52,1.10) -- (-1.52,1.12) -- (-1.51,1.15) -- (-1.50,1.17);
\draw[dashed] (-1.50,1.17) -- (-1.49,1.18) -- (-1.47,1.20) -- (-1.45,1.21);
\draw[dashed] (-0.09,-0.66) -- (-0.03,-0.64) -- (0.03,-0.62) -- (0.09,-0.60) -- (0.15,-0.58) -- (0.21,-0.56) -- (0.26,-0.54) -- (0.32,-0.51) -- (0.38,-0.49);
\draw[] (-0.12,-1.47) -- (-0.16,-1.48) -- (-0.21,-1.48) -- (-0.26,-1.49) -- (-0.30,-1.49) -- (-0.35,-1.49) -- (-0.39,-1.49) -- (-0.44,-1.49) -- (-0.48,-1.49);
\draw[] (1.57,1.00) -- (1.56,0.99) -- (1.55,0.98) -- (1.55,0.98) -- (1.54,0.97) -- (1.53,0.95) -- (1.52,0.94) -- (1.51,0.93) -- (1.50,0.92);
\mS{0.38,-0.49}{draw=hot, thick, fill=white}
\mS{-0.09,-0.66}{draw=cold, thick, fill=white}
\mC{-1.45,1.21}{draw=hot, thick, fill=white}
\mD{1.57,1.00}{draw=black, fill=cold}
\mC{-1.52,1.05}{draw=black, fill=cold}
\mD{1.50,0.92}{draw=black, fill=hot}
\mT{-0.48,-1.49}{draw=black, fill=hot}
\mT{-0.12,-1.47}{draw=black, fill=cold}
\hs{3.99,1.11}{0.32}{draw=black, fill=hot}
\hs{4.77,1.11}{0.17}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.03}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.09}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.04}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.32}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.19}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.17}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.14}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.06}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.10}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.06}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.97$, \ different $-0.32$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 4.08s = "true", 4.36s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.52,0.97) -- (-1.53,0.98) -- (-1.53,0.99) -- (-1.54,1.01) -- (-1.55,1.02) -- (-1.55,1.03) -- (-1.56,1.04) -- (-1.56,1.05) -- (-1.56,1.06);
\draw[dashed] (-0.27,-0.64) -- (-0.22,-0.62) -- (-0.18,-0.60) -- (-0.13,-0.58) -- (-0.08,-0.56) -- (-0.03,-0.54) -- (0.01,-0.52) -- (0.06,-0.50) -- (0.11,-0.48);
\draw[] (0.27,-1.46) -- (0.22,-1.48) -- (0.18,-1.49) -- (0.13,-1.51) -- (0.08,-1.52) -- (0.03,-1.54) -- (-0.01,-1.55) -- (-0.06,-1.56) -- (-0.11,-1.57);
\draw[] (1.54,1.11) -- (1.54,1.10) -- (1.55,1.09) -- (1.55,1.08) -- (1.55,1.07) -- (1.55,1.05) -- (1.55,1.04) -- (1.55,1.03) -- (1.54,1.01);
\mS{0.11,-0.48}{draw=hot, thick, fill=white}
\mS{-0.27,-0.64}{draw=cold, thick, fill=white}
\mD{1.54,1.11}{draw=black, fill=cold}
\mC{-1.56,1.06}{draw=black, fill=hot}
\mD{1.54,1.01}{draw=black, fill=hot}
\mC{-1.52,0.97}{draw=black, fill=cold}
\mT{-0.11,-1.57}{draw=black, fill=hot}
\mT{0.27,-1.46}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {Training pulls views together and pushes images apart.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 4.36s = "true", 4.68s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.42,0.87) -- (-1.44,0.88) -- (-1.46,0.90) -- (-1.48,0.91) -- (-1.50,0.92) -- (-1.51,0.93) -- (-1.53,0.94) -- (-1.54,0.95) -- (-1.56,0.96);
\draw[dashed] (-0.57,-0.67) -- (-0.53,-0.65) -- (-0.49,-0.62) -- (-0.44,-0.60) -- (-0.40,-0.58) -- (-0.36,-0.56) -- (-0.31,-0.53) -- (-0.27,-0.51) -- (-0.23,-0.49);
\draw[] (0.59,-1.43) -- (0.55,-1.45) -- (0.50,-1.47) -- (0.45,-1.49) -- (0.40,-1.51) -- (0.35,-1.52) -- (0.30,-1.54) -- (0.25,-1.55) -- (0.20,-1.56);
\draw[dashed] (1.44,1.21) -- (1.46,1.20) -- (1.47,1.19) -- (1.49,1.18) -- (1.50,1.17);
\draw[] (1.50,1.17) -- (1.51,1.15) -- (1.52,1.14) -- (1.53,1.12) -- (1.54,1.11);
\mS{-0.23,-0.49}{draw=hot, thick, fill=white}
\mS{-0.57,-0.67}{draw=cold, thick, fill=white}
\mD{1.44,1.21}{draw=cold, thick, fill=white}
\mD{1.54,1.11}{draw=black, fill=hot}
\mC{-1.56,0.96}{draw=black, fill=hot}
\mC{-1.42,0.87}{draw=black, fill=cold}
\mT{0.20,-1.56}{draw=black, fill=hot}
\mT{0.59,-1.43}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 4.68s = "true", 5s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.27,0.78) -- (-1.30,0.80) -- (-1.33,0.81) -- (-1.36,0.82) -- (-1.38,0.83) -- (-1.41,0.83) -- (-1.43,0.84) -- (-1.46,0.85) -- (-1.48,0.86);
\draw[dashed] (-0.85,-0.71) -- (-0.81,-0.69) -- (-0.78,-0.67) -- (-0.74,-0.64) -- (-0.70,-0.62) -- (-0.67,-0.59) -- (-0.63,-0.56) -- (-0.59,-0.54) -- (-0.55,-0.51);
\draw[] (0.89,-1.38) -- (0.85,-1.41) -- (0.80,-1.43) -- (0.75,-1.45) -- (0.70,-1.47) -- (0.66,-1.49) -- (0.61,-1.51) -- (0.56,-1.53) -- (0.51,-1.54);
\draw[dashed] (1.29,1.30) -- (1.31,1.29) -- (1.34,1.28) -- (1.36,1.27) -- (1.38,1.26) -- (1.40,1.25) -- (1.42,1.24) -- (1.44,1.22) -- (1.46,1.21);
\mS{-0.55,-0.51}{draw=hot, thick, fill=white}
\mS{-0.85,-0.71}{draw=cold, thick, fill=white}
\mD{1.29,1.30}{draw=cold, thick, fill=white}
\mD{1.46,1.21}{draw=hot, thick, fill=white}
\mC{-1.48,0.86}{draw=black, fill=hot}
\mT{0.89,-1.38}{draw=black, fill=cold}
\mT{0.51,-1.54}{draw=black, fill=hot}
\mC{-1.27,0.78}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 5s = "true", 5.32s = "false", 9.16s = "false", repeats}}}]
\draw[] (-1.06,0.71) -- (-1.10,0.72) -- (-1.13,0.73) -- (-1.17,0.73) -- (-1.21,0.74) -- (-1.24,0.75) -- (-1.27,0.75) -- (-1.31,0.76) -- (-1.34,0.77);
\draw[dashed] (-1.09,-0.78) -- (-1.06,-0.75) -- (-1.04,-0.72) -- (-1.01,-0.70) -- (-0.98,-0.67) -- (-0.95,-0.64) -- (-0.91,-0.61) -- (-0.88,-0.59) -- (-0.85,-0.56);
\draw[] (1.15,-1.32) -- (1.11,-1.34) -- (1.06,-1.37) -- (1.02,-1.39) -- (0.98,-1.42) -- (0.93,-1.44) -- (0.89,-1.46) -- (0.84,-1.48) -- (0.79,-1.50);
\draw[dashed] (1.07,1.38) -- (1.11,1.37) -- (1.14,1.36) -- (1.17,1.35) -- (1.21,1.34) -- (1.24,1.33) -- (1.27,1.32) -- (1.29,1.31) -- (1.32,1.30);
\mS{-0.85,-0.56}{draw=hot, thick, fill=white}
\mS{-1.09,-0.78}{draw=cold, thick, fill=white}
\mD{1.07,1.38}{draw=cold, thick, fill=white}
\mD{1.32,1.30}{draw=hot, thick, fill=white}
\mT{1.15,-1.32}{draw=black, fill=cold}
\mT{0.79,-1.50}{draw=black, fill=hot}
\mC{-1.34,0.77}{draw=black, fill=hot}
\mC{-1.06,0.71}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 5.32s = "true", 5.64s = "false", 9.16s = "false", repeats}}}]
\draw[] (-0.80,0.65) -- (-0.85,0.65) -- (-0.89,0.66) -- (-0.93,0.67) -- (-0.98,0.67) -- (-1.02,0.68) -- (-1.06,0.68) -- (-1.10,0.68) -- (-1.14,0.69);
\draw[dashed] (-1.28,-0.85) -- (-1.27,-0.83) -- (-1.25,-0.80) -- (-1.23,-0.77) -- (-1.21,-0.74) -- (-1.18,-0.71) -- (-1.16,-0.68) -- (-1.14,-0.65) -- (-1.11,-0.62);
\draw[] (1.36,-1.23) -- (1.32,-1.26) -- (1.28,-1.29) -- (1.24,-1.32) -- (1.21,-1.34) -- (1.17,-1.37) -- (1.12,-1.39) -- (1.08,-1.42) -- (1.04,-1.44);
\draw[dashed] (0.81,1.44) -- (0.86,1.43) -- (0.90,1.43) -- (0.94,1.42) -- (0.98,1.42) -- (1.01,1.41) -- (1.05,1.40) -- (1.09,1.39) -- (1.13,1.38);
\mS{-1.11,-0.62}{draw=hot, thick, fill=white}
\mS{-1.28,-0.85}{draw=cold, thick, fill=white}
\mD{0.81,1.44}{draw=cold, thick, fill=white}
\mD{1.13,1.38}{draw=hot, thick, fill=white}
\mT{1.36,-1.23}{draw=black, fill=cold}
\mT{1.04,-1.44}{draw=black, fill=hot}
\mC{-1.14,0.69}{draw=black, fill=hot}
\mC{-0.80,0.65}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 5.64s = "true", 5.96s = "false", 9.16s = "false", repeats}}}]
\draw[] (-0.51,0.61) -- (-0.56,0.61) -- (-0.61,0.61) -- (-0.66,0.61) -- (-0.70,0.62) -- (-0.75,0.62) -- (-0.80,0.62) -- (-0.84,0.62) -- (-0.89,0.62);
\draw[dashed] (-1.42,-0.94) -- (-1.41,-0.91) -- (-1.40,-0.88) -- (-1.39,-0.86) -- (-1.38,-0.83) -- (-1.37,-0.80) -- (-1.36,-0.76) -- (-1.34,-0.73) -- (-1.33,-0.70);
\draw[] (1.50,-1.14) -- (1.48,-1.17) -- (1.45,-1.20) -- (1.41,-1.23) -- (1.38,-1.26) -- (1.35,-1.29) -- (1.32,-1.32) -- (1.28,-1.34) -- (1.24,-1.37);
\draw[dashed] (0.52,1.48) -- (0.57,1.48) -- (0.61,1.48) -- (0.66,1.47) -- (0.70,1.47) -- (0.75,1.46) -- (0.79,1.46) -- (0.84,1.45) -- (0.88,1.44);
\mS{-1.33,-0.70}{draw=hot, thick, fill=white}
\mD{0.52,1.48}{draw=cold, thick, fill=white}
\mD{0.88,1.44}{draw=hot, thick, fill=white}
\mS{-1.42,-0.94}{draw=cold, thick, fill=white}
\mT{1.50,-1.14}{draw=black, fill=cold}
\mT{1.24,-1.37}{draw=black, fill=hot}
\mC{-0.89,0.62}{draw=black, fill=hot}
\mC{-0.51,0.61}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 5.96s = "true", 6.28s = "false", 9.16s = "false", repeats}}}]
\draw[] (-0.20,0.58) -- (-0.25,0.58) -- (-0.30,0.58) -- (-0.35,0.58) -- (-0.40,0.58) -- (-0.45,0.58) -- (-0.50,0.58) -- (-0.55,0.57) -- (-0.60,0.57);
\draw[dashed] (-1.50,-1.04) -- (-1.50,-1.01) -- (-1.50,-0.98) -- (-1.50,-0.95) -- (-1.50,-0.92) -- (-1.50,-0.89) -- (-1.49,-0.86) -- (-1.49,-0.82) -- (-1.48,-0.79);
\draw[dashed] (1.59,-1.04) -- (1.57,-1.07) -- (1.54,-1.11);
\draw[] (1.54,-1.11) -- (1.52,-1.14) -- (1.50,-1.17) -- (1.47,-1.20) -- (1.45,-1.23) -- (1.42,-1.25) -- (1.39,-1.28);
\draw[dashed] (0.20,1.51) -- (0.25,1.51) -- (0.30,1.51) -- (0.35,1.51) -- (0.40,1.51) -- (0.45,1.50) -- (0.50,1.50) -- (0.55,1.50) -- (0.60,1.49);
\mD{0.20,1.51}{draw=cold, thick, fill=white}
\mD{0.60,1.49}{draw=hot, thick, fill=white}
\mS{-1.48,-0.79}{draw=hot, thick, fill=white}
\mS{-1.50,-1.04}{draw=cold, thick, fill=white}
\mT{1.59,-1.04}{draw=cold, thick, fill=white}
\mT{1.39,-1.28}{draw=black, fill=hot}
\mC{-0.60,0.57}{draw=black, fill=hot}
\mC{-0.20,0.58}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 6.28s = "true", 6.6s = "false", 9.16s = "false", repeats}}}]
\draw[] (0.13,0.58) -- (0.07,0.58) -- (0.02,0.57) -- (-0.03,0.57) -- (-0.08,0.56) -- (-0.13,0.56) -- (-0.18,0.55) -- (-0.24,0.55) -- (-0.29,0.54);
\draw[dashed] (-1.50,-1.13) -- (-1.52,-1.11) -- (-1.53,-1.08) -- (-1.54,-1.05) -- (-1.55,-1.02) -- (-1.56,-0.99) -- (-1.56,-0.96) -- (-1.57,-0.92) -- (-1.58,-0.89);
\draw[dashed] (1.60,-0.94) -- (1.59,-0.97) -- (1.58,-1.00) -- (1.56,-1.04) -- (1.55,-1.07) -- (1.53,-1.10) -- (1.52,-1.13) -- (1.50,-1.16) -- (1.48,-1.19);
\draw[dashed] (-0.13,1.51) -- (-0.07,1.51) -- (-0.02,1.52) -- (0.03,1.52) -- (0.08,1.52) -- (0.13,1.52) -- (0.18,1.52) -- (0.24,1.52) -- (0.29,1.52);
\mD{-0.13,1.51}{draw=cold, thick, fill=white}
\mD{0.29,1.52}{draw=hot, thick, fill=white}
\mS{-1.58,-0.89}{draw=hot, thick, fill=white}
\mT{1.60,-0.94}{draw=cold, thick, fill=white}
\mS{-1.50,-1.13}{draw=cold, thick, fill=white}
\mT{1.48,-1.19}{draw=hot, thick, fill=white}
\mC{-0.29,0.54}{draw=black, fill=hot}
\mC{0.13,0.58}{draw=black, fill=cold}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 6.6s = "true", 6.92s = "false", 9.16s = "false", repeats}}}]
\draw[] (0.44,0.60) -- (0.39,0.59) -- (0.34,0.59) -- (0.29,0.58) -- (0.24,0.57) -- (0.19,0.56) -- (0.14,0.55) -- (0.09,0.54) -- (0.04,0.53);
\draw[] (-1.45,-1.23) -- (-1.47,-1.20);
\draw[dashed] (-1.47,-1.20) -- (-1.49,-1.18) -- (-1.51,-1.15) -- (-1.53,-1.12) -- (-1.55,-1.09) -- (-1.57,-1.06) -- (-1.58,-1.03) -- (-1.60,-0.99);
\draw[dashed] (1.54,-0.84) -- (1.54,-0.87) -- (1.54,-0.90) -- (1.54,-0.94) -- (1.53,-0.97) -- (1.53,-1.00) -- (1.52,-1.03) -- (1.51,-1.06) -- (1.50,-1.09);
\draw[dashed] (-0.45,1.49) -- (-0.40,1.50) -- (-0.35,1.51) -- (-0.29,1.51) -- (-0.24,1.52) -- (-0.19,1.52) -- (-0.14,1.52) -- (-0.09,1.53) -- (-0.04,1.53);
\mD{-0.04,1.53}{draw=hot, thick, fill=white}
\mD{-0.45,1.49}{draw=cold, thick, fill=white}
\mT{1.54,-0.84}{draw=cold, thick, fill=white}
\mT{1.50,-1.09}{draw=hot, thick, fill=white}
\mS{-1.60,-0.99}{draw=hot, thick, fill=white}
\mS{-1.45,-1.23}{draw=black, fill=cold}
\mC{0.44,0.60}{draw=black, fill=cold}
\mC{0.04,0.53}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 6.92s = "true", 7.24s = "false", 9.16s = "false", repeats}}}]
\draw[] (0.74,0.64) -- (0.70,0.63) -- (0.65,0.62) -- (0.60,0.61) -- (0.56,0.60) -- (0.51,0.58) -- (0.46,0.57) -- (0.41,0.56) -- (0.36,0.55);
\draw[] (-1.33,-1.32) -- (-1.36,-1.29) -- (-1.39,-1.27) -- (-1.42,-1.24) -- (-1.45,-1.22) -- (-1.48,-1.19) -- (-1.50,-1.16) -- (-1.53,-1.13) -- (-1.55,-1.10);
\draw[dashed] (1.42,-0.74) -- (1.43,-0.77) -- (1.44,-0.81) -- (1.44,-0.84) -- (1.45,-0.87) -- (1.45,-0.90) -- (1.46,-0.93) -- (1.46,-0.96) -- (1.46,-0.99);
\draw[dashed] (-0.75,1.45) -- (-0.70,1.46) -- (-0.65,1.47) -- (-0.60,1.48) -- (-0.56,1.49) -- (-0.51,1.50) -- (-0.46,1.50) -- (-0.41,1.51) -- (-0.36,1.51);
\mD{-0.36,1.51}{draw=hot, thick, fill=white}
\mT{1.42,-0.74}{draw=cold, thick, fill=white}
\mD{-0.75,1.45}{draw=cold, thick, fill=white}
\mT{1.46,-0.99}{draw=hot, thick, fill=white}
\mS{-1.55,-1.10}{draw=black, fill=hot}
\mS{-1.33,-1.32}{draw=black, fill=cold}
\mC{0.74,0.64}{draw=black, fill=cold}
\mC{0.36,0.55}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 7.24s = "true", 7.56s = "false", 9.16s = "false", repeats}}}]
\draw[] (1.01,0.69) -- (0.97,0.68) -- (0.93,0.67) -- (0.89,0.66) -- (0.84,0.64) -- (0.80,0.63) -- (0.76,0.61) -- (0.72,0.60) -- (0.67,0.58);
\draw[] (-1.15,-1.40) -- (-1.19,-1.38) -- (-1.23,-1.35) -- (-1.26,-1.33) -- (-1.30,-1.30) -- (-1.34,-1.28) -- (-1.37,-1.25) -- (-1.40,-1.22) -- (-1.44,-1.19);
\draw[dashed] (1.23,-0.65) -- (1.25,-0.69) -- (1.27,-0.72) -- (1.29,-0.75) -- (1.30,-0.78) -- (1.32,-0.81) -- (1.33,-0.84) -- (1.34,-0.87) -- (1.35,-0.90);
\draw[dashed] (-1.02,1.39) -- (-0.98,1.41) -- (-0.93,1.42) -- (-0.89,1.43) -- (-0.84,1.45) -- (-0.80,1.46) -- (-0.75,1.47) -- (-0.71,1.47) -- (-0.66,1.48);
\mT{1.23,-0.65}{draw=cold, thick, fill=white}
\mD{-0.66,1.48}{draw=hot, thick, fill=white}
\mT{1.35,-0.90}{draw=hot, thick, fill=white}
\mD{-1.02,1.39}{draw=cold, thick, fill=white}
\mS{-1.44,-1.19}{draw=black, fill=hot}
\mS{-1.15,-1.40}{draw=black, fill=cold}
\mC{1.01,0.69}{draw=black, fill=cold}
\mC{0.67,0.58}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 7.56s = "true", 7.88s = "false", 9.16s = "false", repeats}}}]
\draw[] (1.23,0.77) -- (1.20,0.75) -- (1.16,0.74) -- (1.13,0.72) -- (1.10,0.70) -- (1.06,0.69) -- (1.03,0.67) -- (0.99,0.65) -- (0.95,0.63);
\draw[] (-0.92,-1.47) -- (-0.97,-1.45) -- (-1.01,-1.43) -- (-1.05,-1.41) -- (-1.10,-1.38) -- (-1.14,-1.36) -- (-1.18,-1.33) -- (-1.22,-1.31) -- (-1.26,-1.28);
\draw[dashed] (0.99,-0.58) -- (1.02,-0.61) -- (1.05,-0.64) -- (1.07,-0.67) -- (1.10,-0.70) -- (1.12,-0.73) -- (1.14,-0.76) -- (1.17,-0.79) -- (1.19,-0.82);
\draw[dashed] (-1.24,1.32) -- (-1.21,1.34) -- (-1.17,1.35) -- (-1.13,1.37) -- (-1.10,1.38) -- (-1.06,1.40) -- (-1.02,1.41) -- (-0.98,1.42) -- (-0.94,1.43);
\mT{0.99,-0.58}{draw=cold, thick, fill=white}
\mT{1.19,-0.82}{draw=hot, thick, fill=white}
\mD{-0.94,1.43}{draw=hot, thick, fill=white}
\mD{-1.24,1.32}{draw=cold, thick, fill=white}
\mS{-1.26,-1.28}{draw=black, fill=hot}
\mS{-0.92,-1.47}{draw=black, fill=cold}
\mC{1.23,0.77}{draw=black, fill=cold}
\mC{0.95,0.63}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 7.88s = "true", 8.2s = "false", 9.16s = "false", repeats}}}]
\draw[] (1.39,0.85) -- (1.37,0.84) -- (1.35,0.82) -- (1.33,0.80) -- (1.30,0.78) -- (1.28,0.76) -- (1.25,0.74) -- (1.22,0.72) -- (1.19,0.70);
\draw[] (-0.65,-1.52) -- (-0.70,-1.50) -- (-0.75,-1.48) -- (-0.80,-1.47) -- (-0.84,-1.45) -- (-0.89,-1.42) -- (-0.94,-1.40) -- (-0.98,-1.38) -- (-1.03,-1.35);
\draw[dashed] (0.71,-0.53) -- (0.74,-0.56) -- (0.78,-0.58) -- (0.81,-0.61) -- (0.84,-0.64) -- (0.88,-0.67) -- (0.91,-0.70) -- (0.94,-0.72) -- (0.97,-0.75);
\draw[dashed] (-1.41,1.23) -- (-1.39,1.25) -- (-1.36,1.27) -- (-1.33,1.29) -- (-1.30,1.30) -- (-1.27,1.32) -- (-1.24,1.33) -- (-1.21,1.35) -- (-1.17,1.36);
\mT{0.71,-0.53}{draw=cold, thick, fill=white}
\mT{0.97,-0.75}{draw=hot, thick, fill=white}
\mD{-1.17,1.36}{draw=hot, thick, fill=white}
\mD{-1.41,1.23}{draw=cold, thick, fill=white}
\mS{-1.03,-1.35}{draw=black, fill=hot}
\mS{-0.65,-1.52}{draw=black, fill=cold}
\mC{1.39,0.85}{draw=black, fill=cold}
\mC{1.19,0.70}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 8.2s = "true", 8.52s = "false", 9.16s = "false", repeats}}}]
\draw[] (1.50,0.95) -- (1.49,0.93) -- (1.48,0.91) -- (1.46,0.89) -- (1.45,0.87) -- (1.43,0.85) -- (1.42,0.83) -- (1.40,0.81) -- (1.38,0.79);
\draw[] (-0.36,-1.55) -- (-0.41,-1.54) -- (-0.46,-1.52) -- (-0.51,-1.51) -- (-0.56,-1.49) -- (-0.60,-1.47) -- (-0.65,-1.45) -- (-0.70,-1.43) -- (-0.75,-1.41);
\draw[dashed] (0.39,-0.49) -- (0.43,-0.52) -- (0.48,-0.54) -- (0.52,-0.57) -- (0.56,-0.60) -- (0.60,-0.62) -- (0.63,-0.65) -- (0.67,-0.67) -- (0.71,-0.69);
\draw[dashed] (-1.52,1.14) -- (-1.50,1.16) -- (-1.49,1.18) -- (-1.47,1.20) -- (-1.45,1.22) -- (-1.43,1.23) -- (-1.41,1.25) -- (-1.38,1.26) -- (-1.36,1.28);
\mT{0.39,-0.49}{draw=cold, thick, fill=white}
\mT{0.71,-0.69}{draw=hot, thick, fill=white}
\mD{-1.36,1.28}{draw=hot, thick, fill=white}
\mD{-1.52,1.14}{draw=cold, thick, fill=white}
\mC{1.50,0.95}{draw=black, fill=cold}
\mS{-0.75,-1.41}{draw=black, fill=hot}
\mS{-0.36,-1.55}{draw=black, fill=cold}
\mC{1.38,0.79}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 8.52s = "true", 8.84s = "false", 9.16s = "false", repeats}}}]
\draw[] (1.54,1.04) -- (1.54,1.03) -- (1.54,1.01) -- (1.54,0.99) -- (1.53,0.97) -- (1.53,0.95) -- (1.52,0.93) -- (1.51,0.90) -- (1.50,0.88);
\draw[] (-0.04,-1.56) -- (-0.09,-1.55) -- (-0.14,-1.54) -- (-0.19,-1.53) -- (-0.24,-1.52) -- (-0.29,-1.50) -- (-0.34,-1.49) -- (-0.39,-1.47) -- (-0.44,-1.45);
\draw[dashed] (0.06,-0.48) -- (0.11,-0.50) -- (0.15,-0.52) -- (0.20,-0.55) -- (0.24,-0.57) -- (0.29,-0.59) -- (0.33,-0.61) -- (0.38,-0.64) -- (0.42,-0.66);
\draw[] (-1.56,1.04) -- (-1.56,1.06) -- (-1.55,1.08) -- (-1.54,1.10) -- (-1.53,1.12) -- (-1.52,1.14) -- (-1.51,1.15);
\draw[dashed] (-1.51,1.15) -- (-1.50,1.17) -- (-1.48,1.19);
\mT{0.06,-0.48}{draw=cold, thick, fill=white}
\mT{0.42,-0.66}{draw=hot, thick, fill=white}
\mD{-1.48,1.19}{draw=hot, thick, fill=white}
\mD{-1.56,1.04}{draw=black, fill=cold}
\mC{1.54,1.04}{draw=black, fill=cold}
\mC{1.50,0.88}{draw=black, fill=hot}
\mS{-0.04,-1.56}{draw=black, fill=cold}
\mS{-0.44,-1.45}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 8.84s = "true", 9.16s = "true", repeats}}}]
\draw[] (1.52,1.14) -- (1.53,1.13) -- (1.53,1.11) -- (1.54,1.09) -- (1.55,1.07) -- (1.55,1.05) -- (1.56,1.03) -- (1.56,1.00) -- (1.56,0.98);
\draw[] (0.27,-1.56) -- (0.22,-1.55) -- (0.18,-1.54) -- (0.13,-1.53) -- (0.08,-1.52) -- (0.03,-1.51) -- (-0.01,-1.50) -- (-0.06,-1.48) -- (-0.11,-1.47);
\draw[dashed] (-0.27,-0.48) -- (-0.22,-0.50) -- (-0.18,-0.52) -- (-0.13,-0.54) -- (-0.08,-0.56) -- (-0.03,-0.58) -- (0.01,-0.60) -- (0.06,-0.62) -- (0.11,-0.64);
\draw[] (-1.54,0.94) -- (-1.54,0.96) -- (-1.55,0.98) -- (-1.55,1.00) -- (-1.55,1.02) -- (-1.55,1.04) -- (-1.55,1.05) -- (-1.55,1.07) -- (-1.54,1.09);
\mT{-0.27,-0.48}{draw=cold, thick, fill=white}
\mT{0.11,-0.64}{draw=hot, thick, fill=white}
\mC{1.52,1.14}{draw=black, fill=cold}
\mD{-1.54,1.09}{draw=black, fill=hot}
\mC{1.56,0.98}{draw=black, fill=hot}
\mD{-1.54,0.94}{draw=black, fill=cold}
\mS{0.27,-1.56}{draw=black, fill=cold}
\mS{-0.11,-1.47}{draw=black, fill=hot}
\hs{3.99,1.11}{0.33}{draw=black, fill=hot}
\hs{4.77,1.11}{0.16}{draw=cold, thick, fill=white}
\hs{5.55,1.11}{0.06}{draw=cold, thick, fill=white}
\hs{6.33,1.11}{0.10}{draw=cold, thick, fill=white}
\hs{3.99,0.33}{0.06}{draw=cold, thick, fill=white}
\hs{4.77,0.33}{0.33}{draw=black, fill=hot}
\hs{5.55,0.33}{0.08}{draw=cold, thick, fill=white}
\hs{6.33,0.33}{0.17}{draw=cold, thick, fill=white}
\hs{3.99,-0.45}{0.16}{draw=cold, thick, fill=white}
\hs{4.77,-0.45}{0.13}{draw=cold, thick, fill=white}
\hs{5.55,-0.45}{0.33}{draw=black, fill=hot}
\hs{6.33,-0.45}{0.05}{draw=cold, thick, fill=white}
\hs{3.99,-1.23}{0.11}{draw=cold, thick, fill=white}
\hs{4.77,-1.23}{0.04}{draw=cold, thick, fill=white}
\hs{5.55,-1.23}{0.17}{draw=cold, thick, fill=white}
\hs{6.33,-1.23}{0.33}{draw=black, fill=hot}
\node[anchor=west] at (3.00,-2.12) {loss: $0.21$};
\node[anchor=west] at (3.00,-2.60) {\footnotesize mean cosine: same image $0.98$, \ different $-0.33$};
\node[anchor=west] at (-2.3,-3.35) {After training: four tight pairs at the corners of a tetrahedron.};
\end{scope}
\end{tikzpicture}
\end{document}The last animation computes the contrastive loss for a batch of three images. We divide each row of cosines by a temperature , exponentiate it, and normalize it into probabilities. The loss averages of the diagonal probabilities. This loss form comes from the SimCLR and CLIP papers (Chen et al., 2020; Radford et al., 2021).
\usepackage{tikz}
\usetikzlibrary{animations, arrows.meta}
\begin{document}
\definecolor{hot}{HTML}{D9483B}
\definecolor{cold}{HTML}{2F80ED}
\begin{tikzpicture}[font=\small, >={Stealth[length=2.2mm]}]
\draw (0,0) rectangle (3.15,-3.15);
\draw (1.05,0) -- (1.05,-3.15); \draw (0,-1.05) -- (3.15,-1.05);
\draw (2.10,0) -- (2.10,-3.15); \draw (0,-2.10) -- (3.15,-2.10);
\node at (1.58,0.95) {cosine $s_{ij} = \mathbf z_i^T\mathbf z'_j$};
\node at (0.53,0.35) {$\mathbf z'_1$};
\node at (1.58,0.35) {$\mathbf z'_2$};
\node at (2.62,0.35) {$\mathbf z'_3$};
\node[anchor=east] at (-0.1,-0.53) {$\mathbf z_1$};
\draw[hot, line width=2pt] (0.07,-0.98) rectangle (0.98,-0.07);
\node at (0.53,-0.53) {$0.9$};
\node at (1.58,-0.53) {$0.2$};
\node at (2.62,-0.53) {$-0.1$};
\node[anchor=east] at (-0.1,-1.58) {$\mathbf z_2$};
\node at (0.53,-1.58) {$0.3$};
\draw[hot, line width=2pt] (1.12,-2.03) rectangle (2.03,-1.12);
\node at (1.58,-1.58) {$0.8$};
\node at (2.62,-1.58) {$0.1$};
\node[anchor=east] at (-0.1,-2.62) {$\mathbf z_3$};
\node at (0.53,-2.62) {$0.0$};
\node at (1.58,-2.62) {$0.4$};
\draw[hot, line width=2pt] (2.17,-3.08) rectangle (3.08,-2.17);
\node at (2.62,-2.62) {$0.7$};
\node at (3.95,0.35) {\footnotesize $-\log p_{ii}$};
\node[anchor=west, align=left] at (-2.3,-3.60) {\footnotesize $\mathbf z_i$: view 1 of image $i$, \ $\mathbf z'_j$: view 2 of image $j$};
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 4.8s = "true", 19.6s = "true", repeats}}}]
\node at (3.95,-0.53) {$0.32$};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 9.4s = "true", 19.6s = "true", repeats}}}]
\node at (3.95,-1.58) {$0.48$};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 14s = "true", 19.6s = "true", repeats}}}]
\node at (3.95,-2.62) {$0.59$};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "true", 2.6s = "false", 19.6s = "false", repeats}}}]
\node[anchor=west] at (-2.3,-4.25) {Each row compares one view-1 embedding with every view-2 embedding. Red: same image.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 2.6s = "true", 4.8s = "false", 19.6s = "false", repeats}}}]
\draw[line width=1.6pt] (-0.08,0.08) rectangle (3.23,-1.13);
\draw (5.75,-3.15) -- (8.85,-3.15);
\node[below] at (6.30,-3.15) {\footnotesize $j = 1$};
\node[below] at (7.30,-3.15) {\footnotesize $j = 2$};
\node[below] at (8.30,-3.15) {\footnotesize $j = 3$};
\node at (7.30,0.95) {step 1: $e^{s_{1j}/\tau}$, \ $\tau = 0.5$};
\filldraw[draw=black, fill=hot] (5.99,-3.15) rectangle (6.61,-0.609);
\node[above] at (6.30,-0.609) {\footnotesize $6.05$};
\filldraw[draw=black, fill=cold] (6.99,-3.15) rectangle (7.61,-2.523);
\node[above] at (7.30,-2.523) {\footnotesize $1.49$};
\filldraw[draw=black, fill=cold] (7.99,-3.15) rectangle (8.61,-2.806);
\node[above] at (8.30,-2.806) {\footnotesize $0.82$};
\node[anchor=west] at (-2.3,-4.25) {Row 1: divide each cosine by $\tau$ and exponentiate. The row sums to $8.36$.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 4.8s = "true", 7.2s = "false", 19.6s = "false", repeats}}}]
\draw[line width=1.6pt] (-0.08,0.08) rectangle (3.23,-1.13);
\draw (5.75,-3.15) -- (8.85,-3.15);
\node[below] at (6.30,-3.15) {\footnotesize $j = 1$};
\node[below] at (7.30,-3.15) {\footnotesize $j = 2$};
\node[below] at (8.30,-3.15) {\footnotesize $j = 3$};
\node at (7.30,0.95) {step 2: divide by the row sum};
\filldraw[draw=black, fill=hot] (5.99,-3.15) rectangle (6.61,-1.051);
\node[above] at (6.30,-1.051) {\footnotesize $0.72$};
\filldraw[draw=black, fill=cold] (6.99,-3.15) rectangle (7.61,-2.633);
\node[above] at (7.30,-2.633) {\footnotesize $0.18$};
\filldraw[draw=black, fill=cold] (7.99,-3.15) rectangle (8.61,-2.866);
\node[above] at (8.30,-2.866) {\footnotesize $0.10$};
\node[anchor=west] at (-2.3,-4.25) {Row 1: the probabilities sum to $1$. The loss term is $-\log 0.72 = 0.32$.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 7.2s = "true", 9.4s = "false", 19.6s = "false", repeats}}}]
\draw[line width=1.6pt] (-0.08,-0.97) rectangle (3.23,-2.18);
\draw (5.75,-3.15) -- (8.85,-3.15);
\node[below] at (6.30,-3.15) {\footnotesize $j = 1$};
\node[below] at (7.30,-3.15) {\footnotesize $j = 2$};
\node[below] at (8.30,-3.15) {\footnotesize $j = 3$};
\node at (7.30,0.95) {step 1: $e^{s_{2j}/\tau}$, \ $\tau = 0.5$};
\filldraw[draw=black, fill=cold] (5.99,-3.15) rectangle (6.61,-2.385);
\node[above] at (6.30,-2.385) {\footnotesize $1.82$};
\filldraw[draw=black, fill=hot] (6.99,-3.15) rectangle (7.61,-1.070);
\node[above] at (7.30,-1.070) {\footnotesize $4.95$};
\filldraw[draw=black, fill=cold] (7.99,-3.15) rectangle (8.61,-2.637);
\node[above] at (8.30,-2.637) {\footnotesize $1.22$};
\node[anchor=west] at (-2.3,-4.25) {Row 2: divide each cosine by $\tau$ and exponentiate. The row sums to $8.00$.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 9.4s = "true", 11.8s = "false", 19.6s = "false", repeats}}}]
\draw[line width=1.6pt] (-0.08,-0.97) rectangle (3.23,-2.18);
\draw (5.75,-3.15) -- (8.85,-3.15);
\node[below] at (6.30,-3.15) {\footnotesize $j = 1$};
\node[below] at (7.30,-3.15) {\footnotesize $j = 2$};
\node[below] at (8.30,-3.15) {\footnotesize $j = 3$};
\node at (7.30,0.95) {step 2: divide by the row sum};
\filldraw[draw=black, fill=cold] (5.99,-3.15) rectangle (6.61,-2.489);
\node[above] at (6.30,-2.489) {\footnotesize $0.23$};
\filldraw[draw=black, fill=hot] (6.99,-3.15) rectangle (7.61,-1.354);
\node[above] at (7.30,-1.354) {\footnotesize $0.62$};
\filldraw[draw=black, fill=cold] (7.99,-3.15) rectangle (8.61,-2.707);
\node[above] at (8.30,-2.707) {\footnotesize $0.15$};
\node[anchor=west] at (-2.3,-4.25) {Row 2: the probabilities sum to $1$. The loss term is $-\log 0.62 = 0.48$.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 11.8s = "true", 14s = "false", 19.6s = "false", repeats}}}]
\draw[line width=1.6pt] (-0.08,-2.02) rectangle (3.23,-3.23);
\draw (5.75,-3.15) -- (8.85,-3.15);
\node[below] at (6.30,-3.15) {\footnotesize $j = 1$};
\node[below] at (7.30,-3.15) {\footnotesize $j = 2$};
\node[below] at (8.30,-3.15) {\footnotesize $j = 3$};
\node at (7.30,0.95) {step 1: $e^{s_{3j}/\tau}$, \ $\tau = 0.5$};
\filldraw[draw=black, fill=cold] (5.99,-3.15) rectangle (6.61,-2.730);
\node[above] at (6.30,-2.730) {\footnotesize $1.00$};
\filldraw[draw=black, fill=cold] (6.99,-3.15) rectangle (7.61,-2.215);
\node[above] at (7.30,-2.215) {\footnotesize $2.23$};
\filldraw[draw=black, fill=hot] (7.99,-3.15) rectangle (8.61,-1.447);
\node[above] at (8.30,-1.447) {\footnotesize $4.06$};
\node[anchor=west] at (-2.3,-4.25) {Row 3: divide each cosine by $\tau$ and exponentiate. The row sums to $7.28$.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 14s = "true", 16.4s = "false", 19.6s = "false", repeats}}}]
\draw[line width=1.6pt] (-0.08,-2.02) rectangle (3.23,-3.23);
\draw (5.75,-3.15) -- (8.85,-3.15);
\node[below] at (6.30,-3.15) {\footnotesize $j = 1$};
\node[below] at (7.30,-3.15) {\footnotesize $j = 2$};
\node[below] at (8.30,-3.15) {\footnotesize $j = 3$};
\node at (7.30,0.95) {step 2: divide by the row sum};
\filldraw[draw=black, fill=cold] (5.99,-3.15) rectangle (6.61,-2.752);
\node[above] at (6.30,-2.752) {\footnotesize $0.14$};
\filldraw[draw=black, fill=cold] (6.99,-3.15) rectangle (7.61,-2.264);
\node[above] at (7.30,-2.264) {\footnotesize $0.31$};
\filldraw[draw=black, fill=hot] (7.99,-3.15) rectangle (8.61,-1.535);
\node[above] at (8.30,-1.535) {\footnotesize $0.56$};
\node[anchor=west] at (-2.3,-4.25) {Row 3: the probabilities sum to $1$. The loss term is $-\log 0.56 = 0.59$.};
\end{scope}
\begin{scope}[animate = {myself: = {:visible = {0s = "false", 16.4s = "true", 19.6s = "true", repeats}}}]
\node[anchor=west] at (-2.3,-4.25) {Loss: the mean of the row terms, $(0.32 + 0.48 + 0.59)/3 = 0.46$.};
\end{scope}
\end{tikzpicture}
\end{document}Properties
(Partial Patterns Are Still Useful) A pretext task can fix a model’s predictions without fixing its internal coordinates.
Consider a linear system with hidden state , controls and observations :
The noises are and . Suppose only and are recorded, and a learned Kalman filter is trained to predict . For any invertible , the state follows a system with matrices , , and . Its state noise has covariance . Both systems produce the same observations, so no amount of data can tell them apart. The learned state is the true state in an unknown basis. It still holds all the information in the true state. A linear head trained on a small labeled set could learn and convert it. Assuming a diagonal narrows the ambiguity. With distinct diagonal entries, only permutations and rescalings of the state coordinates remain. A linear autoencoder shows the same pattern, since it learns the principal subspace in an unknown basis.
(Scaffolding) The pretext model often needs parts that exist only to create a training signal.
In the learned Kalman filter without state data, nothing gives a target for the state estimate . A linear head is therefore added. It maps and the control to a predicted observation. The loss compares that prediction with the recorded . The head copies the form of the true observation equation. An autoencoder’s decoder plays the same role, since it is usually discarded after training. We judge a scaffold by how useful the remaining network is after training. The scaffold itself can look unrelated to the downstream task.
(Pretraining Then Fine-Tuning) After the pretext task, the network is reused for the downstream task by replacing its output layer.
Not Taught in Lecture
This reuse step is transfer learning, described in Prince, Understanding Deep Learning, sections 9.3.6 and 9.3.7.
The last layer, which produced the pretext prediction, is removed. A new head suited to the downstream task takes its place, such as a classifier over a few classes. The pretrained layers can stay fixed while only the new head trains. Alternatively, the whole network is fine-tuned on the labeled data. Prince describes the pretrained weights as a starting point in a good region of parameter space. The downstream task then often needs fewer labels than training from scratch would.
(No Access to the Target) A pretext model must never see the value it is asked to predict.
If the input of a next-thing predictor includes , the network can copy it. The loss then falls to zero, and the network learns nothing. Causal models prevent this by construction. An RNN’s state depends only on , and a transformer decoder blocks attention to later positions. A causal model also produces all predictions in one pass. Every position therefore adds a loss term. The same rule applies to normalization. Statistics computed over a whole sequence would make earlier positions depend on future values. Masked prediction has the same requirement. Each hidden entry is replaced by the mask vector before the network sees the input.
(Language Models) Next-word prediction on text is the pretext task behind language models.
Not Taught in Lecture
Language models have not been covered yet. Prince’s chapter 9 notes cite next-word prediction (Radford et al., 2019) and masked word prediction (Devlin et al., 2019).
A text of words gives targets, each scored by cross-entropy over the vocabulary. Predicting the next word well requires grammar, facts and the meaning of the context. The targets come from the text itself, so the training set can grow with the available text. A causal model trained this way can also generate text. It samples a word, appends it to the input and predicts again. A masked word predictor sees context on both sides, which helps tasks that read a whole text. It is not built to generate text one word at a time.
(Mask Vector Instead of Deletion) A graph network hides a node by replacing its features, because deleting the node would change the graph.
Deleting a node also deletes its edges. This can disconnect the graph and change what the remaining nodes receive from their neighbors. A learnable mask vector keeps every edge in place. All masked nodes share the same , so the network learns to treat it as “unknown”. During training, random nodes with known values are masked, and the loss is computed on those nodes. At test time the nodes with missing values receive , and the network predicts them from their neighbors. Transformers trained by masked word prediction use a learned mask token in the same way.
(The Task Must Be Hard Enough) If a pretext task has a shortcut, the network learns the shortcut.
Masking a single pixel is a weak task, since the average of its neighbors already predicts it well. A network trained on it can score well by learning local smoothing and little about objects. Masking large regions removes the shortcut, since nearby pixels no longer reveal the answer. A plain autoencoder needs a bottleneck, noise or masking for the same reason. Without them the identity map solves the task.
Not Taught in Lecture
The masking ratios come from the original papers. BERT (Devlin et al., 2019) masks of the words in a text. Masked autoencoders for images (He et al., 2022) mask of the image patches. They argue that images are far more redundant than text.
(Clustering and PCA as Reconstruction) The two classical unsupervised problems are reconstruction tasks with restricted codes.
PCA gives the best linear reconstruction through a -dimensional code, by the Eckart-Young theorem. K-means minimizes , which is also a reconstruction loss. Its code is a single cluster index , and its decoder looks up the center . The hard choice of index has no useful gradient. K-means is therefore solved by alternating updates (Lloyd’s algorithm) instead of gradient descent. Replacing the hard index with softmax weights makes the assignment differentiable. DiffPool uses this idea to cluster the nodes of a graph.
Examples
(Easy) Making Labels From Three Unlabeled Datasets
A utility has five years of hourly electricity demand. An online shop has a million product photos without tags. A city has a road graph whose intersections record traffic counts.
Design a pretext task for each dataset. What is the input, and what is the label?
- Demand: use next-thing prediction. The input is the demand up to hour , and the label is the demand at hour . Five years hold about hours, so one series gives about training pairs.
- Photos: use masking. Hide large random patches of each photo, and use the hidden pixels as the label. Denoising also works, with the clean photo as the label.
- Traffic: use masking on nodes. Replace the counts at random intersections with a learnable mask vector. The label is the hidden count, predicted from the neighbors by message passing.
No person wrote any of these labels. Each task also asks for knowledge that a later task needs. The demand model must learn daily and weekly cycles. The photo model must learn object shapes, and the traffic model must learn how traffic flows between intersections.
(Medium) Two Systems With the Same Observations
A scalar system starts at and follows , with observation . A learned model instead uses and , also from . The input is .
Compute both state sequences and both outputs. Could training on data tell the two apart? The first system gives and . The learned model gives and . The outputs agree. The learned model is the change of basis , since , and . For any input, , so the outputs always agree. Training on data cannot prefer one model over the other. The learned state is still useful, since it is the true state times . One labeled value of the true state would fix the factor. In one dimension a diagonal is no restriction, so the rescaling ambiguity remains.
(Hard) When Masking Is Too Easy
A row of an image has brightness for , so the row is . A baseline predictor fills hidden pixels by linear interpolation between the nearest visible pixels on each side.
Find the baseline's errors when alone is hidden, and when , and are hidden together. What must a network learn to beat the baseline in each case? With only hidden, the baseline predicts against the true . The error is . The same holds at every interior position, since . With three pixels hidden, the baseline draws a line from to . It predicts , and against the true , and . The errors are , and . A network trained on single-pixel masks can come within by learning to average neighbors. To beat the baseline on the block, it must learn that the row curves upward. That is a property of the whole row. With larger masks, only a network that models the whole row can beat the baseline. A downstream task is more likely to need that knowledge.
See Also
- 6.2. Autoencoders, for reconstruction, denoising and masking with an encoder and a decoder.
- 9.1. LLMs, next-token prediction at scale.
- 3.12.1 Kalman Filter, the system behind the partial-pattern lesson.
- 6.1.1. Message Passing, where masked nodes receive a learnable mask vector.
- 4.4.2. Data Augmentation, the source of the corruptions used in denoising.