diff --git a/pycore/tikzeng.py b/pycore/tikzeng.py index f29e12050f0c98c5411d34d3cc3ece71880bdc7c..8e988c449c3733c73b96b9f8630beda874adcddf 100644 --- a/pycore/tikzeng.py +++ b/pycore/tikzeng.py @@ -20,6 +20,7 @@ def to_cor(): \def\FcColor{rgb:blue,5;red,2.5;white,5} \def\FcReluColor{rgb:blue,5;red,5;white,4} \def\SoftmaxColor{rgb:magenta,5;black,7} +\def\SumColor{rgb:blue,5;green,15} """ def to_begin(): @@ -164,6 +165,19 @@ def to_SoftMax( name, s_filer=10, offset="(0,0,0)", to="(0,0,0)", width=1.5, hei }; """ +def to_Sum( name, offset="(0,0,0)", to="(0,0,0)", radius=2.5, opacity=0.6): + return r""" +\pic[shift={"""+ offset +"""}] at """+ to +""" + {Ball={ + name=""" + name +""", + fill=\SumColor, + opacity="""+ str(opacity) +""", + radius="""+ str(radius) +""", + logo=$+$ + } + }; +""" + def to_connection( of, to): return r""" diff --git a/pyexamples/test_simple.py b/pyexamples/test_simple.py index e90b0a11fe28c799099489d9d6e7c32a7a41ab5f..67a1cfacd1fff92c767adc2870cace923fa9b5b8 100644 --- a/pyexamples/test_simple.py +++ b/pyexamples/test_simple.py @@ -15,6 +15,8 @@ arch = [ to_Pool("pool2", offset="(0,0,0)", to="(conv2-east)", height=28, depth=28, width=1), to_SoftMax("soft1", 10 ,"(3,0,0)", "(pool1-east)", caption="SOFT" ), to_connection("pool2", "soft1"), + to_Sum("sum1", offset="(1.5,0,0)", to="(soft1-east)", radius=2.5, opacity=0.6), + to_connection("soft1", "sum1"), to_end() ]