TikZ-reproduction of fig. 1 from the paper MADE: Masked Autoencoder for Distribution Estimation (arxiv:1502.03509).
Edit and compile if you like:
% TikZ-reproduction of fig. 1 from the paper MADE: Masked Autoencoder for Distribution Estimation (https://arxiv.org/abs/1502.03509).\documentclass[tikz]{standalone}\usepackage{xstring}\usetikzlibrary{calc,positioning}\newcommand\drawNodes[2]{% #1 (str): namespace% #2 (list[list[str]]): list of labels to print in the node of each neuron\foreach \neurons [count=\lyrIdx] in #2 {\StrCount{\neurons}{,}[\lyrLength] % use xstring package to save each layer size into \lyrLength macro\foreach \n [count=\nIdx] in \neurons\node[neuron] (#1-\lyrIdx-\nIdx) at (\lyrLength/2-\nIdx, 1.5*\lyrIdx) {\n};}}\newcommand\denselyConnectNodes[2]{% #1 (str): namespace% #2 (list[int]): number of nodes in each layer\foreach \n [count=\lyrIdx, remember=\lyrIdx as \previdx, remember=\n as \prevn] in #2 {\foreach \y in {1,...,\n} {\ifnum \lyrIdx > 1\foreach \x in {1,...,\prevn}\draw[->] (#1-\previdx-\x) -- (#1-\lyrIdx-\y);\fi}}}\newcommand\connectSomeNodes[2]{% #1 (str): namespace% #2 (list[list[list[int]]]): for each node in each layer, list all connected nodes in the next layer\foreach \layer [count=\lyrIdx, evaluate=\lyrIdx as \nextLyr using int(\lyrIdx+1)] in #2\foreach \neuron [count=\nIdx] in \layer\foreach \edge in \neuron\draw[->] (#1-\lyrIdx-\nIdx) -- (#1-\nextLyr-\edge);}\begin{document}
Click to download: made.tex
Open in Overleaf: made.tex
This file is available on tikz.netlify.app and on GitHub and is MIT licensed.
See more on the author page of Janosh Riebesell..