Skip to content

Plot command

Philipp Kranen edited this page Jan 20, 2016 · 4 revisions

This command loads a given computation network and describes the network topology (usually a DAG) using the DOT (http://www.graphviz.org/doc/info/lang.html) language. It can also optionally call a third-part tool (http://www.graphviz.org/Documentation/dotguide.pdf) to render the network topology. Note that many DOT rendering tools are optimized for DAG, and the rendered graph becomes quite messy if the network structure is non-DAG. The non-DAG structure is usually caused by the use of delay node. In this case, this command will treat all the delay nodes as leaf nodes.

The related parameters of this command are:

  • modelPath – the path to the computation network.

  • outputDOTFile – the path to the output DOT file. If user does not specify it, ${modelPath}.dot will be assumed.

Optionally, if uses want to convert the dot description to a figure, he or she needs to specify the following parameters:

  • outputFile – the path to the output figure.

  • renderCmd – A string indicates how the third party tool is used to convert from a DOT file to a figure. For example, if graphviz is used, the RenderCmd can be written as RenderCmd="d:\Tools\graphviz\bin\dot.exe -Tjpg <IN> -o<OUT>" where the plot command will substitute “ “ with the outputDOTFile command parameters and “” with the outputFile command parameters; -Tjpg indicates a jpg file format is selected.

Here is a complete example:

command=topoplot
topoplot=[
    action="plot"
    modelPath="train\lstm.model.0"
    outputdotFile="train\lstm.model.dot" # this specifies the dot file to output
    # if user does not specify this, it will be ${modelPath}. dot
    outputFile="train\lstm.model.jpg" # this specifies the rendered image
    renderCmd="d:\Tools\graphviz\bin\dot.exe -Tjpg <IN> -o<OUT>"
    # if RenderCmd is specified, CNTK will call the plot command after replacing
    # <IN> with ${outputdotFile} and <OUT> with ${outputfile}
]
Clone this wiki locally