An attempt to automate the process of producing neural network pictures with tikz.
ninaa is a recursive acronym for "ninaa is not an artist". ninaa is really not a graphics drawing program. It simply is a collection of a tikz templates and convenience scripts written in python which allows very easy and quick generation of customized neural network pictures based on preexisting templates.
The idea to work on this project came after I observed myself copying and pasting tikzpicture code many times over. As a programmer, I strive to be lazy. So, I tried to abstract the parts of the tikzpicture that I do not change into a mako template and wrote a simple python script to render the template based on my needs into a tikzpicture that compiles out-of-the-box without any modifications.
Here are some mandatory screenshots.
Running the example.py
script will generate the tikzpicture as a standalone
tex document named out.tex
.
You can add the standalone document directly into your main tex file by using
the \includestandalone[]{}
command.
\documentclass{article}
\usepackage[mode=buildnew]{standalone} % requires -shell-escape
\begin{document}
\includestandalone[width=.8\textwidth]{out}
\end{document}
To get the picture in png
format, run
pdflatex -shell-escape out.tex
If you get a security policy error like, convert-im6.q16: attempt to perform an operation not allowed by the security policy
, you may need to change the
ImageMagick
policy file.
Edit /etc/ImageMagick-6/policy.xml
and change the line <policy domain="coder" rights="none" pattern="PDF" />
to <policy domain="coder" rights="read" pattern="PDF" />
.