[
  {
    "path": ".gitignore",
    "content": "*.aux\n*.log\n*.gz\n\n__pycache__\nbooks\nproject\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n.hypothesis/\n.pytest_cache/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# pyenv\n.python-version\n\n# celery beat schedule file\ncelerybeat-schedule\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectRootManager\" version=\"2\" project-jdk-name=\"Python 2.7.12 (/usr/bin/python2.7)\" project-jdk-type=\"Python SDK\" />\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/.idea/plotneuralnet.iml\" filepath=\"$PROJECT_DIR$/.idea/plotneuralnet.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/plotneuralnet.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"PYTHON_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\">\n    <content url=\"file://$MODULE_DIR$\" />\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n  <component name=\"TestRunnerService\">\n    <option name=\"projectConfiguration\" value=\"Nosetests\" />\n    <option name=\"PROJECT_TEST_RUNNER\" value=\"Nosetests\" />\n  </component>\n</module>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/workspace.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ChangeListManager\">\n    <list default=\"true\" id=\"776fe343-0ed9-4619-bd19-7a1b6f20e48a\" name=\"Default\" comment=\"\" />\n    <option name=\"EXCLUDED_CONVERTED_TO_IGNORED\" value=\"true\" />\n    <option name=\"TRACKING_ENABLED\" value=\"true\" />\n    <option name=\"SHOW_DIALOG\" value=\"false\" />\n    <option name=\"HIGHLIGHT_CONFLICTS\" value=\"true\" />\n    <option name=\"HIGHLIGHT_NON_ACTIVE_CHANGELIST\" value=\"false\" />\n    <option name=\"LAST_RESOLUTION\" value=\"IGNORE\" />\n  </component>\n  <component name=\"Git.Settings\">\n    <option name=\"RECENT_GIT_ROOT_PATH\" value=\"$PROJECT_DIR$\" />\n  </component>\n  <component name=\"ProjectFrameBounds\" extendedState=\"6\">\n    <option name=\"x\" value=\"97\" />\n    <option name=\"y\" value=\"24\" />\n    <option name=\"width\" value=\"888\" />\n    <option name=\"height\" value=\"1078\" />\n  </component>\n  <component name=\"ProjectLevelVcsManager\" settingsEditedManually=\"true\" />\n  <component name=\"ProjectView\">\n    <navigator currentView=\"ProjectPane\" proportions=\"\" version=\"1\">\n      <flattenPackages />\n      <showMembers />\n      <showModules />\n      <showLibraryContents />\n      <hideEmptyPackages />\n      <abbreviatePackageNames />\n      <autoscrollToSource />\n      <autoscrollFromSource />\n      <sortByType />\n      <manualOrder />\n      <foldersAlwaysOnTop value=\"true\" />\n    </navigator>\n    <panes>\n      <pane id=\"ProjectPane\">\n        <subPane>\n          <expand>\n            <path>\n              <item name=\"plotneuralnet\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"plotneuralnet\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n          </expand>\n          <select />\n        </subPane>\n      </pane>\n      <pane id=\"Scope\" />\n      <pane id=\"Scratches\" />\n    </panes>\n  </component>\n  <component name=\"PropertiesComponent\">\n    <property name=\"last_opened_file_path\" value=\"$PROJECT_DIR$\" />\n  </component>\n  <component name=\"RunDashboard\">\n    <option name=\"ruleStates\">\n      <list>\n        <RuleState>\n          <option name=\"name\" value=\"ConfigurationTypeDashboardGroupingRule\" />\n        </RuleState>\n        <RuleState>\n          <option name=\"name\" value=\"StatusDashboardGroupingRule\" />\n        </RuleState>\n      </list>\n    </option>\n  </component>\n  <component name=\"ShelveChangesManager\" show_recycled=\"false\">\n    <option name=\"remove_strategy\" value=\"false\" />\n  </component>\n  <component name=\"TaskManager\">\n    <task active=\"true\" id=\"Default\" summary=\"Default task\">\n      <changelist id=\"776fe343-0ed9-4619-bd19-7a1b6f20e48a\" name=\"Default\" comment=\"\" />\n      <created>1536764917516</created>\n      <option name=\"number\" value=\"Default\" />\n      <option name=\"presentableId\" value=\"Default\" />\n      <updated>1536764917516</updated>\n    </task>\n    <servers />\n  </component>\n  <component name=\"ToolWindowManager\">\n    <frame x=\"97\" y=\"24\" width=\"1855\" height=\"1085\" extended-state=\"6\" />\n    <layout>\n      <window_info id=\"Project\" active=\"false\" anchor=\"left\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"true\" show_stripe_button=\"true\" weight=\"0.24985963\" sideWeight=\"0.5\" order=\"0\" side_tool=\"false\" content_ui=\"combo\" />\n      <window_info id=\"TODO\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"6\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Event Log\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"-1\" side_tool=\"true\" content_ui=\"tabs\" />\n      <window_info id=\"Run\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"2\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Version Control\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"-1\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Python Console\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"-1\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Structure\" active=\"false\" anchor=\"left\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.25\" sideWeight=\"0.5\" order=\"1\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Terminal\" active=\"true\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"true\" show_stripe_button=\"true\" weight=\"0.33032694\" sideWeight=\"0.5\" order=\"-1\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Debug\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.4\" sideWeight=\"0.5\" order=\"3\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Favorites\" active=\"false\" anchor=\"left\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"-1\" side_tool=\"true\" content_ui=\"tabs\" />\n      <window_info id=\"Data View\" active=\"false\" anchor=\"right\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"-1\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Cvs\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.25\" sideWeight=\"0.5\" order=\"4\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Hierarchy\" active=\"false\" anchor=\"right\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.25\" sideWeight=\"0.5\" order=\"2\" side_tool=\"false\" content_ui=\"combo\" />\n      <window_info id=\"Message\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"0\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Commander\" active=\"false\" anchor=\"right\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.4\" sideWeight=\"0.5\" order=\"0\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Find\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.33\" sideWeight=\"0.5\" order=\"1\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Inspection\" active=\"false\" anchor=\"bottom\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.4\" sideWeight=\"0.5\" order=\"5\" side_tool=\"false\" content_ui=\"tabs\" />\n      <window_info id=\"Ant Build\" active=\"false\" anchor=\"right\" auto_hide=\"false\" internal_type=\"DOCKED\" type=\"DOCKED\" visible=\"false\" show_stripe_button=\"true\" weight=\"0.25\" sideWeight=\"0.5\" order=\"1\" side_tool=\"false\" content_ui=\"tabs\" />\n    </layout>\n  </component>\n  <component name=\"VcsContentAnnotationSettings\">\n    <option name=\"myLimit\" value=\"2678400000\" />\n  </component>\n  <component name=\"XDebuggerManager\">\n    <breakpoint-manager />\n    <watches-manager />\n  </component>\n</project>"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 HarisIqbal88\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# PlotNeuralNet\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2526396.svg)](https://doi.org/10.5281/zenodo.2526396)\n\nLatex code for drawing neural networks for reports and presentation. Have a look into examples to see how they are made. Additionally, lets consolidate any improvements that you make and fix any bugs to help more people with this code.\n\n## Examples\n\nFollowing are some network representations:\n\n<p align=\"center\"><img  src=\"https://user-images.githubusercontent.com/17570785/50308846-c2231880-049c-11e9-8763-3daa1024de78.png\" width=\"85%\" height=\"85%\"></p>\n<h6 align=\"center\">FCN-8 (<a href=\"https://www.overleaf.com/read/kkqntfxnvbsk\">view on Overleaf</a>)</h6>\n\n\n<p align=\"center\"><img  src=\"https://user-images.githubusercontent.com/17570785/50308873-e2eb6e00-049c-11e9-9587-9da6bdec011b.png\" width=\"85%\" height=\"85%\"></p>\n<h6 align=\"center\">FCN-32 (<a href=\"https://www.overleaf.com/read/wsxpmkqvjnbs\">view on Overleaf</a>)</h6>\n\n\n<p align=\"center\"><img  src=\"https://user-images.githubusercontent.com/17570785/50308911-03b3c380-049d-11e9-92d9-ce15669017ad.png\" width=\"85%\" height=\"85%\"></p>\n<h6 align=\"center\">Holistically-Nested Edge Detection (<a href=\"https://www.overleaf.com/read/jxhnkcnwhfxp\">view on Overleaf</a>)</h6>\n\n## Getting Started\n1. Install the following packages on Ubuntu.\n    * Ubuntu 16.04\n        ```\n        sudo apt-get install texlive-latex-extra\n        ```\n\n    * Ubuntu 18.04.2\nBase on this [website](https://gist.github.com/rain1024/98dd5e2c6c8c28f9ea9d), please install the following packages.\n        ```\n        sudo apt-get install texlive-latex-base\n        sudo apt-get install texlive-fonts-recommended\n        sudo apt-get install texlive-fonts-extra\n        sudo apt-get install texlive-latex-extra\n        ```\n\n    * Windows\n    1. Download and install [MikTeX](https://miktex.org/download).\n    2. Download and install bash runner on Windows, recommends [Git bash](https://git-scm.com/download/win) or Cygwin(https://www.cygwin.com/)\n\n2. Execute the example as followed.\n    ```\n    cd pyexamples/\n    bash ../tikzmake.sh test_simple\n    ```\n\n## TODO\n\n- [X] Python interface\n- [ ] Add easy legend functionality\n- [ ] Add more layer shapes like TruncatedPyramid, 2DSheet etc\n- [ ] Add examples for RNN and likes.\n\n## Latex usage\n\nSee [`examples`](examples) directory for usage.\n\n## Python usage\n\nFirst, create a new directory and a new Python file:\n\n    $ mkdir my_project\n    $ cd my_project\n    vim my_arch.py\n\nAdd the following code to your new file:\n\n```python\nimport sys\nsys.path.append('../')\nfrom pycore.tikzeng import *\n\n# defined your arch\narch = [\n    to_head( '..' ),\n    to_cor(),\n    to_begin(),\n    to_Conv(\"conv1\", 512, 64, offset=\"(0,0,0)\", to=\"(0,0,0)\", height=64, depth=64, width=2 ),\n    to_Pool(\"pool1\", offset=\"(0,0,0)\", to=\"(conv1-east)\"),\n    to_Conv(\"conv2\", 128, 64, offset=\"(1,0,0)\", to=\"(pool1-east)\", height=32, depth=32, width=2 ),\n    to_connection( \"pool1\", \"conv2\"),\n    to_Pool(\"pool2\", offset=\"(0,0,0)\", to=\"(conv2-east)\", height=28, depth=28, width=1),\n    to_SoftMax(\"soft1\", 10 ,\"(3,0,0)\", \"(pool1-east)\", caption=\"SOFT\"  ),\n    to_connection(\"pool2\", \"soft1\"),\n    to_end()\n    ]\n\ndef main():\n    namefile = str(sys.argv[0]).split('.')[0]\n    to_generate(arch, namefile + '.tex' )\n\nif __name__ == '__main__':\n    main()\n```\n\nNow, run the program as follows:\n\n    bash ../tikzmake.sh my_arch\n\n\n\n"
  },
  {
    "path": "examples/AlexNet/alexnet.tex",
    "content": "\\documentclass[border=8pt, multi, tikz]{standalone} \r\n\\usepackage{import}\r\n\\subimport{../layers/}{init}\r\n\\usetikzlibrary{positioning}\r\n\\usetikzlibrary{3d} %for including external image \r\n\r\n\r\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\r\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\r\n\\def\\PoolColor{rgb:red,1;black,0.3}\r\n\\def\\UnpoolColor{rgb:blue,2;green,1;black,0.3}\r\n\\def\\FcColor{rgb:blue,2;green,5;white,5}\r\n\\def\\FcReluColor{blue,2;green,5;;white,4}\r\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}   \r\n\r\n\r\n\\newcommand{\\copymidarrow}{\\tikz \\draw[-Stealth,line width=0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}\r\n\r\n\\begin{document}\r\n\\begin{tikzpicture}\r\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\r\n\\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]\r\n\r\n\r\n\\pic[shift={(0,0,0)}] at (0,0,0) \r\n    {Box={\r\n        name=conv0,\r\n        caption= ,\r\n        xlabel={{3, }},\r\n        zlabel=224,\r\n        fill=\\ConvColor,\r\n        height=44.8,\r\n        width=3,\r\n        depth=44.8\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (conv0-east) \r\n    {Box={\r\n        name=conv1,\r\n        caption= ,\r\n        xlabel={{96, }},\r\n        zlabel=55,\r\n        fill=\\ConvColor,\r\n        height=11.0,\r\n        width=4.8,\r\n        depth=11.0\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (conv0-east)    -- node {\\midarrow} (conv1-west);\r\n\r\n\r\n\\pic[shift={ (0,0,0) }] at (conv1-east) \r\n    {Box={\r\n        name=pool1,\r\n        caption= ,\r\n        fill=\\PoolColor,\r\n        opacity=0.5,\r\n        height=5.4,\r\n        width=1,\r\n        depth=5.4\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (pool1-east) \r\n    {Box={\r\n        name=conv2,\r\n        caption= ,\r\n        xlabel={{256, }},\r\n        zlabel=27,\r\n        fill=\\ConvColor,\r\n        height=5.4,\r\n        width=12.8,\r\n        depth=5.4\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (pool1-east)    -- node {\\midarrow} (conv2-west);\r\n\r\n\r\n\\pic[shift={ (0,0,0) }] at (conv2-east) \r\n    {Box={\r\n        name=pool2,\r\n        caption= ,\r\n        fill=\\PoolColor,\r\n        opacity=0.5,\r\n        height=2.6,\r\n        width=1,\r\n        depth=2.6\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (pool2-east) \r\n    {Box={\r\n        name=conv3,\r\n        caption= ,\r\n        xlabel={{384, }},\r\n        zlabel=13,\r\n        fill=\\ConvColor,\r\n        height=2.6,\r\n        width=19.2,\r\n        depth=2.6\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (pool2-east)    -- node {\\midarrow} (conv3-west);\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (conv3-east) \r\n    {Box={\r\n        name=conv4,\r\n        caption= ,\r\n        xlabel={{384, }},\r\n        zlabel=13,\r\n        fill=\\ConvColor,\r\n        height=2.6,\r\n        width=19.2,\r\n        depth=2.6\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (conv3-east)    -- node {\\midarrow} (conv4-west);\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (conv4-east) \r\n    {Box={\r\n        name=conv5,\r\n        caption= ,\r\n        xlabel={{256, }},\r\n        zlabel=13,\r\n        fill=\\ConvColor,\r\n        height=2.6,\r\n        width=12.8,\r\n        depth=2.6\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (conv4-east)    -- node {\\midarrow} (conv5-west);\r\n\r\n\r\n\\pic[shift={ (0,0,0) }] at (conv5-east) \r\n    {Box={\r\n        name=pool3,\r\n        caption= ,\r\n        fill=\\PoolColor,\r\n        opacity=0.5,\r\n        height=1.2,\r\n        width=1,\r\n        depth=1.2\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (pool3-east) \r\n    {Box={\r\n        name=Fc1,\r\n        caption= ,\r\n        xlabel={{1, }},\r\n        zlabel=4096,\r\n        fill=\\FcColor,\r\n        height=1,\r\n        width=1,\r\n        depth=40.96\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (pool3-east)    -- node {\\midarrow} (Fc1-west);\r\n\r\n\r\n\\pic[shift={(2,0,0)}] at (Fc1-east) \r\n    {Box={\r\n        name=Fc2,\r\n        caption= ,\r\n        xlabel={{1, }},\r\n        zlabel=4096,\r\n        fill=\\FcColor,\r\n        height=1,\r\n        width=1,\r\n        depth=40.96\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (Fc1-east)    -- node {\\midarrow} (Fc2-west);\r\n\r\n\r\n\\pic[shift={(3,0,0)}] at (Fc2-east) \r\n    {Box={\r\n        name=soft1,\r\n        caption=SOFT,\r\n        xlabel={{\" \",\"dummy\"}},\r\n        zlabel=1000,\r\n        fill=\\SoftmaxColor,\r\n        opacity=0.8,\r\n        height=3,\r\n        width=1.5,\r\n        depth=25\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (Fc2-east)    -- node {\\midarrow} (soft1-west);\r\n\r\n\r\n\\end{tikzpicture}\r\n\\end{document}\r\n"
  },
  {
    "path": "examples/HED/HED.tex",
    "content": "\\documentclass[border=15pt, multi, tikz]{standalone}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\DcnvColor{rgb:blue,5;green,2.5;white,5}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}\n\\def\\SumColor{rgb:blue,5;green,15}\n\\def\\poolsep{1}\n\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.6]\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Layer Blocks\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% conv1_1,conv1_2,%pool1\n\\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%\n        xlabel={{\"64\",\"64\"}},zlabel=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2,2},depth=40}};\n\\pic[shift={(\\poolsep,0,0)}] at (cr1-east) {Box={name=p1,%\n        fill=\\PoolColor,opacity=0.5,height=30,width=1,depth=30}};\n% conv2_1,conv2_2,pool2\n\\pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%\n        xlabel={{\"64\",\"64\"}},zlabel=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=30,width={3,3},depth=30}};\n\\pic[shift={(\\poolsep,0,0)}] at (cr2-east) {Box={name=p2,%\n        fill=\\PoolColor,opacity=0.5,height=23,width=1,depth=23}};\n% conv3_1,conv3_2,pool3\n\\pic[shift={(1,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%\n        xlabel={{\"256\",\"256\",\"256\"}},zlabel=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=23,width={4,4,4},depth=23}};\n\\pic[shift={(\\poolsep,0,0)}] at (cr3-east) {Box={name=p3,%\n        fill=\\PoolColor,opacity=0.5,height=14,width=1,depth=14}};\n% conv4_1,conv4_2,conv4_3,pool4\n\\pic[shift={(1,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=14,width={7,7,7},depth=14}};\n\\pic[shift={(\\poolsep,0,0)}] at (cr4-east) {Box={name=p4,%\n        fill=\\PoolColor,opacity=0.5,height=8,width=1,depth=8}};\n% conv5_1,conv5_2,conv5_3,pool5\n\\pic[shift={(1,0,0)}] at (p4-east) {RightBandedBox={name=cr5,%\n        xlabel={{\"512\",\"512\",\"512\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=8,width={7,7,7},depth=8}};\n%% fc8 -> cr8 (score32)\n\\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=score16,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,%\n        height=8,width=2,depth=8,zlabel=I/16}};\n\n%% Upsampling Deconv Layer\n%% Dcnv16    \n\\pic[shift={(2.5,0,0)}] at (score16-east) {Box={name=d16,%\n        xlabel={{\"\",\"dummy\"}},fill=\\DcnvColor,opacity=0.7,height=40,width=0.5,depth=40}};\n%% Dcnv8    \n\\pic[shift={(.25,0,0)}] at (d16-east) {Box={name=d8,%\n        xlabel={{\"\",\"dummy\"}},fill=\\DcnvColor,opacity=0.7,height=40,width=0.5,depth=40}};\n%% Dcnv4    \n\\pic[shift={(.25,0,0)}] at (d8-east) {Box={name=d4,%\n        xlabel={{\"\",\"dummy\"}},fill=\\DcnvColor,opacity=0.7,height=40,width=0.5,depth=40}};\n%% Dcnv2    \n\\pic[shift={(.25,0,0)}] at (d4-east) {Box={name=d2,%\n        xlabel={{\"\",\"dummy\"}},fill=,opacity=0.01,height=40,width=0.5,depth=40}};\n\n%% Dcnv envelope    \n\\pic[shift={(-0.2,0,0)}] at (d16-west) {Box={name=env,caption=concatenation of deconvolved feature maps,%\n        xlabel={{\"\",\"dummy\"}},fill=,opacity=0.2,height=42,width={8},depth=42}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\def\\skipshift{6.5}\n%%Joining with previous streams (fcn-16)\n%% score16\n\\pic[shift={(0,0,3+\\skipshift)}] at (cr5-anchor) {Box={name=score8,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,height=14,width=2,depth=14,zlabel=I/8}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%Joining with previous streams (fcn-8)\n%% score8\n\\pic[shift={(0,0,8+\\skipshift)}] at (cr4-east) {Box={name=score4,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,height=23,width=2,depth=23,zlabel=I/4}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%Joining with previous streams (fcn-4)\n%% score4\n\\pic[shift={(1,0,13+\\skipshift)}] at (cr3-east) {Box={name=score2,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,height=30,width=2,depth=30,zlabel=I/2}}; \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%Joining with previous streams (fcn-2)\n%% score2\n\\pic[shift={(0.3,0,22+\\skipshift)}] at (p2-east) {Box={name=score,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,height=40,width=2,depth=40,zlabel=I}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% Final convolution\n\n\\pic[shift={(3,0,0)}] at (d2-east) {Box={name=output,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,height=40,width=2,depth=40,zlabel=I}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%% Draw connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (cr1-east)    -- node {\\midarrow} (p1-west);\n\\draw [connection]  (p1-east)    -- node {\\midarrow} (cr2-west);\n\\draw [connection]  (cr2-east)    -- node {\\midarrow} (p2-west);\n\\draw [connection]  (p2-east)    -- node {\\midarrow} (cr3-west);\n\\draw [connection]  (cr3-east)    -- node {\\midarrow} (p3-west);\n\\draw [connection]  (p3-east)    -- node {\\midarrow} (cr4-west);\n\\draw [connection]  (cr4-east)    -- node {\\midarrow} (p4-west);\n\\draw [connection]  (p4-east)    -- node {\\midarrow} (cr5-west);\n\\draw [connection]  (score16-east)    -- node {\\midarrow} (d16-west);\n%\n\\path (cr4-east) -- (p4-west) coordinate[pos=0.4] (after4) ;\n\\draw (d16-near)++(0,0,-1+\\skipshift) coordinate (d16h);\n\\draw [connection]  (after4)    -- node {\\midarrow} ++(0,0,3+\\skipshift) -- node {\\midarrow} (score8-west);\n\\draw [connection]  (score8-east) -- node{\\midarrow} (d16h) -- node{\\midarrow}(d16-near);\n%\n\\path (cr3-east) -- (p3-west) coordinate[pos=0.4] (after3) ;\n\\draw (d8-near)++(0,0,4+\\skipshift) coordinate (d8h);\n\\draw [connection]  (after3)    -- node {\\midarrow} ++(0,0,8+\\skipshift) -- node {\\midarrow} (score4-west);\n\\draw [connection]  (score4-east) -- node{\\midarrow} (d8h) -- node{\\midarrow}(d8-near);\n%\n\\path (cr2-east) -- (p2-west) coordinate[pos=0.4] (after2) ;\n\\draw (d4-near)++(0,0,9+\\skipshift) coordinate (d4h);\n\\draw [connection]  (after2)    -- node {\\midarrow} ++(0,0,13+\\skipshift) -- node {\\midarrow} (score2-west);\n\\draw [connection]  (score2-east) -- node{\\midarrow} (d4h) -- node{\\midarrow}(d4-near);\n%\n\\path (cr1-east) -- (p1-west) coordinate[pos=0.4] (after1) ;\n\\draw (d2-near)++(0,0,18+\\skipshift) coordinate (d2h);\n\\draw [connection]  (after1)    -- node {\\midarrow} ++(0,0,22+\\skipshift) -- node {\\midarrow} (score-west);\n\\draw [connection]  (score-east) -- node{\\midarrow} (d2h) -- node{\\midarrow}(d2-near);\n\n\\draw [connection]  (d2-east)    -- node {\\midarrow} (output-west);\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n\\end{tikzpicture}\n\\end{document}\\grid\n"
  },
  {
    "path": "examples/LeNet/lenet.tex",
    "content": "\\documentclass[border=8pt, multi, tikz]{standalone} \r\n\\usepackage{import}\r\n\\subimport{../layers/}{init}\r\n\\usetikzlibrary{positioning}\r\n\\usetikzlibrary{3d} %for including external image \r\n\r\n\r\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\r\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\r\n\\def\\PoolColor{rgb:red,1;black,0.3}\r\n\\def\\UnpoolColor{rgb:blue,2;green,1;black,0.3}\r\n\\def\\FcColor{rgb:blue,5;red,2.5;white,5}\r\n\\def\\FcReluColor{rgb:blue,5;red,5;white,4}\r\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}   \r\n\r\n\r\n\\newcommand{\\copymidarrow}{\\tikz \\draw[-Stealth,line width=0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}\r\n\r\n\\begin{document}\r\n\\begin{tikzpicture}\r\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\r\n\\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]\r\n\r\n\r\n\\pic[shift={(0,0,0)}] at (0,0,0) \r\n    {Box={\r\n        name=conv0,\r\n        caption= ,\r\n        xlabel={{1, }},\r\n        zlabel=32,\r\n        fill=\\ConvColor,\r\n        height=32,\r\n        width=1,\r\n        depth=32\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (conv0-east) \r\n    {Box={\r\n        name=conv1,\r\n        caption= ,\r\n        xlabel={{6, }},\r\n        zlabel=28,\r\n        fill=\\ConvColor,\r\n        height=28,\r\n        width=6,\r\n        depth=28\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (conv0-east)    -- node {\\midarrow} (conv1-west);\r\n\r\n\r\n\\pic[shift={ (0,0,0) }] at (conv1-east) \r\n    {Box={\r\n        name=pool1,\r\n        caption= ,\r\n        fill=\\PoolColor,\r\n        opacity=0.5,\r\n        height=14,\r\n        width=6,\r\n        depth=14\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (pool1-east) \r\n    {Box={\r\n        name=conv2,\r\n        caption= ,\r\n        xlabel={{16, }},\r\n        zlabel=10,\r\n        fill=\\ConvColor,\r\n        height=10,\r\n        width=16,\r\n        depth=10\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (pool1-east)    -- node {\\midarrow} (conv2-west);\r\n\r\n\r\n\\pic[shift={ (0,0,0) }] at (conv2-east) \r\n    {Box={\r\n        name=pool2,\r\n        caption= ,\r\n        fill=\\PoolColor,\r\n        opacity=0.5,\r\n        height=5,\r\n        width=16,\r\n        depth=5\r\n        }\r\n    };\r\n\r\n\r\n\\pic[shift={(1,0,0)}] at (pool2-east) \r\n    {Box={\r\n        name=conv3,\r\n        caption= ,\r\n        xlabel={{1, }},\r\n        zlabel=120,\r\n        fill=\\ConvColor,\r\n        height=1,\r\n        width=1,\r\n        depth=120\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (pool2-east)    -- node {\\midarrow} (conv3-west);\r\n\r\n\r\n\\pic[shift={(2,0,0)}] at (conv3-east) \r\n    {Box={\r\n        name=conv4,\r\n        caption= ,\r\n        xlabel={{1, }},\r\n        zlabel=84,\r\n        fill=\\ConvColor,\r\n        height=1,\r\n        width=1,\r\n        depth=84\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (conv3-east)    -- node {\\midarrow} (conv4-west);\r\n\r\n\r\n\\pic[shift={(3,0,0)}] at (conv4-east) \r\n    {Box={\r\n        name=soft1,\r\n        caption=SOFT,\r\n        xlabel={{\" \",\"dummy\"}},\r\n        zlabel=10,\r\n        fill=\\SoftmaxColor,\r\n        opacity=0.8,\r\n        height=3,\r\n        width=1.5,\r\n        depth=25\r\n        }\r\n    };\r\n\r\n\r\n\\draw [connection]  (conv4-east)    -- node {\\midarrow} (soft1-west);\r\n\r\n\r\n\\end{tikzpicture}\r\n\\end{document}\r\n"
  },
  {
    "path": "examples/LeNet/lenet.txt",
    "content": "input(32, 32, 1)\r\nconv(28, 28, 6)\r\npool(14, 14, 6)\r\nconv(10, 10, 16)\r\npool(5, 5, 16)\r\nconv(1,1,120)\r\nfullyconn(1,1,84)\r\nsoftmax(1,1,10)"
  },
  {
    "path": "examples/SoftmaxLoss/SoftmaxLoss.tex",
    "content": "\\documentclass[border=15pt, multi, tikz]{standalone}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\n\\newcommand{\\up}{0.25}\n\\newcommand{\\down}{0.25}\n\\newcommand{\\arrowlength}{4}\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw previous connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (-\\arrowlength,\\up,0) \nnode[anchor=south west,scale=2.1]{$p(x^{(t)})$}   \n-- node {\\midarrow} (0,\\up,0);  \n\\draw [connection]  (0,-\\down,0)  -- node {\\midarrow} ++(-\\arrowlength.0,0)\nnode[anchor=north west,inner sep = 10, xshift=-25,scale=2.3]\n{\n    $\\frac{\\partial L}{\\partial E_\\mathcal{S}}\\frac{\\partial E_\\mathcal{S}}{\\partial p}$\n};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Layer Blocks\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\pic[shift={(0,0,0)}] at (0,0,0) {Box={name=crp1,caption=SoftmaxLoss: $E_\\mathcal{S}$ ,%\n        fill={rgb:blue,1.5;red,3.5;green,3.5;white,5},opacity=0.5,height=20,width=7,depth=20}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw next connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (crp1-east)++(0,\\up,0) -- node {\\midarrow} ++(\\arrowlength.0,0) \nnode [anchor=south east,scale=2.1]{$E_\\mathcal{S} [p;\\theta]$};\n\n\\draw [connection]  (crp1-east)++(\\arrowlength,-\\down,0)  \nnode[anchor=north east,inner sep = 10, xshift=25,scale=2.3]\n{\n    $\\frac{\\partial L}{\\partial E_\\mathcal{S}} = \\lambda_\\mathcal{S}$\n}   \n-- node {\\midarrow} ++(-\\arrowlength,0,0);\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n   \t\t\n\n\\end{tikzpicture}\n\\end{document}\n"
  },
  {
    "path": "examples/Unet/Unet.tex",
    "content": "\\documentclass[border=8pt, multi, tikz]{standalone}\n%\\usepackage{blocks}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\UnpoolColor{rgb:blue,2;green,1;black,0.3}\n\\def\\FcColor{rgb:blue,5;red,2.5;white,5}\n\\def\\FcReluColor{rgb:blue,5;red,5;white,4}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}\n\n\n\\newcommand{\\copymidarrow}{\\tikz \\draw[-Stealth,line width =0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n\\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Encoder\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% conv1_1,conv1_2\n\\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%\n        xlabel={{\"64\",\"64\"}},zlabel=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2,2},depth=40}};\n%pool1\n\\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%\n        fill=\\PoolColor,opacity=0.5,height=32,width=1,depth=32}};\n%%%%%%%%%%\n% conv2_1,conv2_2\n\\pic[shift={(1,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%\n        xlabel={{\"128\",\"128\"}},zlabel=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=32,width={3.5,3.5},depth=32}};\n%pool2\n\\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%\n        fill=\\PoolColor,opacity=0.5,height=25,width=1,depth=25}};\n%%%%%%%%%%\n% conv3_1,conv3_2\n\\pic[shift={(0.75,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%\n        xlabel={{\"256\",\"256\"}},zlabel=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=25,width={4.5,4.5},depth=25}};\n%pool3\n\\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%\n        fill=\\PoolColor,opacity=0.5,height=16,width=1,depth=16}};\n%%%%%%%%%%\n% conv4_1,conv4_2,conv4_3\n\\pic[shift={(0.5,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%\n        xlabel={{\"512\",\"512\"}},zlabel=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=16,width={6,6},depth=16}};\n%pool4\n\\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%\n        fill=\\PoolColor,opacity=0.5,height=8,width=1,depth=8}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Bottleneck\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3\n\\pic[shift={(0.75,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=Bottleneck Conv,%\n        xlabel={{\"1024\",\"1024\"}},zlabel=I/16,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=8,width={8,8},depth=8}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Decoder \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% unpool4, \n\\pic[shift={(1.2,0,0)}] at (cr5-east) {Box={name=up4,%\n        fill=\\UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};\n\\pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%\n        xlabel={{\"512\",\"dummy\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=16,width=6,depth=16}};\n\\pic[shift={(0,0,0)}] at (ucr4-east) {RightBandedBox={name=cat4,%\n        xlabel={{\"512\",\"\"}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=16,width=6,depth=16}};    \n\\pic[shift={(0,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%\n        xlabel={{\"512\",\"512\"}},zlabel=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=16,width={6,6},depth=16}};\n%%%%%%%%%%\n%% unpool3, \n\\pic[shift={(1.5,0,0)}] at (ucr4a-east) {Box={name=up3,%\n        fill=\\UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};\n\\pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%\n        xlabel={{\"256\",\"dummy\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=25,width=4.5,depth=25}};\n\\pic[shift={(0,0,0)}] at (ucr3-east) {RightBandedBox={name=cat3,%\n        xlabel={{\"256\",\"\"}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=25,width=4.5,depth=25}};\n\\pic[shift={(0,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%\n        xlabel={{\"256\",\"256\"}},zlabel=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=25,width={4.5,4.5},depth=25}};\n%%%%%%%%%%\n%% unpool2, \n\\pic[shift={(1,0,0)}] at (ucr3a-east) {Box={name=up2,%\n        fill=\\UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};\n\\pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%\n        xlabel={{\"128\",\"dummy\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=32,width=3.5,depth=32}};\n\\pic[shift={(0,0,0)}] at (ucr2-east) {RightBandedBox={name=cat2,%\n        xlabel={{\"128\",\"\"}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=32,width=3.5,depth=32}};    \n\\pic[shift={(0,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%\n        xlabel={{\"128\",\"128\"}},zlabel=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=32,width={3.5,3.5},depth=32}};\n%%%%%%%%%%\n%% unpool1, \n\\pic[shift={(1.5,0,0)}] at (ucr2a-east) {Box={name=up1,%\n        fill=\\UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};\n\\pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%\n        xlabel={{\"64\",\"dummy\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width=2.5,depth=40}};\n\\pic[shift={(0,0,0)}] at (ucr1-east) {RightBandedBox={name=cat1,%\n        xlabel={{\"64\",\"\"}},fill={rgb:white,1;black,3},bandfill={rgb:white,1;black,2},opacity=0.2,height=40,width=2.5,depth=40}};  \n\\pic[shift={(0,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%\n        xlabel={{\"64\",\"64\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2.5,2.5},depth=40}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Classifier \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\pic[shift={(0.75,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%\n        zlabel=I,fill=\\SoftmaxColor,height=40,width=1,depth=40}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% Draw connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (p1-east)    -- node {\\midarrow} (cr2-west);\n\\draw [connection]  (p2-east)    -- node {\\midarrow} (cr3-west);\n\\draw [connection]  (p3-east)    -- node {\\midarrow} (cr4-west);\n\\draw [connection]  (p4-east)    -- node {\\midarrow} (cr5-west);\n\\draw [connection]  (cr5-east)   -- node {\\midarrow} (up4-west);\n\\draw [connection]  (ucr4a-east) -- node {\\midarrow} (up3-west);\n\\draw [connection]  (ucr3a-east) -- node {\\midarrow} (up2-west);\n\\draw [connection]  (ucr2a-east) -- node {\\midarrow} (up1-west);\n\\draw [connection]  (ucr1a-east) -- node {\\midarrow} (out-west);\n%\\draw [connection]  (out-east)   -- node {\\midarrow} ++(2,0,0);\n\n\\path (cr4-southeast) -- (cr4-northeast) coordinate[pos=1.25] (cr4-top) ;\n\\path (cr3-southeast) -- (cr3-northeast) coordinate[pos=1.25] (cr3-top) ;\n\\path (cr2-southeast) -- (cr2-northeast) coordinate[pos=1.25] (cr2-top) ;\n\\path (cr1-southeast) -- (cr1-northeast) coordinate[pos=1.25] (cr1-top) ;\n\n\\path (cat4-south)  -- (cat4-north)  coordinate[pos=1.25] (cat4-top) ;\n\\path (cat3-south)  -- (cat3-north)  coordinate[pos=1.25] (cat3-top) ;\n\\path (cat2-south)  -- (cat2-north)  coordinate[pos=1.25] (cat2-top)  ;\n\\path (cat1-south)  -- (cat1-north)  coordinate[pos=1.25] (cat1-top)  ;\n%\n\\draw [copyconnection]  (cr4-northeast)  \n-- node {\\copymidarrow}(cr4-top)\n-- node {\\copymidarrow}(cat4-top)\n-- node {\\copymidarrow} (cat4-north);\n%\n\\draw [copyconnection]  (cr3-northeast)  \n-- node {\\copymidarrow}(cr3-top)\n-- node {\\copymidarrow}(cat3-top)\n-- node {\\copymidarrow} (cat3-north);\n%\n\\draw [copyconnection]  (cr2-northeast)  \n-- node {\\copymidarrow}(cr2-top)\n-- node {\\copymidarrow}(cat2-top)\n-- node {\\copymidarrow} (cat2-north);\n%\n\\draw [copyconnection]  (cr1-northeast)  \n-- node {\\copymidarrow}(cr1-top)\n-- node {\\copymidarrow}(cat1-top)\n-- node {\\copymidarrow} (cat1-north);\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\end{tikzpicture}\n\\end{document}\n"
  },
  {
    "path": "examples/Unet_Ushape/Unet_ushape.tex",
    "content": "\\documentclass[border=8pt, multi, tikz]{standalone}\n%\\usepackage{blocks}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\UnpoolColor{rgb:blue,2;green,1;black,0.3}\n\\def\\ConcatColor{rgb:blue,5;red,2.5;white,5}\n\\def\\FcReluColor{rgb:blue,5;red,5;white,4}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}\n\n\n\\newcommand{\\copymidarrow}{\\tikz \\draw[-Stealth,line width =0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n\\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Encoder\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% conv1_1,conv1_2\n\\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,%\n        xlabel={{\"64\",\"64\"}},caption=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2,2},depth=40}};\n%pool1\n\\pic[shift={(1.2,-10,0)}] at (cr1-east) {Box={name=p1,%\n        fill=\\PoolColor,opacity=0.6,height=32,width=1,depth=32}};\n%%%%%%%%%%\n% conv2_1,conv2_2\n\\pic[shift={(0,0,0)}] at (p1-east) {RightBandedBox={name=cr2,%\n        xlabel={{\"128\",\"128\"}},caption=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=32,width={3.5,3.5},depth=32}};\n%pool2\n\\pic[shift={(1.2,-8.5,0)}] at (cr2-east) {Box={name=p2,%\n        fill=\\PoolColor,opacity=0.6,height=25,width=1,depth=25}};\n%%%%%%%%%%\n% conv3_1,conv3_2\n\\pic[shift={(0,0,0)}] at (p2-east) {RightBandedBox={name=cr3,%\n        xlabel={{\"256\",\"256\"}},caption=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=25,width={4.5,4.5},depth=25}};\n%pool3\n\\pic[shift={(1.2,-6.5,0)}] at (cr3-east) {Box={name=p3,%\n        fill=\\PoolColor,opacity=0.6,height=16,width=1,depth=16}};\n%%%%%%%%%%\n% conv4_1,conv4_2,conv4_3\n\\pic[shift={(0,0,0)}] at (p3-east) {RightBandedBox={name=cr4,%\n        xlabel={{\"512\",\"512\"}},caption=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=16,width={6,6},depth=16}};\n%pool4\n\\pic[shift={(1.2,-3,0)}] at (cr4-east) {Box={name=p4,%\n        fill=\\PoolColor,opacity=0.6,height=8,width=1,depth=8}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Bottleneck\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% conv5_1,conv5_2,conv5_3\n\\pic[shift={(0,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=I/16,%\n        xlabel={{\"1024\",\"1024\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=8,width={8,8},depth=8}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Decoder \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% unpool4, \n\\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=up4,%\n        fill=\\UnpoolColor,opacity=0.6,height=16,width=1,depth=16}};\n\\pic[shift={(0,0,0)}] at (up4-east) {RightBandedBox={name=ucr4,%\n        xlabel={{\"512\",\"dummy\"}},caption=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=16,width=6,depth=16}};\n\\pic[shift={(0,3,0)}] at (ucr4-anchor) {Ball={name=cat4,fill=\\ConcatColor,radius=2.5,logo=$||$}};    \n\\pic[shift={(1.4,0,0)}] at (cat4-east) {RightBandedBox={name=ucr4a,%\n        xlabel={{\"512\",\"512\"}},caption=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=16,width={6,6},depth=16}};\n%%%%%%%%%%\n%% unpool3, \n\\pic[shift={(0,0,0)}] at (ucr4a-east) {Box={name=up3,%\n        fill=\\UnpoolColor,opacity=0.6,height=25,width=1,depth=25}};\n\\pic[shift={(0,0,0)}] at (up3-east) {RightBandedBox={name=ucr3,%\n        xlabel={{\"256\",\"dummy\"}},caption=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=25,width=4.5,depth=25}};\n\\pic[shift={(0,6.5,0)}] at (ucr3-anchor) {Ball={name=cat3,fill=\\ConcatColor,radius=2.5,logo=$||$}};\n\\pic[shift={(1.5,0,0)}] at (cat3-east) {RightBandedBox={name=ucr3a,%\n        xlabel={{\"256\",\"256\"}},caption=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=25,width={4.5,4.5},depth=25}};\n%%%%%%%%%%\n%% unpool2, \n\\pic[shift={(0,0,0)}] at (ucr3a-east) {Box={name=up2,%\n        fill=\\UnpoolColor,opacity=0.6,height=32,width=1,depth=32}};\n\\pic[shift={(0,0,0)}] at (up2-east) {RightBandedBox={name=ucr2,%\n        xlabel={{\"128\",\"dummy\"}},caption=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=32,width=3.5,depth=32}};\n\\pic[shift={(0,8.5,0)}] at (ucr2-anchor) {Ball={name=cat2,fill=\\ConcatColor,radius=2.5,logo=$||$}};\n\\pic[shift={(1.8,0,0)}] at (cat2-east) {RightBandedBox={name=ucr2a,%\n        xlabel={{\"128\",\"128\"}},caption=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=32,width={3.5,3.5},depth=32}};\n%%%%%%%%%%\n%% unpool1, \n\\pic[shift={(0,0,0)}] at (ucr2a-east) {Box={name=up1,%\n        fill=\\UnpoolColor,opacity=0.6,height=40,width=1,depth=40}};\n\\pic[shift={(0,0,0)}] at (up1-east) {RightBandedBox={name=ucr1,%\n        xlabel={{\"64\",\"dummy\"}},caption=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width=2.5,depth=40}};\n\\pic[shift={(0,10,0)}] at (ucr1-anchor) {Ball={name=cat1,fill=\\ConcatColor,radius=2.5,logo=$||$}};\n\\pic[shift={(2,0,0)}] at (cat1-east) {RightBandedBox={name=ucr1a,%\n        xlabel={{\"64\",\"64\"}},caption=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2.5,2.5},depth=40}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Classifier \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\pic[shift={(2,0,0)}] at (ucr1a-east) {Box={name=out,caption=Softmax,%\n        zlabel=I,fill=\\SoftmaxColor,height=40,width=1,depth=40}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% Draw connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\path (cr1-east) -- (p1-west|-cr1-west) coordinate[pos=0.5] (crp1-mid) ;\n\\path (cr2-east) -- (p2-west|-cr2-west) coordinate[pos=0.5] (crp2-mid) ;\n\\path (cr3-east) -- (p3-west|-cr3-west) coordinate[pos=0.5] (crp3-mid) ;\n\\path (cr4-east) -- (p4-west|-cr4-west) coordinate[pos=0.5] (crp4-mid) ;\n\n\\draw[connection](cr1-east)--node{\\midarrow}(crp1-mid)--node{\\midarrow}(p1-west-|crp1-mid)--node{\\midarrow}(p1-west);\n\\draw[connection](cr2-east)--node{\\midarrow}(crp2-mid)--node{\\midarrow}(p2-west-|crp2-mid)--node{\\midarrow}(p2-west);\n\\draw[connection](cr3-east)--node{\\midarrow}(crp3-mid)--node{\\midarrow}(p3-west-|crp3-mid)--node{\\midarrow}(p3-west);\n\\draw[connection](cr4-east)--node{\\midarrow}(crp4-mid)--node{\\midarrow}(p4-west-|crp4-mid)--node{\\midarrow}(p4-west);\n\n%\\draw [connection]  (cr5-east)   -- node {\\midarrow} (up4-west);\n%\\draw [connection]  (ucr4a-east) -- node {\\midarrow} (up3-west);\n%\\draw [connection]  (ucr3a-east) -- node {\\midarrow} (up2-west);\n%\\draw [connection]  (ucr2a-east) -- node {\\midarrow} (up1-west);\n\\draw [connection]  (ucr1a-east) -- node {\\midarrow} (out-west);\n%\\draw [connection]  (out-east)   -- node {\\midarrow} ++(2,0,0);\n\n\\draw [copyconnection]  (cr4-east)  -- node {\\copymidarrow} (cat4-west);\n\\draw [copyconnection]  (cr3-east)  -- node {\\copymidarrow} (cat3-west);\n\\draw [copyconnection]  (cr2-east)  -- node {\\copymidarrow} (cat2-west);\n\\draw [copyconnection]  (cr1-east)  -- node {\\copymidarrow} (cat1-west);\n\n\\draw [copyconnection]  (cat4-east)  -- node {\\copymidarrow} (ucr4a-west);\n\\draw [copyconnection]  (cat3-east)  -- node {\\copymidarrow} (ucr3a-west);\n\\draw [copyconnection]  (cat2-east)  -- node {\\copymidarrow} (ucr2a-west);\n\\draw [copyconnection]  (cat1-east)  -- node {\\copymidarrow} (ucr1a-west);\n\n\\draw [copyconnection]  (ucr4-north)  -- node {\\copymidarrow} (cat4-south);\n\\draw [copyconnection]  (ucr3-north)  -- node {\\copymidarrow} (cat3-south);\n\\draw [copyconnection]  (ucr2-north)  -- node {\\copymidarrow} (cat2-south);\n\\draw [copyconnection]  (ucr1-north)  -- node {\\copymidarrow} (cat1-south);\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\end{tikzpicture}\n\\end{document}\n"
  },
  {
    "path": "examples/VGG16/vgg16.tex",
    "content": "\\documentclass[border=15pt, multi, tikz]{standalone}\n%\\usepackage{blocks}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\FcColor{rgb:blue,5;red,2.5;white,5}\n\\def\\FcReluColor{rgb:blue,5;red,5;white,4}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Layer Blocks\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% conv1_1,conv1_2\n\\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,caption=conv1,%\n        xlabel={{\"64\",\"64\"}},ylabel=224,zlabel=224,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2,2},depth=40}};\n%pool1\n\\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%\n        fill=\\PoolColor,opacity=0.5,height=35,width=1,depth=35}};\n%%%%%%%%%%\n% conv2_1,conv2_2\n\\pic[shift={(2,0,0)}] at (p1-east) {RightBandedBox={name=cr2,caption=conv2,%\n        xlabel={{\"128\",\"128\"}},zlabel=112,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=35,width={3,3},depth=35}};\n%pool2\n\\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%\n        fill=\\PoolColor,opacity=0.5,height=30,width=1,depth=30}};\n%%%%%%%%%%\n% conv3_1,conv3_2\n\\pic[shift={(2,0,0)}] at (p2-east) {RightBandedBox={name=cr3,caption=conv3,%\n        xlabel={{\"256\",\"256\",\"256\"}},zlabel=56,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=30,width={4,4,4},depth=30}};\n%pool3\n\\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%\n        fill=\\PoolColor,opacity=0.5,height=23,width=1,depth=23}};\n%%%%%%%%%%\n% conv4_1,conv4_2,conv4_3\n\\pic[shift={(1.8,0,0)}] at (p3-east) {RightBandedBox={name=cr4,caption=conv4,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=28,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=23,width={7,7,7},depth=23}};\n%pool4\n\\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%\n        fill=\\PoolColor,opacity=0.5,height=15,width=1,depth=15}};\n%%%%%%%%%%\n% conv5_1,conv5_2,conv5_3\n\\pic[shift={(1.5,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=conv5,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=14,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=15,width={7,7,7},depth=15}};\n%pool5\n\\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=p5,%\n        fill=\\PoolColor,opacity=0.5,height=10,width=1,depth=10}};\n%%%%%%%%%%\n% fc6\n\\pic[shift={(3,0,0)}] at (p5-east) {RightBandedBox={name=fc6,caption=fc6,%\n        xlabel={{\"1\",\"\"}},zlabel=4096,fill=\\FcColor,bandfill=\\FcReluColor,%\n        height=3,width=3,depth=100}};\n%%%%%%%%%%\n% fc7\n\\pic[shift={(2,0,0)}] at (fc6-east) {RightBandedBox={name=fc7,caption=fc7,%\n        xlabel={{\"1\",\"dummy\"}},zlabel=4096,fill=\\FcColor,bandfill=\\FcReluColor,%\n        height=3,width=3,depth=100}};\n%%%%%%%%%%\n% fc8\n\\pic[shift={(1.5,0,0)}] at (fc7-east) {RightBandedBox={name=fc8,caption=fc8+softmax,%\n        xlabel={{\"1\",\"dummy\"}},fill=\\FcColor,bandfill=\\FcReluColor,%\n        height=3,width=3,depth=25}};\n\n%%%%%%%%%%\n% softmax\n\\pic[shift={(0,0,0)}] at (fc8-east) {Box={name=softmax,%\n        xlabel={{\"\",\"dummy\"}},zlabel=K,opacity=0.8,fill=\\SoftmaxColor,%\n        height=3,width=1.5,depth=25}};\n    \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Arrow Connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (p1-east)        -- node {\\midarrow} (cr2-west);\n\\draw [connection]  (p2-east)        -- node {\\midarrow} (cr3-west);\n\\draw [connection]  (p3-east)        -- node {\\midarrow} (cr4-west);\n\\draw [connection]  (p4-east)        -- node {\\midarrow} (cr5-west);\n\\draw [connection]  (p5-east)        -- node {\\midarrow} (fc6-west);\n\\draw [connection]  (fc6-east)       -- node {\\midarrow} (fc7-west);\n\\draw [connection]  (fc7-east)       -- node {\\midarrow} (fc8-west);\n\\draw [connection]  (softmax-east)   -- node {\\midarrow} ++(1.5,0,0);\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Dotted Edges \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw[densely dashed]\n    (fc6-west)++(0, 1.5*.2, 1.5*.2) coordinate(a) -- (p5-nearnortheast)\n    (fc6-west)++(0,-1.5*.2, 1.5*.2) coordinate(b) -- (p5-nearsoutheast)\n    (fc6-west)++(0,-1.5*.2,-1.5*.2) coordinate(c) -- (p5-farsoutheast)\n    (fc6-west)++(0, 1.5*.2,-1.5*.2) coordinate(d) -- (p5-farnortheast)\n    \n    (a)--(b)--(c)--(d)\n    ;\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\end{tikzpicture}\n\\end{document}\n"
  },
  {
    "path": "examples/fcn32s/fcn32.tex",
    "content": "\\documentclass[border=15pt, multi, tikz]{standalone}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\DcnvColor{rgb:blue,5;green,2.5;white,5}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}\n\n\\begin{document}\n\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Layer Blocks\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% conv1_1,conv1_2\n\\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,caption=conv1,%\n        xlabel={{\"64\",\"64\"}},zlabel=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2,2},depth=40}};\n%pool1\n\\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%\n        fill=\\PoolColor,opacity=0.5,height=35,width=1,depth=35}};\n%%%%%%%%%%\n% conv2_1,conv2_2\n\\pic[shift={(2,0,0)}] at (p1-east) {RightBandedBox={name=cr2,caption=conv2,%\n        xlabel={{\"64\",\"64\"}},zlabel=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=35,width={3,3},depth=35}};\n%pool2\n\\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%\n        fill=\\PoolColor,opacity=0.5,height=30,width=1,depth=30}};\n%%%%%%%%%%\n% conv3_1,conv3_2\n\\pic[shift={(2,0,0)}] at (p2-east) {RightBandedBox={name=cr3,caption=conv3,%\n        xlabel={{\"256\",\"256\",\"256\"}},zlabel=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=30,width={4,4,4},depth=30}};\n%pool3\n\\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%\n        fill=\\PoolColor,opacity=0.5,height=23,width=1,depth=23}};\n%%%%%%%%%%\n% conv4_1,conv4_2,conv4_3\n\\pic[shift={(1.8,0,0)}] at (p3-east) {RightBandedBox={name=cr4,caption=conv4,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=23,width={7,7,7},depth=23}};\n%pool4\n\\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%\n        fill=\\PoolColor,opacity=0.5,height=15,width=1,depth=15}};\n%%%%%%%%%%\n% conv5_1,conv5_2,conv5_3\n\\pic[shift={(1.5,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=conv5,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=I/16,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=15,width={7,7,7},depth=15}};\n%pool5\n\\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=p5,%\n        fill=\\PoolColor,opacity=0.5,height=10,width=1,depth=10}};\n%%%%%%%%%%     \n%% fc6, fc7 -> cr6, cr7\n\\pic[shift={(1,0,0)}] at (p5-east) {RightBandedBox={name=cr6_7,caption=fc to conv,%\n        xlabel={{\"4096\",\"4096\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=10,width={10,10},depth=10}};\n%%%%%%%%%%   \n%% fc8 -> cr8    \n\n\\pic[shift={(1,0,0)}] at (cr6_7-east) {Box={name=c8,caption=fc8 to conv,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,%\n        height=10,width=2,depth=10,zlabel=I/32}};\n%%%%%%%%%%   \n%% Dcnv32    \n\\pic[shift={(2.5,0,0)}] at (c8-east) {Box={name=d32,caption=Deconv,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\DcnvColor,%\n        height=40,width=2,depth=40}}; \n%%%%%%%%%%   \n%% softmax    \n\\pic[shift={(1,0,0)}] at (d32-east) {Box={name=softmax,caption=softmax,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\SoftmaxColor,%\n        height=40,width=2,depth=40,zlabel=I}};  \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (p1-east)    -- node {\\midarrow} (cr2-west);\n\\draw [connection]  (p2-east)    -- node {\\midarrow} (cr3-west);\n\\draw [connection]  (p3-east)    -- node {\\midarrow} (cr4-west);\n\\draw [connection]  (p4-east)    -- node {\\midarrow} (cr5-west);\n\\draw [connection]  (p5-east)    -- node {\\midarrow} (cr6_7-west);\n\\draw [connection]  (cr6_7-east) -- node {\\midarrow} (c8-west);\n\\draw [connection]  (c8-east)    -- node {\\midarrow} (d32-west);\n\\draw [connection]  (d32-east)   -- node {\\midarrow} (softmax-west);\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Dotted Edges \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw[densely dashed]\n(c8-nearnortheast) -- (d32-nearnorthwest)\n(c8-nearsoutheast) -- (d32-nearsouthwest)\n(c8-farsoutheast)  -- (d32-farsouthwest)\n(c8-farnortheast)  -- (d32-farnorthwest)\n;\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\end{tikzpicture}\n\\end{document}\\grid\n"
  },
  {
    "path": "examples/fcn8s/fcn8.tex",
    "content": "\\documentclass[border=15pt, multi, tikz]{standalone}\n\\usepackage{import}\n\\subimport{../../layers/}{init}\n\\usetikzlibrary{positioning}\n\\usetikzlibrary{3d} %for including external image \n\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\DcnvColor{rgb:blue,5;green,2.5;white,5}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}\n\\def\\SumColor{rgb:blue,5;green,15}\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw Layer Blocks\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\node[canvas is zy plane at x=0] (temp) at (-3,0,0) {\\includegraphics[width=8cm,height=8cm]{cats.jpg}};\n% conv1_1,conv1_2,%pool1\n\\pic[shift={(0,0,0)}] at (0,0,0) {RightBandedBox={name=cr1,caption=conv1,%\n        xlabel={{\"64\",\"64\"}},zlabel=I,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=40,width={2,2},depth=40}};\n\\pic[shift={(0,0,0)}] at (cr1-east) {Box={name=p1,%\n        fill=\\PoolColor,opacity=0.5,height=35,width=1,depth=35}};\n% conv2_1,conv2_2,pool2\n\\pic[shift={(2,0,0)}] at (p1-east) {RightBandedBox={name=cr2,caption=conv2,%\n        xlabel={{\"64\",\"64\"}},zlabel=I/2,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=35,width={3,3},depth=35}};\n\\pic[shift={(0,0,0)}] at (cr2-east) {Box={name=p2,%\n        fill=\\PoolColor,opacity=0.5,height=30,width=1,depth=30}};\n% conv3_1,conv3_2,pool3\n\\pic[shift={(2,0,0)}] at (p2-east) {RightBandedBox={name=cr3,caption=conv3,%\n        xlabel={{\"256\",\"256\",\"256\"}},zlabel=I/4,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=30,width={4,4,4},depth=30}};\n\\pic[shift={(0,0,0)}] at (cr3-east) {Box={name=p3,%\n        fill=\\PoolColor,opacity=0.5,height=23,width=1,depth=23}};\n% conv4_1,conv4_2,conv4_3,pool4\n\\pic[shift={(1.8,0,0)}] at (p3-east) {RightBandedBox={name=cr4,caption=conv4,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=I/8,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=23,width={7,7,7},depth=23}};\n\\pic[shift={(0,0,0)}] at (cr4-east) {Box={name=p4,%\n        fill=\\PoolColor,opacity=0.5,height=15,width=1,depth=15}};\n% conv5_1,conv5_2,conv5_3,pool5\n\\pic[shift={(1.5,0,0)}] at (p4-east) {RightBandedBox={name=cr5,caption=conv5,%\n        xlabel={{\"512\",\"512\",\"512\"}},zlabel=I/16,fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=15,width={7,7,7},depth=15}};\n\\pic[shift={(0,0,0)}] at (cr5-east) {Box={name=p5,%\n        fill=\\PoolColor,opacity=0.5,height=10,width=1,depth=10}};    \n%% fc6, fc7 -> cr6, cr7\n\\pic[shift={(1,0,0)}] at (p5-east) {RightBandedBox={name=cr6_7,caption=fc to conv,%\n        xlabel={{\"4096\",\"4096\"}},fill=\\ConvColor,bandfill=\\ConvReluColor,%\n        height=10,width={10,10},depth=10}};  \n%% fc8 -> cr8 (score32)\n\\pic[shift={(1,0,0)}] at (cr6_7-east) {Box={name=score32,caption=fc8 to conv,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,%\n        height=10,width=2,depth=10,zlabel=I/32}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%Joining with previous streams (fcn-16s)\n%% Upsampling Deconv Layer\n%% Dcnv32    \n\\pic[shift={(1.5,0,0)}] at (score32-east) {Box={name=d32,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\DcnvColor,%\n        height=15,width=2,depth=15,zlabel=I/16}};  \n%% score16\n\\pic[shift={(0,-4,0)}] at (d32-west) {Box={name=score16,%\n            xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,%\n            height=15,width=2,depth=15,zlabel=I/16}};\n%% Elementwise sum between score16 and up32\n\\pic[shift={(1.5,0,0)}] at (d32-east) {Ball={name=elt1,%\n        fill=\\SumColor,opacity=0.6,%\n        radius=2.5,logo=$+$}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%%Joining with previous streams (fcn-8s)\n%% Upsampling Deconv Layer\n%% Dcnv16    \n\\pic[shift={(1.5,0,0)}] at (elt1-east) {Box={name=d16,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\DcnvColor,%\n        height=23,width=2,depth=23,zlabel=I/8}};  \n%% score8\n\\pic[shift={(0,-6,0)}] at (d16-west) {Box={name=score8,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\ConvColor,%\n        height=23,width=2,depth=23,zlabel=I/8}};\n%% Elementwise sum between score16 and up32\n\\pic[shift={(1.5,0,0)}] at (d16-east) {Ball={name=elt2,%\n        fill=\\SumColor,opacity=0.6,%\n        radius=2.5,logo=$+$}};\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    \n%%% Output\n%%%%%%%%%%   \n%% Dcnv8    \n\\pic[shift={(2.5,0,0)}] at (elt2-east) {Box={name=d8,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\DcnvColor,%\n        height=40,width=2,depth=40}}; \n%%%%%%%%%%   \n%% softmax    \n\\pic[shift={(1,0,0)}] at (d8-east) {Box={name=softmax,caption=softmax,%\n        xlabel={{\"K\",\"dummy\"}},fill=\\SoftmaxColor,%\n        height=40,width=2,depth=40,zlabel=I}}; \n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% Draw connections\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\draw [connection]  (p1-east)    -- node {\\midarrow} (cr2-west);\n\\draw [connection]  (p2-east)    -- node {\\midarrow} (cr3-west);\n\\draw [connection]  (p3-east)    -- node {\\midarrow} (cr4-west);\n\\draw [connection]  (p4-east)    -- node {\\midarrow} (cr5-west);\n\\draw [connection]  (p5-east)    -- node {\\midarrow} (cr6_7-west);\n\\draw [connection]  (cr6_7-east)   -- node {\\midarrow} (score32-west);\n\\draw [connection]  (score32-east) -- node {\\midarrow} (d32-west);\n\n\\path (p4-east) -- (cr5-west) coordinate[pos=0.25] (between4_5) ;\n\\draw [connection]  (between4_5)    -- node {\\midarrow} (score16-west-|between4_5) -- node {\\midarrow} (score16-west);\n\\draw [connection]  (d32-east) -- node {\\midarrow} (elt1-west);\n\\draw [connection]  (score16-east) -- node {\\midarrow} (score16-east -| elt1-south) -- node {\\midarrow} (elt1-south);\n\\draw [connection]  (elt1-east) -- node {\\midarrow} (d16-west);\n\n\\path (p3-east) -- (cr4-west) coordinate[pos=0.25] (between3_4) ;\n\\draw [connection]  (between3_4) -- node {\\midarrow} (score8-west-|between3_4) -- node {\\midarrow} (score8-west);\n\\draw [connection]  (d16-east) -- node {\\midarrow} (elt2-west);\n\\draw [connection]  (score8-east) -- node {\\midarrow} (score8-east -| elt2-south)-- node {\\midarrow} (elt2-south);\n\\draw [connection]  (elt2-east) -- node {\\midarrow} (d8-west);\n\\draw [connection] (d8-east) -- node{\\midarrow} (softmax-west);\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n\\end{tikzpicture}\n\\end{document}\\grid\n"
  },
  {
    "path": "layers/Ball.sty",
    "content": "\\ProvidesPackage{Ball}\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n%This Block can draw small Ball\r\n%Elementwise or reduction operations can be drawn with this\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n\r\n\\tikzset{Ball/.pic={\\tikzset{/sphere/.cd,#1}\t \t\r\n\r\n\\pgfmathsetmacro{\\r}{\\radius*\\scale}\r\n\r\n\\shade[ball color=\\fill,opacity=\\opacity] (0,0,0) circle (\\r);\r\n\\draw (0,0,0) circle [radius=\\r] node[scale=4*\\r] {\\logo};\r\n\r\n\\coordinate (\\name-anchor) at ( 0 , 0  , 0) ;\r\n\\coordinate (\\name-east)   at ( \\r, 0  , 0) ;\r\n\\coordinate (\\name-west)   at (-\\r, 0  , 0) ;\r\n\\coordinate (\\name-north)  at ( 0 , \\r , 0) ;\r\n\\coordinate (\\name-south)  at ( 0 , -\\r, 0) ;\r\n\r\n\\path (\\name-south) + (0,-20pt) coordinate (caption-node) \r\nedge [\"\\textcolor{black}{\\bf \\caption}\"'] (caption-node); %Ball caption\r\n\r\n},\r\n/sphere/.search also={/tikz},\r\n/sphere/.cd,\r\nradius/.store       in=\\radius,\r\nscale/.store        in=\\scale,\r\ncaption/.store      in=\\caption,\r\nname/.store         in=\\name,\r\nfill/.store         in=\\fill,\r\nlogo/.store         in=\\logo,\r\nopacity/.store      in=\\opacity,\r\nlogo=$\\Sigma$,\r\nfill=green,\r\nopacity=0.10,\r\nscale=0.2,\r\nradius=0.5,\r\ncaption=,\r\nname=,\r\n}\r\n"
  },
  {
    "path": "layers/Box.sty",
    "content": "\\ProvidesPackage{Box}\r\n\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n% This Block can draw simple block of boxes with custom colors. \r\n% Can be used for conv, deconv etc\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n\\tikzset{Box/.pic={\\tikzset{/boxblock/.cd,#1}\r\n        \\tikzstyle{box}=[every edge/.append style={pic actions, densely dashed, opacity=.7},fill opacity=\\opacity, pic actions,fill=\\fill]\r\n        \r\n        \\pgfmathsetmacro{\\y}{\\cubey*\\scale}\r\n        \\pgfmathsetmacro{\\z}{\\cubez*\\scale}\r\n   \r\n        %Multiple concatenated boxes\r\n        \\foreach[count=\\i,%\r\n                 evaluate=\\i as \\xlabel using {array({\\boxlabels},\\i-1)},% \r\n                 evaluate=\\unscaledx as \\k using {\\unscaledx*\\scale+\\prev}, remember=\\k as \\prev (initially 0)] \r\n                 \\unscaledx in \\cubex\r\n        {\r\n            \\pgfmathsetmacro{\\x}{\\unscaledx*\\scale}\r\n            \\coordinate (a) at (\\k-\\x , \\y/2 , \\z/2); \r\n            \\coordinate (b) at (\\k-\\x ,-\\y/2 , \\z/2); \r\n            \\coordinate (c) at (\\k    ,-\\y/2 , \\z/2); \r\n            \\coordinate (d) at (\\k    , \\y/2 , \\z/2); \r\n            \\coordinate (e) at (\\k    , \\y/2 ,-\\z/2); \r\n            \\coordinate (f) at (\\k    ,-\\y/2 ,-\\z/2); \r\n            \\coordinate (g) at (\\k-\\x ,-\\y/2 ,-\\z/2); \r\n            \\coordinate (h) at (\\k-\\x , \\y/2 ,-\\z/2); \r\n        \r\n            \\draw [box] \r\n                (d) -- (a) -- (b) -- (c) -- cycle     \r\n                (d) -- (a) -- (h) -- (e) -- cycle\r\n                %dotted edges\r\n                (f) edge (g)\r\n                (b) edge (g)\r\n                (h) edge (g)    \r\n            ;\r\n            \\path (b) edge [\"\\xlabel\"',midway] (c);\r\n            \r\n            \\xdef\\LastEastx{\\k} %\\k persists as \\LastEastx after loop \r\n        }%Loop ends\r\n        \\draw [box] (d) -- (e) -- (f) -- (c) -- cycle; %East face of last box     \r\n        \r\n        \\coordinate (a1) at (0 , \\y/2 , \\z/2);\r\n        \\coordinate (b1) at (0 ,-\\y/2 , \\z/2);\r\n        \\tikzstyle{depthlabel}=[pos=0,text width=14*\\z,text centered,sloped]       \r\n        \r\n        \\path (c) edge [\"\\small\\zlabel\"',depthlabel](f); %depth label\r\n        \\path (b1) edge [\"\\ylabel\",midway] (a1);  %height label\r\n        \r\n        \r\n        \\tikzstyle{captionlabel}=[text width=15*\\LastEastx/\\scale,text centered]       \r\n        \\path (\\LastEastx/2,-\\y/2,+\\z/2) + (0,-25pt) coordinate (cap) \r\n        edge [\"\\textcolor{black}{ \\bf \\caption}\"',captionlabel](cap) ; %Block caption/pic object label\r\n         \r\n        %Define nodes to be used outside on the pic object\r\n        \\coordinate (\\name-west)   at (0,0,0) ;\r\n        \\coordinate (\\name-east)   at (\\LastEastx, 0,0) ;\r\n        \\coordinate (\\name-north)  at (\\LastEastx/2,\\y/2,0);\r\n        \\coordinate (\\name-south)  at (\\LastEastx/2,-\\y/2,0);       \r\n        \\coordinate (\\name-anchor) at (\\LastEastx/2, 0,0) ;\r\n        \r\n        \\coordinate (\\name-near) at (\\LastEastx/2,0,\\z/2);\r\n        \\coordinate (\\name-far)  at (\\LastEastx/2,0,-\\z/2);       \r\n        \r\n        \\coordinate (\\name-nearwest) at (0,0,\\z/2);\r\n        \\coordinate (\\name-neareast) at (\\LastEastx,0,\\z/2);\r\n        \\coordinate (\\name-farwest)  at (0,0,-\\z/2);\r\n        \\coordinate (\\name-fareast)  at (\\LastEastx,0,-\\z/2);\r\n        \r\n        \\coordinate (\\name-northeast) at (\\name-north-|\\name-east);\r\n        \\coordinate (\\name-northwest) at (\\name-north-|\\name-west);\r\n        \\coordinate (\\name-southeast) at (\\name-south-|\\name-east);\r\n        \\coordinate (\\name-southwest) at (\\name-south-|\\name-west);\r\n        \r\n        \\coordinate (\\name-nearnortheast)  at (\\LastEastx, \\y/2, \\z/2);\r\n        \\coordinate (\\name-farnortheast)   at (\\LastEastx, \\y/2,-\\z/2);\r\n        \\coordinate (\\name-nearsoutheast)  at (\\LastEastx,-\\y/2, \\z/2);\r\n        \\coordinate (\\name-farsoutheast)   at (\\LastEastx,-\\y/2,-\\z/2);\r\n        \r\n        \\coordinate (\\name-nearnorthwest)  at (0, \\y/2, \\z/2);\r\n        \\coordinate (\\name-farnorthwest)   at (0, \\y/2,-\\z/2);\r\n        \\coordinate (\\name-nearsouthwest)  at (0,-\\y/2, \\z/2);\r\n        \\coordinate (\\name-farsouthwest)   at (0,-\\y/2,-\\z/2);\r\n        \r\n    },\r\n    /boxblock/.search also={/tikz},\r\n    /boxblock/.cd,\r\n    width/.store        in=\\cubex,\r\n    height/.store       in=\\cubey,\r\n    depth/.store        in=\\cubez,\r\n    scale/.store        in=\\scale,\r\n    xlabel/.store       in=\\boxlabels,\r\n    ylabel/.store       in=\\ylabel,\r\n    zlabel/.store       in=\\zlabel,\r\n    caption/.store      in=\\caption,\r\n    name/.store         in=\\name,\r\n    fill/.store         in=\\fill,\r\n    opacity/.store      in=\\opacity,\r\n    fill={rgb:red,5;green,5;blue,5;white,15},\r\n    opacity=0.4,\r\n    width=2,\r\n    height=13,\r\n    depth=15,\r\n    scale=.2,\r\n    xlabel={{\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"}},\r\n    ylabel=,\r\n    zlabel=,\r\n    caption=,\r\n    name=,\r\n}\r\n"
  },
  {
    "path": "layers/RightBandedBox.sty",
    "content": "\\ProvidesPackage{RightBandedBox}\r\n\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n% This Block can draw simple block of boxes with custom colors. \r\n% Can be used for conv, deconv etc\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n\\tikzset{RightBandedBox/.pic={\\tikzset{/block/.cd,#1}\r\n                \r\n        \\tikzstyle{box}=[every edge/.append style={pic actions, densely dashed, opacity=.7},fill opacity=\\opacity, pic actions,fill=\\fill]\r\n        \r\n        \\tikzstyle{band}=[every edge/.append style={pic actions, densely dashed, opacity=.7},fill opacity=\\bandopacity, pic actions,fill=\\bandfill,draw=\\bandfill]\r\n        \r\n        \\pgfmathsetmacro{\\y}{\\cubey*\\scale}\r\n        \\pgfmathsetmacro{\\z}{\\cubez*\\scale}\r\n\r\n        %Multiple concatenated boxes\t \t  \t\r\n        \\foreach[count=\\i,%\r\n                 evaluate=\\i as \\xlabel using {array({\\boxlabels},\\i-1)},% \r\n                 evaluate=\\unscaledx as \\k using {\\unscaledx*\\scale+\\prev}, remember=\\k as \\prev (initially 0)] \r\n                 \\unscaledx in \\cubex\r\n        {\r\n            \\pgfmathsetmacro{\\x}{\\unscaledx*\\scale}\r\n            \\coordinate (a)     at (\\k-\\x   , \\y/2 , \\z/2); \r\n            \\coordinate (art)   at (\\k-\\x/3 , \\y/2 , \\z/2); %a_right_third\r\n            \\coordinate (b)     at (\\k-\\x   ,-\\y/2 , \\z/2); \r\n            \\coordinate (brt)   at (\\k-\\x/3 ,-\\y/2 , \\z/2); %b_right_third\r\n            \\coordinate (c)     at (\\k      ,-\\y/2 , \\z/2); \r\n            \\coordinate (d)     at (\\k      , \\y/2 , \\z/2); \r\n            \\coordinate (e)     at (\\k      , \\y/2 ,-\\z/2); \r\n            \\coordinate (f)     at (\\k      ,-\\y/2 ,-\\z/2); \r\n            \\coordinate (g)     at (\\k-\\x   ,-\\y/2 ,-\\z/2); \r\n            \\coordinate (h)     at (\\k-\\x   , \\y/2 ,-\\z/2); \r\n            \\coordinate (hrt)   at (\\k-\\x/3 , \\y/2 ,-\\z/2); %h_right_third\r\n            \r\n            %fill box color \t\t\t\r\n            \\draw [box] \r\n                (d) -- (a) -- (b) -- (c) -- cycle     \r\n                (d) -- (a) -- (h) -- (e) -- cycle;\r\n            %dotted edges\r\n            \\draw [box]\r\n                (f) edge (g)\r\n                (b) edge (g)\r\n                (h) edge (g);\r\n            %fill band color    \r\n            \\draw [band] \r\n                (d) -- (art) -- (brt) -- (c) -- cycle     \r\n                (d) -- (art) -- (hrt) -- (e) -- cycle;\r\n            %draw edges again which were covered by band\r\n            \\draw [box,fill opacity=0] \r\n                (d) -- (a) -- (b) -- (c) -- cycle     \r\n                (d) -- (a) -- (h) -- (e) -- cycle;            \r\n            \t\r\n            \\path (b) edge [\"\\xlabel\"',midway] (c);\r\n            \r\n            \\xdef\\LastEastx{\\k} %\\k persists as \\LastEastx after loop \r\n        }%Loop ends\r\n        \\draw [box] (d) -- (e) -- (f) -- (c) -- cycle; %East face of last box\r\n        \\draw [band] (d) -- (e) -- (f) -- (c) -- cycle; %East face of last box \r\n        \\draw [pic actions] (d) -- (e) -- (f) -- (c) -- cycle; %East face edges of last box     \r\n        \r\n        \\coordinate (a1) at (0 , \\y/2 , \\z/2);\r\n        \\coordinate (b1) at (0 ,-\\y/2 , \\z/2);\r\n        \\tikzstyle{depthlabel}=[pos=0,text width=14*\\z,text centered,sloped]       \r\n        \r\n        \\path (c) edge [\"\\small\\zlabels\"',depthlabel](f); %depth label\r\n        \\path (b1) edge [\"\\ylabel\",midway] (a1);  %height label \t  \r\n        \r\n        \\tikzstyle{captionlabel}=[text width=15*\\LastEastx/\\scale,text centered] \r\n        \\path (\\LastEastx/2,-\\y/2,+\\z/2) + (0,-25pt) coordinate (cap) \r\n        edge [\"\\textcolor{black}{ \\bf \\caption}\"',captionlabel] (cap); %Block caption/pic object label\r\n         \r\n        %Define nodes to be used outside on the pic object\r\n        \\coordinate (\\name-west)   at (0,0,0) ;\r\n        \\coordinate (\\name-east)   at (\\LastEastx, 0,0) ;\r\n        \\coordinate (\\name-north)  at (\\LastEastx/2,\\y/2,0);\r\n        \\coordinate (\\name-south)  at (\\LastEastx/2,-\\y/2,0);       \r\n        \\coordinate (\\name-anchor) at (\\LastEastx/2, 0,0) ;\r\n        \r\n        \\coordinate (\\name-near) at (\\LastEastx/2,0,\\z/2);\r\n        \\coordinate (\\name-far)  at (\\LastEastx/2,0,-\\z/2);       \r\n        \r\n        \\coordinate (\\name-nearwest) at (0,0,\\z/2);\r\n        \\coordinate (\\name-neareast) at (\\LastEastx,0,\\z/2);\r\n        \\coordinate (\\name-farwest)  at (0,0,-\\z/2);\r\n        \\coordinate (\\name-fareast)  at (\\LastEastx,0,-\\z/2);\r\n        \r\n        \\coordinate (\\name-northeast) at (\\name-north-|\\name-east);\r\n        \\coordinate (\\name-northwest) at (\\name-north-|\\name-west);\r\n        \\coordinate (\\name-southeast) at (\\name-south-|\\name-east);\r\n        \\coordinate (\\name-southwest) at (\\name-south-|\\name-west);\r\n        \r\n        \\coordinate (\\name-nearnortheast)  at (\\LastEastx, \\y/2, \\z/2);\r\n        \\coordinate (\\name-farnortheast)   at (\\LastEastx, \\y/2,-\\z/2);\r\n        \\coordinate (\\name-nearsoutheast)  at (\\LastEastx,-\\y/2, \\z/2);\r\n        \\coordinate (\\name-farsoutheast)   at (\\LastEastx,-\\y/2,-\\z/2);\r\n        \r\n        \\coordinate (\\name-nearnorthwest)  at (0, \\y/2, \\z/2);\r\n        \\coordinate (\\name-farnorthwest)   at (0, \\y/2,-\\z/2);\r\n        \\coordinate (\\name-nearsouthwest)  at (0,-\\y/2, \\z/2);\r\n        \\coordinate (\\name-farsouthwest)   at (0,-\\y/2,-\\z/2);\r\n    },\r\n    /block/.search also={/tikz},\r\n    /block/.cd,\r\n    width/.store        in=\\cubex,\r\n    height/.store       in=\\cubey,\r\n    depth/.store        in=\\cubez,\r\n    scale/.store        in=\\scale,\r\n    xlabel/.store       in=\\boxlabels,\r\n    ylabel/.store       in=\\ylabel,\r\n    zlabel/.store       in=\\zlabels,\r\n    caption/.store      in=\\caption,\r\n    name/.store         in=\\name,\r\n    fill/.store         in=\\fill,\r\n    bandfill/.store     in=\\bandfill,\r\n    opacity/.store      in=\\opacity,\r\n    bandopacity/.store  in=\\bandopacity,\r\n    fill={rgb:red,5;green,5;blue,5;white,15},\r\n    bandfill={rgb:red,5;green,5;blue,5;white,5},\r\n    opacity=0.4,\r\n    bandopacity=0.6,\r\n    width=2,\r\n    height=13,\r\n    depth=15,\r\n    scale=.2,\r\n    xlabel={{\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"}},\r\n    ylabel=,\r\n    zlabel=,\r\n    caption=,\r\n    name=,\r\n}\r\n"
  },
  {
    "path": "layers/init.tex",
    "content": "%\\ProvidesPackage{init}\r\n\\usetikzlibrary{quotes,arrows.meta}\r\n\\usetikzlibrary{positioning}\r\n\r\n\\def\\edgecolor{rgb:blue,4;red,1;green,4;black,3}\r\n\\newcommand{\\midarrow}{\\tikz \\draw[-Stealth,line width =0.8mm,draw=\\edgecolor] (-0.3,0) -- ++(0.3,0);}\r\n\r\n\\usepackage{Ball}\r\n\\usepackage{Box}\r\n\\usepackage{RightBandedBox}\r\n\r\n"
  },
  {
    "path": "pycore/__init__.py",
    "content": ""
  },
  {
    "path": "pycore/blocks.py",
    "content": "\nfrom .tikzeng import *\n\n#define new block\ndef block_2ConvPool( name, botton, top, s_filer=256, n_filer=64, offset=\"(1,0,0)\", size=(32,32,3.5), opacity=0.5 ):\n    return [\n    to_ConvConvRelu( \n        name=\"ccr_{}\".format( name ),\n        s_filer=str(s_filer), \n        n_filer=(n_filer,n_filer), \n        offset=offset, \n        to=\"({}-east)\".format( botton ), \n        width=(size[2],size[2]), \n        height=size[0], \n        depth=size[1],   \n        ),    \n    to_Pool(         \n        name=\"{}\".format( top ), \n        offset=\"(0,0,0)\", \n        to=\"(ccr_{}-east)\".format( name ),  \n        width=1,         \n        height=size[0] - int(size[0]/4), \n        depth=size[1] - int(size[0]/4), \n        opacity=opacity, ),\n    to_connection( \n        \"{}\".format( botton ), \n        \"ccr_{}\".format( name )\n        )\n    ]\n\n\ndef block_Unconv( name, botton, top, s_filer=256, n_filer=64, offset=\"(1,0,0)\", size=(32,32,3.5), opacity=0.5 ):\n    return [\n        to_UnPool(  name='unpool_{}'.format(name),    offset=offset,    to=\"({}-east)\".format(botton),         width=1,              height=size[0],       depth=size[1], opacity=opacity ),\n        to_ConvRes( name='ccr_res_{}'.format(name),   offset=\"(0,0,0)\", to=\"(unpool_{}-east)\".format(name),    s_filer=str(s_filer), n_filer=str(n_filer), width=size[2], height=size[0], depth=size[1], opacity=opacity ),       \n        to_Conv(    name='ccr_{}'.format(name),       offset=\"(0,0,0)\", to=\"(ccr_res_{}-east)\".format(name),   s_filer=str(s_filer), n_filer=str(n_filer), width=size[2], height=size[0], depth=size[1] ),\n        to_ConvRes( name='ccr_res_c_{}'.format(name), offset=\"(0,0,0)\", to=\"(ccr_{}-east)\".format(name),       s_filer=str(s_filer), n_filer=str(n_filer), width=size[2], height=size[0], depth=size[1], opacity=opacity ),       \n        to_Conv(    name='{}'.format(top),            offset=\"(0,0,0)\", to=\"(ccr_res_c_{}-east)\".format(name), s_filer=str(s_filer), n_filer=str(n_filer), width=size[2], height=size[0], depth=size[1] ),\n        to_connection( \n            \"{}\".format( botton ), \n            \"unpool_{}\".format( name ) \n            )\n    ]\n\n\n\n\ndef block_Res( num, name, botton, top, s_filer=256, n_filer=64, offset=\"(0,0,0)\", size=(32,32,3.5), opacity=0.5 ):\n    lys = []\n    layers = [ *[ '{}_{}'.format(name,i) for i in range(num-1) ], top]\n    for name in layers:        \n        ly = [ to_Conv( \n            name='{}'.format(name),       \n            offset=offset, \n            to=\"({}-east)\".format( botton ),   \n            s_filer=str(s_filer), \n            n_filer=str(n_filer), \n            width=size[2],\n            height=size[0],\n            depth=size[1]\n            ),\n            to_connection( \n                \"{}\".format( botton  ), \n                \"{}\".format( name ) \n                )\n            ]\n        botton = name\n        lys+=ly\n    \n    lys += [\n        to_skip( of=layers[1], to=layers[-2], pos=1.25),\n    ]\n    return lys\n\n\n"
  },
  {
    "path": "pycore/tikzeng.py",
    "content": "\nimport os\n\ndef to_head( projectpath ):\n    pathlayers = os.path.join( projectpath, 'layers/' ).replace('\\\\', '/')\n    return r\"\"\"\n\\documentclass[border=8pt, multi, tikz]{standalone} \n\\usepackage{import}\n\\subimport{\"\"\"+ pathlayers + r\"\"\"}{init}\n\\usetikzlibrary{positioning}\n\\usetikzlibrary{3d} %for including external image \n\"\"\"\n\ndef to_cor():\n    return r\"\"\"\n\\def\\ConvColor{rgb:yellow,5;red,2.5;white,5}\n\\def\\ConvReluColor{rgb:yellow,5;red,5;white,5}\n\\def\\PoolColor{rgb:red,1;black,0.3}\n\\def\\UnpoolColor{rgb:blue,2;green,1;black,0.3}\n\\def\\FcColor{rgb:blue,5;red,2.5;white,5}\n\\def\\FcReluColor{rgb:blue,5;red,5;white,4}\n\\def\\SoftmaxColor{rgb:magenta,5;black,7}   \n\\def\\SumColor{rgb:blue,5;green,15}\n\"\"\"\n\ndef to_begin():\n    return r\"\"\"\n\\newcommand{\\copymidarrow}{\\tikz \\draw[-Stealth,line width=0.8mm,draw={rgb:blue,4;red,1;green,1;black,3}] (-0.3,0) -- ++(0.3,0);}\n\n\\begin{document}\n\\begin{tikzpicture}\n\\tikzstyle{connection}=[ultra thick,every node/.style={sloped,allow upside down},draw=\\edgecolor,opacity=0.7]\n\\tikzstyle{copyconnection}=[ultra thick,every node/.style={sloped,allow upside down},draw={rgb:blue,4;red,1;green,1;black,3},opacity=0.7]\n\"\"\"\n\n# layers definition\n\ndef to_input( pathfile, to='(-3,0,0)', width=8, height=8, name=\"temp\" ):\n    return r\"\"\"\n\\node[canvas is zy plane at x=0] (\"\"\" + name + \"\"\") at \"\"\"+ to +\"\"\" {\\includegraphics[width=\"\"\"+ str(width)+\"cm\"+\"\"\",height=\"\"\"+ str(height)+\"cm\"+\"\"\"]{\"\"\"+ pathfile +\"\"\"}};\n\"\"\"\n\n# Conv\ndef to_Conv( name, s_filer=256, n_filer=64, offset=\"(0,0,0)\", to=\"(0,0,0)\", width=1, height=40, depth=40, caption=\" \" ):\n    return r\"\"\"\n\\pic[shift={\"\"\"+ offset +\"\"\"}] at \"\"\"+ to +\"\"\" \n    {Box={\n        name=\"\"\" + name +\"\"\",\n        caption=\"\"\"+ caption +r\"\"\",\n        xlabel={{\"\"\"+ str(n_filer) +\"\"\", }},\n        zlabel=\"\"\"+ str(s_filer) +\"\"\",\n        fill=\\ConvColor,\n        height=\"\"\"+ str(height) +\"\"\",\n        width=\"\"\"+ str(width) +\"\"\",\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\n# Conv,Conv,relu\n# Bottleneck\ndef to_ConvConvRelu( name, s_filer=256, n_filer=(64,64), offset=\"(0,0,0)\", to=\"(0,0,0)\", width=(2,2), height=40, depth=40, caption=\" \" ):\n    return r\"\"\"\n\\pic[shift={ \"\"\"+ offset +\"\"\" }] at \"\"\"+ to +\"\"\" \n    {RightBandedBox={\n        name=\"\"\"+ name +\"\"\",\n        caption=\"\"\"+ caption +\"\"\",\n        xlabel={{ \"\"\"+ str(n_filer[0]) +\"\"\", \"\"\"+ str(n_filer[1]) +\"\"\" }},\n        zlabel=\"\"\"+ str(s_filer) +\"\"\",\n        fill=\\ConvColor,\n        bandfill=\\ConvReluColor,\n        height=\"\"\"+ str(height) +\"\"\",\n        width={ \"\"\"+ str(width[0]) +\"\"\" , \"\"\"+ str(width[1]) +\"\"\" },\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\n\n\n# Pool\ndef to_Pool(name, offset=\"(0,0,0)\", to=\"(0,0,0)\", width=1, height=32, depth=32, opacity=0.5, caption=\" \"):\n    return r\"\"\"\n\\pic[shift={ \"\"\"+ offset +\"\"\" }] at \"\"\"+ to +\"\"\" \n    {Box={\n        name=\"\"\"+name+\"\"\",\n        caption=\"\"\"+ caption +r\"\"\",\n        fill=\\PoolColor,\n        opacity=\"\"\"+ str(opacity) +\"\"\",\n        height=\"\"\"+ str(height) +\"\"\",\n        width=\"\"\"+ str(width) +\"\"\",\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\n# unpool4, \ndef to_UnPool(name, offset=\"(0,0,0)\", to=\"(0,0,0)\", width=1, height=32, depth=32, opacity=0.5, caption=\" \"):\n    return r\"\"\"\n\\pic[shift={ \"\"\"+ offset +\"\"\" }] at \"\"\"+ to +\"\"\" \n    {Box={\n        name=\"\"\"+ name +r\"\"\",\n        caption=\"\"\"+ caption +r\"\"\",\n        fill=\\UnpoolColor,\n        opacity=\"\"\"+ str(opacity) +\"\"\",\n        height=\"\"\"+ str(height) +\"\"\",\n        width=\"\"\"+ str(width) +\"\"\",\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\n\n\ndef to_ConvRes( name, s_filer=256, n_filer=64, offset=\"(0,0,0)\", to=\"(0,0,0)\", width=6, height=40, depth=40, opacity=0.2, caption=\" \" ):\n    return r\"\"\"\n\\pic[shift={ \"\"\"+ offset +\"\"\" }] at \"\"\"+ to +\"\"\" \n    {RightBandedBox={\n        name=\"\"\"+ name + \"\"\",\n        caption=\"\"\"+ caption + \"\"\",\n        xlabel={{ \"\"\"+ str(n_filer) + \"\"\", }},\n        zlabel=\"\"\"+ str(s_filer) +r\"\"\",\n        fill={rgb:white,1;black,3},\n        bandfill={rgb:white,1;black,2},\n        opacity=\"\"\"+ str(opacity) +\"\"\",\n        height=\"\"\"+ str(height) +\"\"\",\n        width=\"\"\"+ str(width) +\"\"\",\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\n\n# ConvSoftMax\ndef to_ConvSoftMax( name, s_filer=40, offset=\"(0,0,0)\", to=\"(0,0,0)\", width=1, height=40, depth=40, caption=\" \" ):\n    return r\"\"\"\n\\pic[shift={\"\"\"+ offset +\"\"\"}] at \"\"\"+ to +\"\"\" \n    {Box={\n        name=\"\"\" + name +\"\"\",\n        caption=\"\"\"+ caption +\"\"\",\n        zlabel=\"\"\"+ str(s_filer) +\"\"\",\n        fill=\\SoftmaxColor,\n        height=\"\"\"+ str(height) +\"\"\",\n        width=\"\"\"+ str(width) +\"\"\",\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\n# SoftMax\ndef to_SoftMax( name, s_filer=10, offset=\"(0,0,0)\", to=\"(0,0,0)\", width=1.5, height=3, depth=25, opacity=0.8, caption=\" \" ):\n    return r\"\"\"\n\\pic[shift={\"\"\"+ offset +\"\"\"}] at \"\"\"+ to +\"\"\" \n    {Box={\n        name=\"\"\" + name +\"\"\",\n        caption=\"\"\"+ caption +\"\"\",\n        xlabel={{\" \",\"dummy\"}},\n        zlabel=\"\"\"+ str(s_filer) +\"\"\",\n        fill=\\SoftmaxColor,\n        opacity=\"\"\"+ str(opacity) +\"\"\",\n        height=\"\"\"+ str(height) +\"\"\",\n        width=\"\"\"+ str(width) +\"\"\",\n        depth=\"\"\"+ str(depth) +\"\"\"\n        }\n    };\n\"\"\"\n\ndef to_Sum( name, offset=\"(0,0,0)\", to=\"(0,0,0)\", radius=2.5, opacity=0.6):\n    return r\"\"\"\n\\pic[shift={\"\"\"+ offset +\"\"\"}] at \"\"\"+ to +\"\"\" \n    {Ball={\n        name=\"\"\" + name +\"\"\",\n        fill=\\SumColor,\n        opacity=\"\"\"+ str(opacity) +\"\"\",\n        radius=\"\"\"+ str(radius) +\"\"\",\n        logo=$+$\n        }\n    };\n\"\"\"\n\n\ndef to_connection( of, to):\n    return r\"\"\"\n\\draw [connection]  (\"\"\"+of+\"\"\"-east)    -- node {\\midarrow} (\"\"\"+to+\"\"\"-west);\n\"\"\"\n\ndef to_skip( of, to, pos=1.25):\n    return r\"\"\"\n\\path (\"\"\"+ of +\"\"\"-southeast) -- (\"\"\"+ of +\"\"\"-northeast) coordinate[pos=\"\"\"+ str(pos) +\"\"\"] (\"\"\"+ of +\"\"\"-top) ;\n\\path (\"\"\"+ to +\"\"\"-south)  -- (\"\"\"+ to +\"\"\"-north)  coordinate[pos=\"\"\"+ str(pos) +\"\"\"] (\"\"\"+ to +\"\"\"-top) ;\n\\draw [copyconnection]  (\"\"\"+of+\"\"\"-northeast)  \n-- node {\\copymidarrow}(\"\"\"+of+\"\"\"-top)\n-- node {\\copymidarrow}(\"\"\"+to+\"\"\"-top)\n-- node {\\copymidarrow} (\"\"\"+to+\"\"\"-north);\n\"\"\"\n\ndef to_end():\n    return r\"\"\"\n\\end{tikzpicture}\n\\end{document}\n\"\"\"\n\n\ndef to_generate( arch, pathname=\"file.tex\" ):\n    with open(pathname, \"w\") as f: \n        for c in arch:\n            print(c)\n            f.write( c )\n     \n\n\n"
  },
  {
    "path": "pyexamples/test_simple.py",
    "content": "\nimport sys\nsys.path.append('../')\nfrom pycore.tikzeng import *\n\n# defined your arch\narch = [\n    to_head( '..' ),\n    to_cor(),\n    to_begin(),\n    to_Conv(\"conv1\", 512, 64, offset=\"(0,0,0)\", to=\"(0,0,0)\", height=64, depth=64, width=2 ),\n    to_Pool(\"pool1\", offset=\"(0,0,0)\", to=\"(conv1-east)\"),\n    to_Conv(\"conv2\", 128, 64, offset=\"(1,0,0)\", to=\"(pool1-east)\", height=32, depth=32, width=2 ),\n    to_connection( \"pool1\", \"conv2\"), \n    to_Pool(\"pool2\", offset=\"(0,0,0)\", to=\"(conv2-east)\", height=28, depth=28, width=1),\n    to_SoftMax(\"soft1\", 10 ,\"(3,0,0)\", \"(pool1-east)\", caption=\"SOFT\"  ),\n    to_connection(\"pool2\", \"soft1\"),    \n    to_Sum(\"sum1\", offset=\"(1.5,0,0)\", to=\"(soft1-east)\", radius=2.5, opacity=0.6),\n    to_connection(\"soft1\", \"sum1\"),\n    to_end()\n    ]\n\ndef main():\n    namefile = str(sys.argv[0]).split('.')[0]\n    to_generate(arch, namefile + '.tex' )\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "pyexamples/unet.py",
    "content": "\nimport sys\nsys.path.append('../')\nfrom pycore.tikzeng import *\nfrom pycore.blocks  import *\n\narch = [ \n    to_head('..'), \n    to_cor(),\n    to_begin(),\n    \n    #input\n    to_input( '../examples/fcn8s/cats.jpg' ),\n\n    #block-001\n    to_ConvConvRelu( name='ccr_b1', s_filer=500, n_filer=(64,64), offset=\"(0,0,0)\", to=\"(0,0,0)\", width=(2,2), height=40, depth=40  ),\n    to_Pool(name=\"pool_b1\", offset=\"(0,0,0)\", to=\"(ccr_b1-east)\", width=1, height=32, depth=32, opacity=0.5),\n    \n    *block_2ConvPool( name='b2', botton='pool_b1', top='pool_b2', s_filer=256, n_filer=128, offset=\"(1,0,0)\", size=(32,32,3.5), opacity=0.5 ),\n    *block_2ConvPool( name='b3', botton='pool_b2', top='pool_b3', s_filer=128, n_filer=256, offset=\"(1,0,0)\", size=(25,25,4.5), opacity=0.5 ),\n    *block_2ConvPool( name='b4', botton='pool_b3', top='pool_b4', s_filer=64,  n_filer=512, offset=\"(1,0,0)\", size=(16,16,5.5), opacity=0.5 ),\n\n    #Bottleneck\n    #block-005\n    to_ConvConvRelu( name='ccr_b5', s_filer=32, n_filer=(1024,1024), offset=\"(2,0,0)\", to=\"(pool_b4-east)\", width=(8,8), height=8, depth=8, caption=\"Bottleneck\"  ),\n    to_connection( \"pool_b4\", \"ccr_b5\"),\n\n    #Decoder\n    *block_Unconv( name=\"b6\", botton=\"ccr_b5\", top='end_b6', s_filer=64,  n_filer=512, offset=\"(2.1,0,0)\", size=(16,16,5.0), opacity=0.5 ),\n    to_skip( of='ccr_b4', to='ccr_res_b6', pos=1.25),\n    *block_Unconv( name=\"b7\", botton=\"end_b6\", top='end_b7', s_filer=128, n_filer=256, offset=\"(2.1,0,0)\", size=(25,25,4.5), opacity=0.5 ),\n    to_skip( of='ccr_b3', to='ccr_res_b7', pos=1.25),    \n    *block_Unconv( name=\"b8\", botton=\"end_b7\", top='end_b8', s_filer=256, n_filer=128, offset=\"(2.1,0,0)\", size=(32,32,3.5), opacity=0.5 ),\n    to_skip( of='ccr_b2', to='ccr_res_b8', pos=1.25),    \n    \n    *block_Unconv( name=\"b9\", botton=\"end_b8\", top='end_b9', s_filer=512, n_filer=64,  offset=\"(2.1,0,0)\", size=(40,40,2.5), opacity=0.5 ),\n    to_skip( of='ccr_b1', to='ccr_res_b9', pos=1.25),\n    \n    to_ConvSoftMax( name=\"soft1\", s_filer=512, offset=\"(0.75,0,0)\", to=\"(end_b9-east)\", width=1, height=40, depth=40, caption=\"SOFT\" ),\n    to_connection( \"end_b9\", \"soft1\"),\n     \n    to_end() \n    ]\n\n\ndef main():\n    namefile = str(sys.argv[0]).split('.')[0]\n    to_generate(arch, namefile + '.tex' )\n\nif __name__ == '__main__':\n    main()\n    \n"
  },
  {
    "path": "tikzmake.sh",
    "content": "#!/bin/bash\n\n\npython $1.py \npdflatex $1.tex\n\nrm *.aux *.log *.vscodeLog\nrm *.tex\n\nif [[ \"$OSTYPE\" == \"darwin\"* ]]; then\n    open $1.pdf\nelse\n    xdg-open $1.pdf\nfi\n"
  }
]