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