Skip to content

Instantly share code, notes, and snippets.

@oraoto
Last active April 16, 2018 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oraoto/01354f1f234c4a02dd13ae7f9bd81656 to your computer and use it in GitHub Desktop.
Save oraoto/01354f1f234c4a02dd13ae7f9bd81656 to your computer and use it in GitHub Desktop.
NNabla to NCS, maxpooling + tanh example
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: output Pages: 1 -->
<svg width="602pt" height="459pt"
viewBox="0.00 0.00 602.00 459.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 455)">
<title>output</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-455 598,-455 598,4 -4,4"/>
<!-- Legend -->
<g id="node1" class="node">
<title>Legend</title>
<polygon fill="#e0e0e0" stroke="transparent" points="8,-396.5 8,-419.5 208,-419.5 208,-396.5 8,-396.5"/>
<polygon fill="none" stroke="#000000" points="8,-396.5 8,-419.5 208,-419.5 208,-396.5 8,-396.5"/>
<text text-anchor="start" x="92.5" y="-404.3" font-family="Times,serif" font-size="14.00" fill="#000000">Layer</text>
<polygon fill="#88ffff" stroke="transparent" points="8,-358.5 8,-396.5 88,-396.5 88,-358.5 8,-358.5"/>
<polygon fill="none" stroke="#000000" points="8,-358.5 8,-396.5 88,-396.5 88,-358.5 8,-358.5"/>
<text text-anchor="start" x="12" y="-381.3" font-family="Times,serif" font-size="14.00" fill="#000000"> Complexity </text>
<text text-anchor="start" x="14" y="-366.3" font-family="Times,serif" font-size="14.00" fill="#000000"> (MFLOPs) </text>
<polygon fill="#ff88ff" stroke="transparent" points="88,-358.5 88,-396.5 163,-396.5 163,-358.5 88,-358.5"/>
<polygon fill="none" stroke="#000000" points="88,-358.5 88,-396.5 163,-396.5 163,-358.5 88,-358.5"/>
<text text-anchor="start" x="92" y="-381.3" font-family="Times,serif" font-size="14.00" fill="#000000"> Bandwidth </text>
<text text-anchor="start" x="101.5" y="-366.3" font-family="Times,serif" font-size="14.00" fill="#000000"> (MB/s) </text>
<polygon fill="#ffff88" stroke="transparent" points="163,-358.5 163,-396.5 208,-396.5 208,-358.5 163,-358.5"/>
<polygon fill="none" stroke="#000000" points="163,-358.5 163,-396.5 208,-396.5 208,-358.5 163,-358.5"/>
<text text-anchor="start" x="167" y="-381.3" font-family="Times,serif" font-size="14.00" fill="#000000"> Time </text>
<text text-anchor="start" x="170.5" y="-366.3" font-family="Times,serif" font-size="14.00" fill="#000000"> (ms)</text>
</g>
<!-- Input -->
<g id="node2" class="node">
<title>Input</title>
<ellipse fill="none" stroke="#000000" cx="305" cy="-389.5" rx="71.4873" ry="18"/>
<text text-anchor="middle" x="305" y="-385.8" font-family="Times,serif" font-size="14.00" fill="#000000">input: (1, 3, 5, 5)</text>
</g>
<!-- MaxPooling_1 -->
<g id="node3" class="node">
<title>MaxPooling_1</title>
<polygon fill="#a3a3a3" stroke="transparent" points="219,-265 219,-288 391,-288 391,-265 219,-265"/>
<polygon fill="none" stroke="#000000" points="219,-265 219,-288 391,-288 391,-265 219,-265"/>
<text text-anchor="start" x="264" y="-272.8" font-family="Times,serif" font-size="14.00" fill="#000000">MaxPooling_1</text>
<polygon fill="#dddddd" stroke="transparent" points="219,-242 219,-265 391,-265 391,-242 219,-242"/>
<polygon fill="none" stroke="#000000" points="219,-242 219,-265 391,-265 391,-242 219,-242"/>
<text text-anchor="start" x="282.5" y="-249.8" font-family="Times,serif" font-size="14.00" fill="#000000">(3, 2, 2)</text>
<polygon fill="#2ed1c6" stroke="transparent" points="219,-204 219,-242 295,-242 295,-204 219,-204"/>
<polygon fill="none" stroke="#000000" points="219,-204 219,-242 295,-242 295,-204 219,-204"/>
<text text-anchor="start" x="232.5" y="-226.8" font-family="Times,serif" font-size="14.00" fill="#000000"> 4.8e&#45;05 </text>
<text text-anchor="start" x="223" y="-211.8" font-family="Times,serif" font-size="14.00" fill="#000000"> (MFLOPs) </text>
<polygon fill="#b1179d" stroke="transparent" points="295,-204 295,-242 351,-242 351,-204 295,-204"/>
<polygon fill="none" stroke="#000000" points="295,-204 295,-242 351,-242 351,-204 295,-204"/>
<text text-anchor="start" x="307" y="-226.8" font-family="Times,serif" font-size="14.00" fill="#000000"> 5.50 </text>
<text text-anchor="start" x="299" y="-211.8" font-family="Times,serif" font-size="14.00" fill="#000000"> (MB/s) </text>
<polygon fill="#fffff7" fill-opacity="0.015686" stroke="transparent" points="351,-204 351,-242 391,-242 391,-204 351,-204"/>
<polygon fill="none" stroke="#000000" points="351,-204 351,-242 391,-242 391,-204 351,-204"/>
<text text-anchor="start" x="355" y="-226.8" font-family="Times,serif" font-size="14.00" fill="#000000"> 0.03 </text>
<text text-anchor="start" x="356" y="-211.8" font-family="Times,serif" font-size="14.00" fill="#000000"> (ms)</text>
</g>
<!-- Input&#45;&gt;MaxPooling_1 -->
<g id="edge1" class="edge">
<title>Input&#45;&gt;MaxPooling_1</title>
<path fill="none" stroke="#000000" d="M305,-371.3256C305,-353.8927 305,-326.6561 305,-302.0214"/>
<polygon fill="#000000" stroke="#000000" points="308.5001,-302.0195 305,-292.0196 301.5001,-302.0196 308.5001,-302.0195"/>
</g>
<!-- Tanh_1 -->
<g id="node4" class="node">
<title>Tanh_1</title>
<polygon fill="#a3a3a3" stroke="transparent" points="219,-137 219,-160 391,-160 391,-137 219,-137"/>
<polygon fill="none" stroke="#000000" points="219,-137 219,-160 391,-160 391,-137 219,-137"/>
<text text-anchor="start" x="284.5" y="-144.8" font-family="Times,serif" font-size="14.00" fill="#000000">Tanh_1</text>
<polygon fill="#dddddd" stroke="transparent" points="219,-114 219,-137 391,-137 391,-114 219,-114"/>
<polygon fill="none" stroke="#000000" points="219,-114 219,-137 391,-137 391,-114 219,-114"/>
<text text-anchor="start" x="282.5" y="-121.8" font-family="Times,serif" font-size="14.00" fill="#000000">(3, 2, 2)</text>
<polygon fill="#b1f1ef" stroke="transparent" points="219,-76 219,-114 295,-114 295,-76 219,-76"/>
<polygon fill="none" stroke="#000000" points="219,-76 219,-114 295,-114 295,-76 219,-76"/>
<text text-anchor="start" x="244.5" y="-98.8" font-family="Times,serif" font-size="14.00" fill="#000000"> 0.0 </text>
<text text-anchor="start" x="223" y="-83.8" font-family="Times,serif" font-size="14.00" fill="#000000"> (MFLOPs) </text>
<polygon fill="#ffe5fc" stroke="transparent" points="295,-76 295,-114 351,-114 351,-76 295,-76"/>
<polygon fill="none" stroke="#000000" points="295,-76 295,-114 351,-114 351,-76 295,-76"/>
<text text-anchor="start" x="307" y="-98.8" font-family="Times,serif" font-size="14.00" fill="#000000"> 1.24 </text>
<text text-anchor="start" x="299" y="-83.8" font-family="Times,serif" font-size="14.00" fill="#000000"> (MB/s) </text>
<polygon fill="#ffff16" fill-opacity="0.019608" stroke="transparent" points="351,-76 351,-114 391,-114 391,-76 351,-76"/>
<polygon fill="none" stroke="#000000" points="351,-76 351,-114 391,-114 391,-76 351,-76"/>
<text text-anchor="start" x="355" y="-98.8" font-family="Times,serif" font-size="14.00" fill="#000000"> 0.02 </text>
<text text-anchor="start" x="356" y="-83.8" font-family="Times,serif" font-size="14.00" fill="#000000"> (ms)</text>
</g>
<!-- MaxPooling_1&#45;&gt;Tanh_1 -->
<g id="edge2" class="edge">
<title>MaxPooling_1&#45;&gt;Tanh_1</title>
<path fill="none" stroke="#000000" d="M305,-199.7891C305,-191.5417 305,-182.8661 305,-174.3724"/>
<polygon fill="#000000" stroke="#000000" points="308.5001,-174.1431 305,-164.1431 301.5001,-174.1431 308.5001,-174.1431"/>
</g>
<!-- Output -->
<g id="node5" class="node">
<title>Output</title>
<ellipse fill="none" stroke="#000000" cx="305" cy="-18" rx="66.8882" ry="18"/>
<text text-anchor="middle" x="305" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">output: [2, 2, 3]</text>
</g>
<!-- Tanh_1&#45;&gt;Output -->
<g id="edge3" class="edge">
<title>Tanh_1&#45;&gt;Output</title>
<path fill="none" stroke="#000000" d="M305,-71.8053C305,-63.0799 305,-54.1991 305,-46.2339"/>
<polygon fill="#000000" stroke="#000000" points="308.5001,-46.0404 305,-36.0405 301.5001,-46.0405 308.5001,-46.0404"/>
</g>
<!-- Summary -->
<g id="node6" class="node">
<title>Summary</title>
<polygon fill="#c60000" stroke="transparent" points="402,-423.5 402,-446.5 586,-446.5 586,-423.5 402,-423.5"/>
<polygon fill="none" stroke="#000000" points="402,-423.5 402,-446.5 586,-446.5 586,-423.5 402,-423.5"/>
<text text-anchor="start" x="466.5" y="-431.3" font-family="Times,serif" font-size="14.00" fill="#000000">Summary</text>
<polygon fill="#e2e2e2" stroke="transparent" points="402,-400.5 402,-423.5 586,-423.5 586,-400.5 402,-400.5"/>
<polygon fill="none" stroke="#000000" points="402,-400.5 402,-423.5 586,-423.5 586,-400.5 402,-400.5"/>
<text text-anchor="start" x="444" y="-408.3" font-family="Times,serif" font-size="14.00" fill="#000000">1 SHV Processors</text>
<polygon fill="#dadada" stroke="transparent" points="402,-377.5 402,-400.5 586,-400.5 586,-377.5 402,-377.5"/>
<polygon fill="none" stroke="#000000" points="402,-377.5 402,-400.5 586,-400.5 586,-377.5 402,-377.5"/>
<text text-anchor="start" x="430.5" y="-385.3" font-family="Times,serif" font-size="14.00" fill="#000000">Inference time 0.05 ms</text>
<polygon fill="#e2e2e2" stroke="transparent" points="402,-354.5 402,-377.5 586,-377.5 586,-354.5 402,-354.5"/>
<polygon fill="none" stroke="#000000" points="402,-354.5 402,-377.5 586,-377.5 586,-354.5 402,-354.5"/>
<text text-anchor="start" x="427" y="-362.3" font-family="Times,serif" font-size="14.00" fill="#000000">Bandwidth 3.54 MB/sec</text>
<polygon fill="#dadada" stroke="transparent" points="402,-331.5 402,-354.5 586,-354.5 586,-331.5 402,-331.5"/>
<polygon fill="none" stroke="#000000" points="402,-331.5 402,-354.5 586,-354.5 586,-331.5 402,-331.5"/>
<text text-anchor="start" x="406" y="-339.3" font-family="Times,serif" font-size="14.00" fill="#000000">This network is Compute bound</text>
</g>
</g>
</svg>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment