# PlotNeuralNet
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2526396.svg)](https://doi.org/10.5281/zenodo.2526396)
Latex 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.
## Examples
Following are some network representations:
<p align="center"><img src="https://user-images.githubusercontent.com/17570785/50308846-c2231880-049c-11e9-8763-3daa1024de78.png" width="85%" height="85%"></p>
<h6 align="center">FCN-8 (<a href="https://www.overleaf.com/read/kkqntfxnvbsk">view on Overleaf</a>)</h6>
<p align="center"><img src="https://user-images.githubusercontent.com/17570785/50308873-e2eb6e00-049c-11e9-9587-9da6bdec011b.png" width="85%" height="85%"></p>
<h6 align="center">FCN-32 (<a href="https://www.overleaf.com/read/wsxpmkqvjnbs">view on Overleaf</a>)</h6>
<p align="center"><img src="https://user-images.githubusercontent.com/17570785/50308911-03b3c380-049d-11e9-92d9-ce15669017ad.png" width="85%" height="85%"></p>
<h6 align="center">Holistically-Nested Edge Detection (<a href="https://www.overleaf.com/read/jxhnkcnwhfxp">view on Overleaf</a>)</h6>
## Getting Started
1. Install the following packages on Ubuntu.
* Ubuntu 16.04
```
sudo apt-get install texlive-latex-extra
```
* Ubuntu 18.04.2
Base on this [website](https://gist.github.com/rain1024/98dd5e2c6c8c28f9ea9d), please install the following packages.
```
sudo apt-get install texlive-latex-base
sudo apt-get install texlive-fonts-recommended
sudo apt-get install texlive-fonts-extra
sudo apt-get install texlive-latex-extra
```
* Windows
1. Download and install [MikTeX](https://miktex.org/download).
2. Download and install bash runner on Windows, recommends [Git bash](https://git-scm.com/download/win) or Cygwin(https://www.cygwin.com/)
2. Execute the example as followed.
```
cd pyexamples/
bash ../tikzmake.sh test_simple
```
## TODO
- [X] Python interface
- [ ] Add easy legend functionality
- [ ] Add more layer shapes like TruncatedPyramid, 2DSheet etc
- [ ] Add examples for RNN and likes.
## Latex usage
See [`examples`](examples) directory for usage.
## Python usage
First, create a new directory and a new Python file:
$ mkdir my_project
$ cd my_project
vim my_arch.py
Add the following code to your new file:
```python
import sys
sys.path.append('../')
from pycore.tikzeng import *
# defined your arch
arch = [
to_head( '..' ),
to_cor(),
to_begin(),
to_Conv("conv1", 512, 64, offset="(0,0,0)", to="(0,0,0)", height=64, depth=64, width=2 ),
to_Pool("pool1", offset="(0,0,0)", to="(conv1-east)"),
to_Conv("conv2", 128, 64, offset="(1,0,0)", to="(pool1-east)", height=32, depth=32, width=2 ),
to_connection( "pool1", "conv2"),
to_Pool("pool2", offset="(0,0,0)", to="(conv2-east)", height=28, depth=28, width=1),
to_SoftMax("soft1", 10 ,"(3,0,0)", "(pool1-east)", caption="SOFT" ),
to_connection("pool2", "soft1"),
to_end()
]
def main():
namefile = str(sys.argv[0]).split('.')[0]
to_generate(arch, namefile + '.tex' )
if __name__ == '__main__':
main()
```
Now, run the program as follows:
bash ../tikzmake.sh my_arch
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
csdn_PlotNeuralNet.zip (91个子文件)
csdn_PlotNeuralNet
.DS_Store 6KB
shots_4.jpg 21KB
readme_qhy.md 575B
layers
init.tex 318B
Box.sty 5KB
RightBandedBox.sty 6KB
Ball.sty 1KB
shots_2.jpg 21KB
LICENSE 1KB
examples
fcn8s
fcn8.tex 6KB
fcn8.pdf 99KB
cats.jpg 61KB
HED
HED.tex 7KB
HED.pdf 37KB
.DS_Store 8KB
fcn32s
fcn32.tex 4KB
fcn32.pdf 36KB
VGG16
vgg16.pdf 37KB
vgg16.tex 5KB
Unet
Unet.tex 8KB
Unet.pdf 38KB
AlexNet
alexnet.pdf 31KB
alexnet.tex 4KB
alexnet_data.png 28KB
SoftmaxLoss
SoftmaxLoss.tex 2KB
SoftmaxLoss.pdf 60KB
LeNet
lenet.pdf 28KB
lenet.txt 135B
lenet_data2.png 28KB
lenet.tex 3KB
Unet_Ushape
Unet_ushape.tex 8KB
Unet_ushape.pdf 44KB
.git
.DS_Store 6KB
index 4KB
HEAD 23B
refs
heads
master 41B
tags
remotes
origin
HEAD 32B
objects
.DS_Store 6KB
pack
pack-e773ae2de573ac45eb5007af387958a89c5da41e.idx 9KB
pack-e773ae2de573ac45eb5007af387958a89c5da41e.pack 2.28MB
info
description 73B
packed-refs 228B
info
exclude 240B
logs
HEAD 207B
refs
heads
master 207B
remotes
origin
HEAD 207B
hooks
post-update.sample 189B
prepare-commit-msg.sample 1KB
commit-msg.sample 896B
pre-receive.sample 544B
update.sample 4KB
pre-commit.sample 2KB
pre-rebase.sample 5KB
applypatch-msg.sample 478B
fsmonitor-watchman.sample 5KB
pre-applypatch.sample 424B
pre-push.sample 1KB
pre-merge-commit.sample 416B
config 274B
branches
joint2.jpg 34KB
.idea
vcs.xml 180B
workspace.xml 7KB
plotneuralnet.iml 459B
misc.xml 209B
modules.xml 278B
joint3.jpg 86KB
joint3_1336.jpg 100KB
shots_3.jpg 21KB
pycore
__init__.py 0B
tikzeng.pyc 7KB
tikzeng.py 6KB
blocks.py 3KB
__init__.pyc 106B
__pycache__
tikzeng.cpython-39.pyc 7KB
blocks.cpython-310.pyc 2KB
__init__.cpython-39.pyc 174B
__init__.cpython-310.pyc 176B
blocks.cpython-39.pyc 2KB
tikzeng.cpython-310.pyc 7KB
joint.jpg 55KB
pyexamples
test_simple.pdf 28KB
.DS_Store 6KB
test_simple.py 919B
unet.pdf 98KB
unet.py 2KB
VGG16.py 3KB
shots_1.jpg 21KB
.gitignore 983B
velocity.jpg 51KB
README.md 3KB
tikzmake.sh 164B
共 91 条
- 1
资源评论
炭市街潜水豆浆
- 粉丝: 721
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功