Update.
[tex.git] / warp.tex
1 %% -*- mode: latex; mode: reftex; mode: flyspell; coding: utf-8; tex-command: "pdflatex.sh" -*-
2
3 %% Any copyright is dedicated to the Public Domain.
4 %% https://creativecommons.org/publicdomain/zero/1.0/
5
6 %% Written by Francois Fleuret <francois@fleuret.org>
7
8 \documentclass[11pt,a4paper,twoside]{article}
9 \usepackage[a4paper,top=2.5cm,bottom=2cm,left=2.5cm,right=2.5cm]{geometry}
10 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref}
11 \usepackage{amsmath}
12 \usepackage{amssymb}
13 \usepackage{dsfont}
14 \usepackage{tikz}
15 \usetikzlibrary{arrows,arrows.meta,calc}
16 \usetikzlibrary{patterns,backgrounds}
17 \usetikzlibrary{positioning,fit}
18 \usetikzlibrary{shapes.geometric,shapes.multipart}
19 \usetikzlibrary{patterns.meta,decorations.pathreplacing,calligraphy}
20 \usetikzlibrary{tikzmark}
21 \usetikzlibrary{decorations.pathmorphing}
22 \usepackage{pgfplots}
23 \usepgfplotslibrary{patchplots,colormaps}
24 \pgfplotsset{compat = newest}
25
26
27 \begin{document}
28
29 \definecolor{blue}{rgb}{0.3,0.5,0.85}
30 \definecolor{red}{rgb}{0.65,0.0,0.0}
31
32 \begin{figure}
33
34   \immediate\write18{./warp.py --result_dir=.}
35
36   \newcommand{\warp}[1]{%
37     \begin{tikzpicture}
38       \begin{axis}[ticks=none,width=7.0cm, height=7.0cm,xmin=-1.2,xmax=1.2,ymin=-1.2,ymax=1.2]
39         \input{#1}
40       \end{axis}
41     \end{tikzpicture}
42   }
43
44   \center
45
46   \begin{tikzpicture}[warp/.style={inner sep=1pt,minimum width=5.0cm,minimum height=5.0cm}]
47     \node[warp]                 (W0) {\warp{warp_0.tex}};
48     \node[warp,right=2pt of W0] (W1) {\warp{warp_1.tex}};
49     \node[warp,right=2pt of W1] (W2) {\warp{warp_2.tex}};
50     \node[warp,below=20pt of W0] (W3) {\warp{warp_3.tex}};
51     \node[warp,right=2pt of W3] (W4) {\warp{warp_4.tex}};
52     \node[warp,right=2pt of W4] (W5) {\warp{warp_5.tex}};
53     \node[warp,below=20pt of W3] (W6) {\warp{warp_6.tex}};
54     \node[warp,right=2pt of W6] (W7) {\warp{warp_7.tex}};
55     \node[warp,right=2pt of W7] (W8) {\warp{warp_8.tex}};
56     \node[inner sep=0pt,below=4pt of W0] (lW0) {\footnotesize Input};
57     \foreach \n in {1,...,8}{
58       \node[inner sep=0pt,below=4pt of W\n] (lW\n) {\footnotesize Layer \#\n};
59     };
60
61   \end{tikzpicture}
62
63   \caption[Feature warping]{Each plot shows the deformation of the space
64     and the resulting distribution of the training points in
65     $\mathbb{R}^2$ corresponding to the output of each layer, starting
66     with the input in the top-left square. The thick oblique line in the
67     bottom-right plot shows the final affine decision.}\label{fig:warp}
68
69 \end{figure}
70
71 \end{document}