sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-latex-base
sudo apt-get install texlive-fonts-recommended
sudo apt-get install texlive-fonts-extra
sudo apt-get install texlive-latex-extra
pdflatex latex_source_name.tex
windows平台
2、运行如下指令
cd pyexamples/
bash ../tikzmake.sh test_simple
这里可以看一下测试样例的python代码
完整的图片对应的latex代码
\documentclass[border=8pt, multi, tikz]{standalone}
\usepackage{import}
\subimport{../layers/}{init}
\usetikzlibrary{positioning}
\usetikzlibrary{3d} %for including external image
\def\ConvColor{rgb:yellow,5;red,2.5;white,5}
\def\ConvReluColor{rgb:yellow,5;red,5;white,5}
\def\PoolColor{rgb:red,1;black,0.3}
\def\UnpoolColor{rgb:blue,2;green,1;black,0.3}
\def\FcColor{rgb:blue,5;red,2.5;white,5}
\def\FcReluColor{rgb:blue,5;red,5;white,4}
\def\SoftmaxColor{rgb:magenta,5;black,7}
\def\SumColor{rgb:blue,5;green,15}
\newcommand{\copymidarrow}{\tikz \draw[-Stealth,line width=0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}
\begin{document}
\begin{tikzpicture}
\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\edgecolor,opacity=0.7]
\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]
\pic[shift={(0,0,0)}] at (0,0,0)
{Box={
name=conv1,
caption= ,
xlabel={{64, }},
zlabel=512,
fill=\ConvColor,
height=64,
width=2,
depth=64
}
};
\pic[shift={ (0,0,0) }] at (conv1-east)
{Box={
name=pool1,
caption= ,
fill=\PoolColor,
opacity=0.5,
height=32,
width=1,
depth=32
}
};
\pic[shift={(1,0,0)}] at (pool1-east)
{Box={
name=conv2,
caption= ,
xlabel={{64, }},
zlabel=128,
fill=\ConvColor,
height=32,
width=2,
depth=32
}
};
\draw [connection] (pool1-east) -- node {\midarrow} (conv2-west);
\pic[shift={ (0,0,0) }] at (conv2-east)
{Box={
name=pool2,
caption= ,
fill=\PoolColor,
opacity=0.5,
height=28,
width=1,
depth=28
}
};
\pic[shift={(3,0,0)}] at (pool1-east)
{Box={
name=soft1,
caption=SOFT,
xlabel={{" ","dummy"}},
zlabel=10,
fill=\SoftmaxColor,
opacity=0.8,
height=3,
width=1.5,
depth=25
}
};
\draw [connection] (pool2-east) -- node {\midarrow} (soft1-west);
\pic[shift={(1.5,0,0)}] at (soft1-east)
{Ball={
name=sum1,
fill=\SumColor,
opacity=0.6,
radius=2.5,
logo=$+$
}
};
\draw [connection] (soft1-east) -- node {\midarrow} (sum1-west);
\end{tikzpicture}
\end{document}
import sys
sys.path.append('../')
from pycore.tikzeng import *
# defined your arch
arch = [
to_head( '..' ),
to_cor(),
to_begin(),
to_Conv("conv1", 512, 64, offset="(0,0,0)", to="(0,0,0)", height=64, depth=64, width=2 ),
to_Pool("pool1", offset="(0,0,0)", to="(conv1-east)"),
to_Conv("conv2", 128, 64, offset="(1,0,0)", to="(pool1-east)", height=32, depth=32, width=2 ),
to_connection( "pool1", "conv2"),
to_Pool("pool2", offset="(0,0,0)", to="(conv2-east)", height=28, depth=28, width=1),
to_SoftMax("soft1", 10 ,"(3,0,0)", "(pool1-east)", caption="SOFT" ),
to_connection("pool2", "soft1"),
to_Sum("sum1", offset="(1.5,0,0)", to="(soft1-east)", radius=2.5, opacity=0.6),
to_connection("soft1", "sum1"),
to_end()
]
def main():
namefile = str(sys.argv[0]).split('.')[0]
to_generate(arch, namefile + '.tex' )
if __name__ == '__main__':
main()
cd pyexamples/
bash ../tikzmake.sh test_simple
这是生成CNN的latex代码,使用的是PlotNeuralNet的Latex包,根据这个代码,帮我写一下FCN的latex代码