MXNet (.json,.params)

Background

Import and Export

  • Import["file.json","MXNet"] imports the MXNet network saved as a .json file, loading weights from a corresponding .params file if available. The parameter file corresponding to "file.json" is assumed to match the pattern "file*.params" and be located in the same folder.
  • Import["file.json",{"MXNet",elem}] imports the net with the specified element elem.
  • Import["file.params","MXNet"] imports the MXNet parameter file saved as a .params file as an association of weights.
  • Import["file.params",{"MXNet",elem}] imports the parameter file with the specified element elem.
  • Export["file.json",net,"MXNet"] exports a trained neural network as a .json file and a corresponding .params file.

Elements

  • Net Import elements:
  • "InputNames"names of the net inputs
    "LayerAssociation"list of rules for options, properties and settings
    "Net"import the net as a NetGraph or NetChain
    "NodeDataset"dataset of MXNet symbol nodes
    "NodeGraph"graph of nodes of MXNet symbol
    "NodeGraphPlot"plot of nodes of MXNet symbol
    "UninitializedNet"import the net without any parameters
  • Parameter Import elements:
  • "ArrayAssociation"import the parameter arrays as an association
    "ArrayList"import the parameter arrays as a list
    "ArrayNames"the names of the parameter arrays
    "RawArrayAssociation"import the parameter arrays as a RawArray association
    "RawArrayList"import the parameter arrays as a RawArray list

Options

  • Import option:
  • "ArrayPath"Automaticpath to the MXNet parameter file
  • Export options:
  • "ArrayPath"Automaticpath to save the parameter arrays to
    "SaveArrays"Truewhether to export the net parameter arrays

Examples

open allclose all

Basic Examples  (1)

Define an initialized NetChain:

In[1]:=
Click for copyable input
Out[1]=

Export the net to the MXNet format:

In[2]:=
Click for copyable input
Out[2]=

Import the net from the MXNet format:

In[3]:=
Click for copyable input
Out[3]=

Import Elements  (13)

Import Options  (1)

Possible Issues  (3)

See Also

"WMLF"  "WLNet"  NetGraph  NetChain  NetTrain

Introduced in 2017
(11.2)