import sys
sys.path.append('../')
from pycore.tikzeng import *
# defined your arch
arch = [
to_head( '..' ), #初始化
to_cor(), #颜色设置
to_begin(), #开始标志
# to_input('1.png',width=8, height=8,name="cat"), #参数分别是图片路径名称、宽、高、以及名称
to_Conv("conv1", 512, 64, offset="(0,0,0)", to="(0,0,0)", height=64, depth=64, width=2 ), #添加一层卷积层 (to_ConvConvRelu 添加一层带有relu操作的卷积层)
to_Pool("pool1", offset="(0,0,0)", to="(conv1-east)"), #添加一层池化层
#to是坐标、位置 offset则是偏移位置 (个人理解)
to_Conv("conv2", 128, 64, offset="(1,0,0)", to="(pool1-east)", height=32, depth=32, width=2 ),
to_connection( "pool1", "conv2"), #使用箭头连接指定的两层
to_Pool("pool2", offset="(0,0,0)", to="(conv2-east)", height=28, depth=28, width=1), # to="(conv2-east)"--在con2层的东侧 #opacity=0.9
to_SoftMax("soft1", 10 ,"(3,0,0)", "(pool1-east)", caption="SOFT" ), #添加SoftMax
to_connection("pool2", "soft1"), #使用箭头连接指定的两层
to_Sum("sum1", offset="(1.5,0,0)", to="(soft1-east)", radius=2.5, opacity=0.6), #添加一个 “+” 按钮sum1
to_connection("soft1", "sum1"),
to_end() #结束标志
]
#to_skip 跳过指定的两层 连接
def main():
namefile = str(sys.argv[0]).split('.')[0]
to_generate(arch, namefile + '.tex' )
if __name__ == '__main__':
main()
PlotNeuralNet绘图
最新推荐文章于 2024-08-16 11:40:27 发布