HarisIqbal88 / PlotNeuralNet

Latex code for making neural networks diagrams
MIT License
21.74k stars 2.84k forks source link

Cant get to_connection to work properly #35

Closed isaacgerg closed 5 years ago

isaacgerg commented 5 years ago
arch = [
    to_head( '..' ),
    to_cor(),
    to_begin(),
    to_Conv("conv1", 320, 8, offset="(0,0,0)", to="(0,0,0)", height=64, depth=64, width=8),
    to_Pool("pool1", offset="(0,0,0)", to="(conv1-east)", height=60, depth=60, width=1),

    to_Conv("conv2", 160, 16, offset="(1,0,0)", to="(pool1-east)", height=32, depth=32, width=16),
    to_Pool("pool2", offset="(0,0,0)", to="(conv2-east)", height=30, depth=30, width=1),

    to_Conv("conv3", 80, 32, offset="(0,0,0)", to="(pool2-east)", height=16, depth=16, width=32),
    to_Pool("pool3", offset="(0,0,0)", to="(conv3-east)", height=1, depth=1, width=32, caption='GlobalAveragePooling'),

    to_SoftMax("soft1", 8 ,"(0,0,0)", "(pool3-east)", caption="fc1"),
    to_connection( "soft2", "soft1"),
    to_SoftMax("soft2", 1 ,"(1,0,0)", "(soft1-east)", caption="fc2", height=1, width=1, depth=1),
    to_end()
    ]

The above makes a green arrow through the whole network instead of the last 2 layers. Why?

isaacgerg commented 5 years ago

My bad. You have to add the to_connection()'s after the to_X are already defined.