WLNet (.wlnet)
Background & Context
-
- Used for storing trained and untrained neural nets.
- Binary format.
- Developed at Wolfram Research.
Import & Export
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Import elements include:
-
"Net" the net, including all initialized arrays "UninitializedNet" the net, without any arrays "ArrayList" parameter arrays as a list "ArrayAssociation" parameter arrays as an association "WLVersion" version of the Wolfram Language used to create the file
Examples
Basic Examples (2)
Define a NetChain:
net = NetChain[{LinearLayer[100], LinearLayer[10]}]Export this net to the WLNet format:
Export["testnet.wlnet", net]Import["testnet.wlnet"]Define an initialized NetGraph:
net = NetInitialize@NetGraph[{LinearLayer[10], LinearLayer[3]}, {1 -> 2}, "Input" -> {2}]Export the net along with its initialized parameters:
Export["testnet.wlnet", net]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"]Tech Notes
Related Guides
History
Introduced in 2016 (11.0)