yuml/python > Deep learning용 네트워크 그리기 > v0.1-v0.5: N층+dropout까지
Ubuntu 14.04 LTS desktop amd64
Python 2.7.6
Deep Learning의 넷을 설명할 때 그리기를 하는 것이 귀찮습니다.
코드로 쉽게 만들 수 없을까.
yUML 형식으로 사용해 보세요.
참고 ぃ tp // 이 m / 츠키요 3 / ms / 840b52027 03d270b0
v0.1: 1층만
draw.py
print ":
print "[a]-->[" + elem + "],",
print ")"
python draw.py
의 출력 결과는 다음과 같습니다.
상기의 텍스트를 Qiita에 그대로 붙이면 이하가 된다.
10층이나 만들 수 있을까. 렌더링이 무거워질 수 있습니다. v0.2: 2층만 draw.py print # for empty line print ": for inner in ('b','c','d','e'): print "[" + outer + "]-->[" + inner + "],", print ")" print # for empty line  Fully connected network 전용. v0.3: 3층만 층을 늘리는 것은 귀찮습니다. draw.py print # for empty line hidden1=('x','y','z') hidden2=('a','b','c','d') hidden3=('l','m','n','o') print "" print # for empty line  v0.4: N 레이어 draw.py print # for empty line hidden=[ ( 'x', 'y', 'z'), ('a','b','c','d'), ('e','f','g','h'), ('i','j','k','l'), ('m','n','o','p') ] print ": for outer in hidden[idx]: for inner in hidden[idx+1]: print "[" + outer + "]-->[" + inner + "],", print ")" print # for empty line 
draw.py
import numpy as np
from numpy.random import *
print # for empty line
hidden=[
('x','y','z'),
('a','b','c','d'),
('e','f','g','h'),
('i','j','k','l'),
('m','n','o','p')
]
print "
for idx in range(4):
for outer in hidden[idx]:
for inner in hidden[idx+1]:
val = rand()
if val > 0.5:
print "[" + outer + "]-->[" + inner + "],",
else:
print "[" + outer + "]-.->[" + inner + "],",
print ")"
print # for empty line

v0.5: N 레이어 + dropout dropout을 점선으로 표시합니다. 그리지 않는다는 것도 좋다.
Reference
이 문제에 관하여(yuml/python > Deep learning용 네트워크 그리기 > v0.1-v0.5: N층+dropout까지), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/7of9/items/3afc11117e3c41b21f82텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)