|
3.2.3 Network Format
A trained network is identified by its head and list elements in the following manner.
The head of the list identifies the type of network.
The first component of the list contains the parameters, or weights, of the network.
The second component of the list contains a list of rules indicating different network properties.
Consider this structure in a simple example.
Load the Neural Networks package.
In[1]:=<<NeuralNetworks`
Create a Perceptron network.
In[2]:=
Out[2]=
The head is Perceptron. The first component contains the parameters of the neural network model, indicated by the symbol {w, b} for perceptrons. You obtain the parameters of a network by extracting the first element.
There are two replacement rules in the perceptron object. The one with left side CreationDate indicates when the network was created, and the other one, AccumulatedIterations, indicates the number of training iterations that have been applied to the network. In this case it is nil; that is, the network has not been trained at all.
Look at the parameters.
In[3]:=
Out[3]=
You can store more information about a network model by adding more rules to the second component. The following example inserts the rule NetworkName JimsFavoriteModel as the first element of the list in the second component of the neural network model.
Add a name to the network.
In[4]:=
Out[4]=
|