HarisIqbal88 / PlotNeuralNet

Latex code for making neural networks diagrams
MIT License
21.59k stars 2.83k forks source link

Fully Connected layer box #82

Closed chrismaliszewski closed 3 years ago

chrismaliszewski commented 4 years ago

Below is the code that implements a fully connected layer box since I wasn't able to find it in the code. I used to_SoftMax function and modified it.

The code should be put inside pycore/tikzeng.py file.

def to_FullyConnected( name, s_filer=" ", n_filer=" ", offset="(0,0,0)", to="(0,0,0)", width=1.5, height=3, depth=25, opacity=0.8, caption=" " , zlabelposition='midway'):
    return r"""
\pic[shift={"""+ offset +"""}] at """+ to +""" 
    {Box={
        name=""" + name +""",
        caption=""" +caption + """,
        xlabel={{ """+ '"'+str(n_filer) +'", "dummy"'+ """ }},
        zlabel="""+ str(s_filer) +""",
        zlabelposition="""+zlabelposition+""",
        fill=\FcColor,
        bandfill=\FcReluColor,
        opacity="""+ str(opacity) +""",
        height="""+ str(height) +""",
        width="""+ str(width) +""",
        depth="""+ str(depth) +"""
        }
    };
"""

Cheers.

nachoraposo commented 3 years ago

You are the real MVP. Saved me a couple hours making it myself <3

pc-mysql commented 3 years ago

very grateful

Sanjeev906 commented 3 years ago

"Box=" should be "RightBandedBox" or it will say " I do not know the key '/tikz/bandfill'"

2243108785 commented 3 years ago

Package pgfkeys Error: I do not know the key '/tikz/zlabelposition', to which you passed 'midway', and I am going to ignore it. Perhaps you misspelled it.

matthijsvk commented 2 years ago

I also have this "I do not know the key '/tikz/zlabelposition', to which you passed 'midway'" error.