Table Of Contents
Table Of Contents


mxnet.visualization.plot_network(symbol, title='plot', save_format='pdf', shape=None, node_attrs={}, hide_weights=True)[source]

Creates a visualization (Graphviz digraph object) of the given computation graph. Graphviz must be installed for this function to work.

  • title (str, optional) – Title of the generated visualization.

  • symbol (Symbol) – A symbol from the computation graph. The generated digraph will visualize the part of the computation graph required to compute symbol.

  • shape (dict, optional) – Specifies the shape of the input tensors. If specified, the visualization will include the shape of the tensors between the nodes. shape is a dictionary mapping input symbol names (str) to the corresponding tensor shape (tuple).

  • node_attrs (dict, optional) –

    Specifies the attributes for nodes in the generated visualization. node_attrs is a dictionary of Graphviz attribute names and values. For example:


    will use oval shape for nodes and allow variable sized nodes in the visualization.

  • hide_weights (bool, optional) – If True (default), then inputs with names of form _weight (corresponding to weight tensors) or _bias (corresponding to bias vectors) will be hidden for a cleaner visualization.


dot – A Graphviz digraph object visualizing the computation graph to compute symbol.

Return type



>>> net = mx.sym.Variable('data')
>>> net = mx.sym.FullyConnected(data=net, name='fc1', num_hidden=128)
>>> net = mx.sym.Activation(data=net, name='relu1', act_type="relu")
>>> net = mx.sym.FullyConnected(data=net, name='fc2', num_hidden=10)
>>> net = mx.sym.SoftmaxOutput(data=net, name='out')
>>> digraph = mx.viz.plot_network(net, shape={'data':(100,200)},
... node_attrs={"fixedsize":"false"})
>>> digraph.view()


If mxnet is imported, the visualization module can be used in its short-form. For example, if we import mxnet as follows:

import mxnet

this method in visualization module can be used in its short-form as: