-
Notifications
You must be signed in to change notification settings - Fork 0
/
keras-and-gephi-visualize-your-deep-learning-graph.html
25 lines (24 loc) · 8.83 KB
/
keras-and-gephi-visualize-your-deep-learning-graph.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Keras and Gephi : Visualize your Deep Learning Graph - Toto do stuff</title><meta name="description" content="If you work on Machine Learning / Deep Learning with Keras, you can export the model in a dot file. And guess what ? Gephi…"><meta name="generator" content="Publii Open-Source CMS for Static Site"><link rel="canonical" href="https://totetmatt.github.io/keras-and-gephi-visualize-your-deep-learning-graph.html"><link rel="alternate" type="application/atom+xml" href="https://totetmatt.github.io/feed.xml"><link rel="alternate" type="application/json" href="https://totetmatt.github.io/feed.json"><meta property="og:title" content="Keras and Gephi : Visualize your Deep Learning Graph"><meta property="og:site_name" content="Toto do stuff"><meta property="og:description" content="If you work on Machine Learning / Deep Learning with Keras, you can export the model in a dot file. And guess what ? Gephi…"><meta property="og:url" content="https://totetmatt.github.io/keras-and-gephi-visualize-your-deep-learning-graph.html"><meta property="og:type" content="article"><style>:root{--body-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--heading-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--logo-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--menu-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}</style><link rel="stylesheet" href="https://totetmatt.github.io/assets/css/style.css?v=825c89ac06c7215b642eda05e8a14751"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Article","mainEntityOfPage":{"@type":"WebPage","@id":"https://totetmatt.github.io/keras-and-gephi-visualize-your-deep-learning-graph.html"},"headline":"Keras and Gephi : Visualize your Deep Learning Graph","datePublished":"2018-03-24T11:20","dateModified":"2020-06-20T00:35","description":"If you work on Machine Learning / Deep Learning with Keras, you can export the model in a dot file. And guess what ? Gephi…","author":{"@type":"Person","name":"Totetmatt","url":"https://totetmatt.github.io/authors/totetmatt/"},"publisher":{"@type":"Organization","name":"Totetmatt"}}</script></head><body><div class="site-container"><header class="top" id="js-header"><a class="logo" href="https://totetmatt.github.io/">Toto do stuff</a></header><main><article class="post"><div class="hero"><figure class="hero__image hero__image--overlay"><img src="https://totetmatt.github.io/media/website/bg.jpg" srcset="https://totetmatt.github.io/media/website/responsive/bg-xs.jpg 300w, https://totetmatt.github.io/media/website/responsive/bg-sm.jpg 480w, https://totetmatt.github.io/media/website/responsive/bg-md.jpg 768w, https://totetmatt.github.io/media/website/responsive/bg-lg.jpg 1024w, https://totetmatt.github.io/media/website/responsive/bg-xl.jpg 1360w, https://totetmatt.github.io/media/website/responsive/bg-2xl.jpg 1600w" sizes="(max-width: 1600px) 100vw, 1600px" loading="eager" alt=""></figure><header class="hero__content"><div class="wrapper"><div class="post__meta"><time datetime="2018-03-24T11:20">18/03/24</time></div><h1>Keras and Gephi : Visualize your Deep Learning Graph</h1><div class="post__meta post__meta--author"><a href="https://totetmatt.github.io/authors/totetmatt/" class="feed__author invert">Totetmatt</a></div></div></header></div><div class="wrapper post__entry"><p>If you work on Machine Learning / Deep Learning with Keras, you can export the model in a dot file. And guess what ? Gephi can read dot files ! :D</p><p>To do that use this code (adapt it for your usecase)</p><p><a href="https://gist.github.com/totetmatt/dcc85d27b0fdfd79513cbe43201f507f">https://gist.github.com/totetmatt/dcc85d27b0fdfd79513cbe43201f507f</a></p><pre>from keras.applications import *
from keras.utils import plot_model
# [..]
# model = ...
# Get your own model here
# [..]
model = NASNetMobile() #Example with NASNetMobile
plot_model(model,show_shapes=False, to_file='model.dot')</pre><p>Then it will generate a <em>model.dot</em> file that you can open directly into Gephi !</p><figure class="alignnone size-medium wp-image-569"><img loading="lazy" src="https://totetmatt.github.io/media/posts/40/screenshot_111609-300x225.png" sizes="(max-width: 48em) 100vw, 768px" srcset="https://totetmatt.github.io/media/posts/40/responsive/screenshot_111609-300x225-xs.png 300w, https://totetmatt.github.io/media/posts/40/responsive/screenshot_111609-300x225-sm.png 480w, https://totetmatt.github.io/media/posts/40/responsive/screenshot_111609-300x225-md.png 768w, https://totetmatt.github.io/media/posts/40/responsive/screenshot_111609-300x225-lg.png 1024w, https://totetmatt.github.io/media/posts/40/responsive/screenshot_111609-300x225-xl.png 1360w, https://totetmatt.github.io/media/posts/40/responsive/screenshot_111609-300x225-2xl.png 1600w" alt="" width="300" height="225"></figure></div><footer class="wrapper post__footer"><p class="post__last-updated">This article was updated on 20/06/20</p><div class="post__share"></div><div class="post__bio bio"><div class="bio__info"><h3 class="bio__name"><a href="https://totetmatt.github.io/authors/totetmatt/" class="invert" rel="author">Totetmatt</a></h3></div></div></footer></article><nav class="post__nav"><div class="post__nav-inner"><div class="post__nav-prev"><svg width="1.041em" height="0.416em" aria-hidden="true"><use xlink:href="https://totetmatt.github.io/assets/svg/svg-map.svg#arrow-prev"/></svg> <a href="https://totetmatt.github.io/twitter-streaming-importer-naoyun-as-a-gephi-plugin.html" class="invert post__nav-link" rel="prev"><span>Previous</span> Twitter Streaming Importer : Naoyun as a Gephi Plugin</a></div><div class="post__nav-next"><a href="https://totetmatt.github.io/ffmpeg.html" class="invert post__nav-link" rel="next"><span>Next</span> FFMpeg </a><svg width="1.041em" height="0.416em" aria-hidden="true"><use xlink:href="https://totetmatt.github.io/assets/svg/svg-map.svg#arrow-next"/></svg></div></div></nav><div class="post__related related"><div class="wrapper"><h2 class="h5 related__title">You should also read:</h2><article class="related__item"><div class="feed__meta"><time datetime="2014-01-06T07:24" class="feed__date">14/01/06</time></div><h3 class="h1"><a href="https://totetmatt.github.io/lets-play-gephi-bitcoin-transactions.html" class="invert">Let's Play Gephi : Bitcoin Transactions</a></h3></article><article class="related__item"><div class="feed__meta"><time datetime="2015-07-11T15:30" class="feed__date">15/07/11</time></div><h3 class="h1"><a href="https://totetmatt.github.io/lets-play-gephi-understand-k-partite-graph.html" class="invert">Let's Play Gephi : Understand k-partite graph</a></h3></article><article class="related__item"><div class="feed__meta"><time datetime="2013-12-16T13:40" class="feed__date">13/12/16</time></div><h3 class="h1"><a href="https://totetmatt.github.io/lets-play-gephi-understand-degree-weighted-degree-and-betweeness-centrality.html" class="invert">Let's Play Gephi : Understand Degree, Weighted Degree & Betweeness centrality</a></h3></article></div></div></main><footer class="footer"><div class="footer__copyright"><p>Powered by <a href="https://getpublii.com" target="_blank" rel="nofollow noopener">Publii Static CMS</a></p></div><button class="footer__bttop js-footer__bttop" aria-label="Back to top"><svg><title>Back to top</title><use xlink:href="https://totetmatt.github.io/assets/svg/svg-map.svg#toparrow"/></svg></button></footer></div><script>window.publiiThemeMenuConfig = {
mobileMenuMode: 'sidebar',
animationSpeed: 300,
submenuWidth: 'auto',
doubleClickTime: 500,
mobileMenuExpandableSubmenus: true,
relatedContainerForOverlayMenuSelector: '.top',
};</script><script defer="defer" src="https://totetmatt.github.io/assets/js/scripts.min.js?v=f4c4d35432d0e17d212f2fae4e0f8247"></script><script>var images = document.querySelectorAll('img[loading]');
for (var i = 0; i < images.length; i++) {
if (images[i].complete) {
images[i].classList.add('is-loaded');
} else {
images[i].addEventListener('load', function () {
this.classList.add('is-loaded');
}, false);
}
}</script></body></html>