You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/26 20:32:32 UTC

[GitHub] thomelane commented on issue #7943: Request: Visualization for Gluon neural networks

thomelane commented on issue #7943: Request: Visualization for Gluon neural networks
URL: https://github.com/apache/incubator-mxnet/issues/7943#issuecomment-360896662
 
 
   Until this is added, you might be able to work with `_cached_graph` property of HybridBlocks.
   
   ```
   import mxnet as mx
   
   net = mx.gluon.nn.HybridSequential()
   with net.name_scope():
       net.add(mx.gluon.nn.Dense(256, activation="relu"))
       net.add(mx.gluon.nn.Dense(256, activation="relu"))
       net.add(mx.gluon.nn.Dense(10))
       
   # Option 1    
   print(net)
   
   # Option 2 (net must be HybridSequential, if want to plot whole graph)
   net.hybridize()
   net.collect_params().initialize()
   x = mx.nd.random_normal(shape=(16, 1, 28, 28))
   net(x)
   mx.viz.plot_network(net._cached_graph[1])
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services