NET-SPEC:  Create a new network, or display specifications for existing net.

Net-spec creates a log file containing records describing the network
architecture and the associated priors.  When invoked with just a log
file as argument, it displays the specifications of the network stored
in that log file.

Usage:

    net-spec log-file N-inputs { N-hidden { flag } } N-outputs { flag }
             / ti [ ih bh th { hh ih bh th } ] { ho } io bo  [ / { ah } ao ] 

or:

    net-spec log-file N-inputs { N-hidden { flag } } N-outputs { flag }
             / { group=prior } 

or: 

    net-spec log-file

The first two forms above are alternative ways of specifying network
archictures.  The last form is for displaying the network architecture
stored in the specified log file.

N-inputs and N-outputs are the numbers of units in the input and
output layers.  The sizes of zero or more hidden layers are specified
between these.  Flags pertaining to a layer may be specified after the
argument giving the size of the layer.  

The following flag is supported for hidden layers and the output
layer:

    omit:[-]<input>{,<input>}

This specifies that connections from certain inputs are to be omitted
from those feeding into this layer (assuming that any inputs at all
are looked at, as specifed by later arguments).  If the "-" is placed
before the list of inputs, the list gives the inputs that are NOT
omitted.  Inputs are numbered starting with 1.

For hidden layers, the activation function to use may be specified
using one of the following flags:

    tanh identity sin

The default is tanh, the hyperbolic tangent function.  The identity
flag causes the output of a hidden unit in the layer to be identical
its summed input.  The sin flag specifies that the activation function
to be h(u) = sqrt(2)*sin(sqrt(2)*u).  The multiplications by sqrt(2)
in this activation function make a network with one hidden layer of
this type correspond in the limit of many hidden units to a Gaussian
process model with covariance function given by exp(-distance^2).

Following a "/", the priors for groups of weights, biases, offsets,
and adjustments are specified, in one of two forms.  For the syntax of
a prior specification (except for adjustments), see prior.doc.  If "-"
is given instead of a prior specification (or if a prior specification
is omitted entirely), the parameters in question do not exist at all,
which is equivalent to their being zero.  For adjustments, the prior
is specified by a single "alpha" value.  A value of "-" represents
infinity (effectively eliminating the adjustment).  Omitting a prior
for a set of adjustments also eliminates them.

The first form for the prior specifications, in which groups are
specified by position, is kept primarily for backward compatibility.
In this form, "ti" is the prior for the offsets of input units, "hh"
the prior for hidden-hidden weights, "ih" the prior for input-hidden
weights, "bh" the prior for hidden biases, "th" the prior for hidden
unit offsets, "ho" the prior for weights from a hidden layer to the
outputs, "io" the prior for input-output weights, and "bo" the prior
for output biases.  The order of priors relating to hidden layers is
from the first layer to the last (the last being the one closest to
the output layer).  All the priors relating to a network with the
given number of hidden layers must be present, except that some or all
of the hidden-output priors may be omitted.  The order of "ho" priors
is last to first; if not all are present, it is the priors for
connections from the earlier layers that are absent.  The alpha values
that specify the prior for the "adjustments" to the distributions of
weights and biases going into a given unit are specified following
these priors.

In the second form, groups of parameters are identified by name, as
follows:

    ti      offsets for the inputs
    ih#     weights from inputs to hidden layer # (default for # is 0)
    bh#     biases for hidden layer # (default for # is 0)
    th#     offsets for hidden layer # (default for # is 0)
    hh#     weights from hidden layer #-1 to hidden layer # (default 
            for # is 1)
    ho#     weights from hidden layer # to outputs (default for # is
            the last hidden layer)
    io      weights from inputs to outputs
    bo      biases for outputs
    ah#     adjustments for hidden layer # (default for # is 0)
    ao      adjustments for outputs

The hidden layers are numbered starting with 0.

Note that a data model will also have to be specified (with model-spec)
if any learning is to be done.  

Two records are written to the newly created log file - one with type
'A' with a net_arch structure as data, and one with type 'P' with a
net_priors structure as data.  A record of type 'F' will be written as
well if any flags were specified.  These records have an index of -1.
When the second form of the command is used (with just the log file as
argument), these records are read and the information they contain is
displayed on standard output.

            Copyright (c) 1995-2004 by Radford M. Neal