wolffd@0: wolffd@0: wolffd@0: wolffd@0: Netlab Reference Manual mlp wolffd@0: wolffd@0: wolffd@0: wolffd@0:

mlp wolffd@0:

wolffd@0:

wolffd@0: Purpose wolffd@0:

wolffd@0: Create a 2-layer feedforward network. wolffd@0: wolffd@0:

wolffd@0: Synopsis wolffd@0:

wolffd@0:
wolffd@0: net = mlp(nin, nhidden, nout, func)
wolffd@0: net = mlp(nin, nhidden, nout, func, prior)
wolffd@0: net = mlp(nin, nhidden, nout, func, prior, beta)
wolffd@0: 
wolffd@0: wolffd@0: wolffd@0:

wolffd@0: Description wolffd@0:

wolffd@0: net = mlp(nin, nhidden, nout, func) takes the number of inputs, wolffd@0: hidden units and output units for a 2-layer feed-forward network, wolffd@0: together with a string func which specifies the output unit wolffd@0: activation function, and returns a data structure net. The wolffd@0: weights are drawn from a zero mean, unit variance isotropic Gaussian, wolffd@0: with varianced scaled by the fan-in of the hidden or output units as wolffd@0: appropriate. This makes use of the Matlab function wolffd@0: randn and so the seed for the random weight initialization can be wolffd@0: set using randn('state', s) where s is the seed value. wolffd@0: The hidden units use the tanh activation function. wolffd@0: wolffd@0:

The fields in net are wolffd@0:

wolffd@0: 
wolffd@0:   type = 'mlp'
wolffd@0:   nin = number of inputs
wolffd@0:   nhidden = number of hidden units
wolffd@0:   nout = number of outputs
wolffd@0:   nwts = total number of weights and biases
wolffd@0:   actfn = string describing the output unit activation function:
wolffd@0:       'linear'
wolffd@0:       'logistic
wolffd@0:       'softmax'
wolffd@0:   w1 = first-layer weight matrix
wolffd@0:   b1 = first-layer bias vector
wolffd@0:   w2 = second-layer weight matrix
wolffd@0:   b2 = second-layer bias vector
wolffd@0: 
wolffd@0: wolffd@0: Here w1 has dimensions nin times nhidden, b1 has wolffd@0: dimensions 1 times nhidden, w2 has wolffd@0: dimensions nhidden times nout, and b2 has wolffd@0: dimensions 1 times nout. wolffd@0: wolffd@0:

net = mlp(nin, nhidden, nout, func, prior), in which prior is wolffd@0: a scalar, allows the field net.alpha in the data structure wolffd@0: net to be set, corresponding to a zero-mean isotropic Gaussian wolffd@0: prior with inverse variance with value prior. Alternatively, wolffd@0: prior can consist of a data structure with fields alpha wolffd@0: and index, allowing individual Gaussian priors to be set over wolffd@0: groups of weights in the network. Here alpha is a column vector wolffd@0: in which each element corresponds to a separate group of weights, wolffd@0: which need not be mutually exclusive. The membership of the groups is wolffd@0: defined by the matrix indx in which the columns correspond to wolffd@0: the elements of alpha. Each column has one element for each wolffd@0: weight in the matrix, in the order defined by the function wolffd@0: mlppak, and each element is 1 or 0 according to whether the wolffd@0: weight is a member of the corresponding group or not. A utility wolffd@0: function mlpprior is provided to help in setting up the wolffd@0: prior data structure. wolffd@0: wolffd@0:

net = mlp(nin, nhidden, nout, func, prior, beta) also sets the wolffd@0: additional field net.beta in the data structure net, where wolffd@0: beta corresponds to the inverse noise variance. wolffd@0: wolffd@0:

wolffd@0: See Also wolffd@0:

wolffd@0: mlpprior, mlppak, mlpunpak, mlpfwd, mlperr, mlpbkp, mlpgrad
wolffd@0: Pages: wolffd@0: Index wolffd@0:
wolffd@0:

Copyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: wolffd@0: wolffd@0: