battlesnake / neural

LATEX: TikZ package for drawing neural networks. Also available on CTAN at http://www.ctan.org/tex-archive/graphics/pgf/contrib/neuralnetwork
http://www.hackology.co.uk/2013/latex-neural-networks/
GNU General Public License v2.0
241 stars 34 forks source link

Square node #14

Open igormorgado opened 3 years ago

igormorgado commented 3 years ago

How to do a square node as shown in Figure 2.2 at layer: Summation Sigma Weighted in your example book?

igormorgado commented 3 years ago

Ok. After messing around with package source code. Found a way with style

begin{neuralnetwork}[height=9, style={square/.style={fill=black!25,minimum size=6mm}}]
    \newcommand{\nodetextclear}[2]{}
    \setdefaultnodetext{\nodetextclear}
    \inputlayer[count=4, title=In]
    \layer[count=9, bias=false, nodeclass={square}, title=$\scriptstyle C_{3\times3}$]
    \linklayers
    \outputlayer[count=3, title=Out]
    \linklayers
\end{neuralnetwork}

Is there a better way to do it?

It should be nice be able to customize node spacing based on layer (for example I would like a more tight space in middle layer)