10.1 The Network Object

The network object is basically a container for all the things that go in it. Thus, it has a group of layers, which then contain units, projections, etc. In addition, each network also has an epoch counter and a variable controlling the default layout of the layers. The epoch counter reflects the number of training epochs the network has seen (not testing). Finally, the network is instantiated in the user interface by one or more NetViews, which provide a window with menu actions, tools, etc. to operate on the network.

Layer_MGroup layers
This is the group of layers that have been created in the network. The layers then contain all of the remaining substructure of the network.
int epoch
The epoch counter indicates how many epochs of training the network has been subjected to. This counter is incremented by the training processes which act upon it, see section 12.4.3 Iterating over Trials: EpochProcess.
bool re_init
This flag is set by training schedule process to indicate whether the network should be reinitialized when the process is initialized section 12.4.2 Iterating over Epochs: TrainProcess.
LayerLayout lay_layout
This variable can be set to either TWO_D or THREE_D. It controls the default positioning of the layers when they are created, as well as the skew of the units when they are displayed. TWO_D networks are arranged in one big X-Y grid, while THREE_D networks simulate a three-dimensional space where successive layers are located at successively higher Z coordinates, and units within a layer are arranged in an X-Y plane.
Usr1SaveFmt usr1_save_fmt
You can control how the network is saved when it receives the USR1 signal (see section 9.4 Signals to Control a PDP++ Process) with this -- the full network or just the weights

The network also has the following functions which can be activated by the corresponding menu selection in the NetView (using the left hand menu).

In the Object menu:

ReadOldPDPNet(File input_file, bool skip_dots)
Copy_Weights()
Copies the weights from another similarly-configured network. By duplicating a network and then later copying weights back from it, one can restore weight values to known values while tinkering with various parameters affecting network learning.
WriteWeights(File output_file)
Outputs bias and receiver weight values in a unit by unit format to a file (includes comments). NOTE: This is not the same format as the old pdp software.
ReadWeights(File input_file)
Loads in the bias and receiver weight values from a file created with the WriteWeights function above. Reads in a "filename.net" type file format from the old pdp software. skip_dots indicates whether to skip over "." values in the "network:" weight matrix section or to create zero valued weights instead. This function will attempt to use and extend existing network structure if it exists and create new network structure if necessary. Currently (v1.2) it does not handle "Bias:" sections or "LINKED" weight constraints.

In the Actions menu:

Build()
Create units in all the layers according to the size and shape of the layers. If units already exist, it makes sure they are of the right type, and arranged within the geometry of the layer. This is accessed through the Build All button of the NetView (see section 10.6 Network Viewer).
Connect()
Create connections on all the units according to the projections on the layers. The projections define a pattern of connectivity, and the connections actually flesh this pattern out by individually connecting unit to unit. Note that any existing connections are removed before connecting. This is accessed through the Connect All button of the NetView (see section 10.6 Network Viewer).
Check Types()
Checks to make sure all the objects and specs in the network are mutually compatible.
Fix Prjn Indexes()
Fixes the other_idx indexes on the connection groups -- CheckTypes might tell you you need to run this if your network was not properly connected.
RemoveCons()
Remove all the connections on the units in the network. Like RemoveUnits this is useful for reducing the size of the network for saving.
RemoveUnits()
Remove all the units from the network. This can be useful for saving large networks, since all of the relevant structural information for rebuilding the network is typically present in the layers and projections. Thus, one can save the "skeleton" and then simply press Build All and Connect All when the network is reloaded.
InitState()
Initialize the state variables on the units. This means activation-like variables, but not the weights.
InitWtState()
Initialize the weight state information on the connections in accordance with their ConSpecs. This also resets the epoch counter to zero.
TransformWeights(PreProcessVals trans)
Applies given transformation to weights. Possible transformations include basic arithmetic operators (e.g., scaling via multiplication), and absolute value, thresholding, etc.
AddNoiseToWeights(Random noise_spec)
Adds noise to weights using given noise specification. This can be useful for simulating damage to the network.
PruneCons(PreProcessVals pre_proc, CountParam::Relation rel, float cmp_val)
Removes connections that (after a pre-processing transformation, e.g. absolute-value) meet the given relation in comparison to compare val (e.g., LESSTHANOREQUAL to some value).
LesionCons(float p_lesion, bool permute)
Removes connections with probability p_lesion. If permute is true, then a fixed number of weights will be lesioned, where this number is equal to the probablility times the number of weights. Othewise, the actual number of weights lesioned will vary based on the probability.
LesionUnits(float p_lesion, bool permute)
Removes units with probability p_lesion. If permute is true, then a fixed number of units will be lesioned, where this number is equal to the probablility times the number of units (on a layer-by-layer basis). Othewise, the actual number of units lesioned will vary based on the probability.
TwoD_Or_ThreeD(LayerLayout layout_type)
Reposition the units and layers in either a 2D or 3D configuration.
GridViewWeights(GridLog* grid_log, Layer* recv_lay, Layer* send_lay, int un_x, un_y, wt_x, wt_y)
Plots the entire set of weights into the recv_lay from the send_lay in the grid log specified (NULL = make a new one). The un_x, un_y parameters can specify a more limited range of receiving units (-1 means entire layer), and the wt_x, wt_y similarly specify a more limited range of sending units (weights).

These other functions of the network might be useful to those writing scripts or programming in PDP++:

ConnectUnits(Unit* receiving_unit, Unit* sending_unit);
Creates a connection from the sending_unit to the receiving_unit. A custom projection between the units' layers is created if necessary

Finally there are a number of other functions that can be found in `src/pdp/netstru.h' which are useful for programming. In general the Network has a function corresponding to one that is performed on a lower-level object like a unit, and this function on the network simply calls the corresponding one on all of its layers, which then call the one on all of their units, etc.