{"id":827,"date":"2016-01-14T11:14:00","date_gmt":"2016-01-14T16:14:00","guid":{"rendered":"http:\/\/josephpcohen.com\/w\/?p=827"},"modified":"2023-12-10T14:44:35","modified_gmt":"2023-12-10T19:44:35","slug":"visualizing-cnn-architectures-side-by-side-with-mxnet","status":"publish","type":"post","link":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/","title":{"rendered":"Visualizing CNN architectures side by side with mxnet"},"content":{"rendered":"<p>Convolutional Neural Networks can be visualized as computation graphs with input nodes where the computation starts and output nodes where the result can be read. Here the models that are provided with mxnet are compared using the <code>mx.viz.plot_network<\/code> method. The output node is at the top and the input node is at the bottom.<\/p>\n<p><!--more--><\/p>\n<pre>import find_mxnet\r\nimport mxnet as mx\r\nimport importlib\r\n\r\nname = \"inception-v3\"\r\nnet = importlib.import_module(\"symbol_\" + name).get_symbol(2)\r\na = mx.viz.plot_network(net, shape={\"data\":(1, 1, 299, 299)}, node_attrs={\"shape\":'rect',\"fixedsize\":'false'})\r\na.render(name)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr style=\"padding: 0px;\" align=\"center\">\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/train_mnist.py\">LeNet<br \/>\n28&#215;28<br \/>\n(1998)<\/a><\/td>\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/symbol_alexnet.py\">AlexNet<br \/>\n224&#215;224<br \/>\n(2012)<\/a><\/td>\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/symbol_vgg.py\">VGG<br \/>\n224&#215;224<br \/>\n(9\/2014)<\/a><\/td>\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/symbol_googlenet.py\">GoogLeNet<br \/>\n224&#215;224<br \/>\n(9\/2014)<\/a><\/td>\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/symbol_inception-bn.py\">Inception BN<br \/>\n224&#215;224<br \/>\n(2\/2015)<\/a><\/td>\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/symbol_inception-v3.py\">Inception V3<br \/>\n299&#215;299<br \/>\n(12\/2015)<\/a><\/td>\n<td><a href=\"https:\/\/github.com\/dmlc\/mxnet\/blob\/master\/example\/image-classification\/symbol_resnet-28-small.py\">Resnet (n=9, 56 Layers)<br \/>\n28&#215;28<br \/>\n(12\/2015)<\/a><\/td>\n<\/tr>\n<tr align=\"center\" valign=\"top\">\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/lenet.pdf\"><img decoding=\"async\" style=\"width: 80px;vertical-align:top\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/lenet.png\" alt=\"a\" \/><\/a><\/td>\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/alexnet.pdf\"><img decoding=\"async\" style=\"width: 80px;\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/alexnet.png\" alt=\"a\" \/><\/a><\/td>\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/vgg.pdf\"><img decoding=\"async\" style=\"width: 80px;\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/vgg.png\" alt=\"a\" \/><\/a><\/td>\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/googlenet.pdf\"><img decoding=\"async\" style=\"width: 250px;\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/googlenet.png\" alt=\"a\" \/><\/a><\/td>\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/inception-bn.pdf\"><img decoding=\"async\" style=\"width: 300px;\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/inception-bn.png\" alt=\"a\" \/><\/a><\/td>\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/inception-v3.pdf\"><img decoding=\"async\" style=\"width: 400px;\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/inception-v3.png\" alt=\"a\" \/><\/a><\/td>\n<td style=\"vertical-align:top\"><a href=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/resnet-28-small.pdf\"><img decoding=\"async\" style=\"width: 260px;\" src=\"http:\/\/josephpcohen.com\/w\/wp-content\/uploads\/resnet-28-small.png\" alt=\"a\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Convolutional Neural Networks can be visualized as computation graphs with input nodes where the computation starts and output nodes where the result can be read. <a class=\"mh-excerpt-more\" href=\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\" title=\"Visualizing CNN architectures side by side with mxnet\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":869,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,11],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Visualizing CNN architectures side by side with mxnet - Joseph Paul Cohen PhD<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visualizing CNN architectures side by side with mxnet - Joseph Paul Cohen PhD\" \/>\n<meta property=\"og:description\" content=\"Convolutional Neural Networks can be visualized as computation graphs with input nodes where the computation starts and output nodes where the result can be read. [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\" \/>\n<meta property=\"og:site_name\" content=\"Joseph Paul Cohen PhD\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-14T16:14:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-10T19:44:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/josephpcohen.com\/w\/wp-content\/uploads\/Screen-Shot-2016-01-14-at-11.25.15-AM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1680\" \/>\n\t<meta property=\"og:image:height\" content=\"1088\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joseph Paul Cohen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joseph Paul Cohen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\"},\"author\":{\"name\":\"Joseph Paul Cohen\",\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\"},\"headline\":\"Visualizing CNN architectures side by side with mxnet\",\"datePublished\":\"2016-01-14T16:14:00+00:00\",\"dateModified\":\"2023-12-10T19:44:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\"},\"wordCount\":80,\"publisher\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\"},\"articleSection\":[\"References\",\"Reports\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\",\"url\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\",\"name\":\"Visualizing CNN architectures side by side with mxnet - Joseph Paul Cohen PhD\",\"isPartOf\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#website\"},\"datePublished\":\"2016-01-14T16:14:00+00:00\",\"dateModified\":\"2023-12-10T19:44:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/josephpcohen.com\/w\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visualizing CNN architectures side by side with mxnet\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/josephpcohen.com\/w\/#website\",\"url\":\"https:\/\/josephpcohen.com\/w\/\",\"name\":\"Joseph Paul Cohen PhD\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/josephpcohen.com\/w\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684\",\"name\":\"Joseph Paul Cohen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g\",\"caption\":\"Joseph Paul Cohen\"},\"logo\":{\"@id\":\"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Visualizing CNN architectures side by side with mxnet - Joseph Paul Cohen PhD","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/","og_locale":"en_US","og_type":"article","og_title":"Visualizing CNN architectures side by side with mxnet - Joseph Paul Cohen PhD","og_description":"Convolutional Neural Networks can be visualized as computation graphs with input nodes where the computation starts and output nodes where the result can be read. [...]","og_url":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/","og_site_name":"Joseph Paul Cohen PhD","article_published_time":"2016-01-14T16:14:00+00:00","article_modified_time":"2023-12-10T19:44:35+00:00","og_image":[{"width":1680,"height":1088,"url":"https:\/\/josephpcohen.com\/w\/wp-content\/uploads\/Screen-Shot-2016-01-14-at-11.25.15-AM.png","type":"image\/png"}],"author":"Joseph Paul Cohen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Joseph Paul Cohen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/#article","isPartOf":{"@id":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/"},"author":{"name":"Joseph Paul Cohen","@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684"},"headline":"Visualizing CNN architectures side by side with mxnet","datePublished":"2016-01-14T16:14:00+00:00","dateModified":"2023-12-10T19:44:35+00:00","mainEntityOfPage":{"@id":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/"},"wordCount":80,"publisher":{"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684"},"articleSection":["References","Reports"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/","url":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/","name":"Visualizing CNN architectures side by side with mxnet - Joseph Paul Cohen PhD","isPartOf":{"@id":"https:\/\/josephpcohen.com\/w\/#website"},"datePublished":"2016-01-14T16:14:00+00:00","dateModified":"2023-12-10T19:44:35+00:00","breadcrumb":{"@id":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/josephpcohen.com\/w\/visualizing-cnn-architectures-side-by-side-with-mxnet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/josephpcohen.com\/w\/"},{"@type":"ListItem","position":2,"name":"Visualizing CNN architectures side by side with mxnet"}]},{"@type":"WebSite","@id":"https:\/\/josephpcohen.com\/w\/#website","url":"https:\/\/josephpcohen.com\/w\/","name":"Joseph Paul Cohen PhD","description":"","publisher":{"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/josephpcohen.com\/w\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/e25d0d5746952220f35d182ca7aa8684","name":"Joseph Paul Cohen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a810b57939e75247f570c9094e7bd16e?s=96&d=mm&r=g","caption":"Joseph Paul Cohen"},"logo":{"@id":"https:\/\/josephpcohen.com\/w\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts\/827"}],"collection":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/comments?post=827"}],"version-history":[{"count":47,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts\/827\/revisions"}],"predecessor-version":[{"id":1732,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/posts\/827\/revisions\/1732"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/media\/869"}],"wp:attachment":[{"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/media?parent=827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/categories?post=827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/josephpcohen.com\/w\/wp-json\/wp\/v2\/tags?post=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}