OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Define a (RefLink[NetChain, paclet:ref/NetChain]):

net=NetChain[{LinearLayer[100],LinearLayer[10]}]

Export this net to the WLNet format:

Export["testnet.wlnet",net]

Import the net:

Import["testnet.wlnet"]

Define an initialized (RefLink[NetGraph, paclet:ref/NetGraph]):

net=NetInitialize@NetGraph[{LinearLayer[10],LinearLayer[3]},{1-> 2},"Input"->{2}]

Export the net along with its initialized parameters:

Export["testnet.wlnet",net]

Import the network:

net2=Import["testnet.wlnet"]

Evaluate the net on input data:

net2[{1,2}]

This is equivalent to evaluating the original net:

net[{1,2}]

Import a version of the net without any initialized arrays:

net2=Import["testnet.wlnet","UninitializedNet"]

Import an association of arrays:

Import["testnet.wlnet","ArrayAssociation"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NetGraph, paclet:ref/NetGraph])  ▪  (RefLink[NetChain, paclet:ref/NetChain])  ▪  (RefLink[NetTrain, paclet:ref/NetTrain])}, {Related Formats:  (RefLink[MXNet, paclet:ref/format/MXNet])  ▪  (RefLink[WMLF, paclet:ref/format/WMLF])  ▪  (RefLink[HDF5, paclet:ref/format/HDF5])  ▪  (RefLink[Real32, paclet:ref/format/Real32])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Neural Networks in the Wolfram Language, paclet:tutorial/NeuralNetworksOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Neural Networks, paclet:guide/NeuralNetworks])}, {▪(RefLinkPlain[Importing & Exporting, paclet:guide/ImportingAndExporting])}})}})