wolffd@0: wolffd@0:
wolffd@0:wolffd@0: net = glm(nin, nout, func) wolffd@0: net = glm(nin, nout, func, prior) wolffd@0: net = glm(nin, nout, func, prior, beta) wolffd@0:wolffd@0: wolffd@0: wolffd@0:
net = glm(nin, nout, func) takes the number of inputs
wolffd@0: and outputs for a generalized linear model, together
wolffd@0: with a string func which specifies the output unit activation function,
wolffd@0: and returns a data structure net. The weights are drawn from a zero mean,
wolffd@0: isotropic Gaussian, with variance scaled by the fan-in of the
wolffd@0: output units. 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. The optional
wolffd@0: argument alpha sets the inverse variance for the weight
wolffd@0: initialization.
wolffd@0: 
wolffd@0: 
The fields in net are
wolffd@0: 
wolffd@0: type = 'glm' wolffd@0: nin = number of inputs 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:wolffd@0: wolffd@0: wolffd@0:
net = glm(nin, nout, func, prior), in which prior is
wolffd@0: a scalar, allows the field 
wolffd@0: net.alpha in the data structure net to be set, corresponding 
wolffd@0: to a zero-mean isotropic Gaussian prior with inverse variance with
wolffd@0: value prior. Alternatively, prior can consist of a data
wolffd@0: structure with fields alpha and index, allowing individual
wolffd@0: Gaussian priors to be set over groups of weights in the network. Here
wolffd@0: alpha is a column vector in which each element corresponds to a 
wolffd@0: separate group of weights, which need not be mutually exclusive.  The
wolffd@0: membership of the groups is defined by the matrix index in which
wolffd@0: the columns correspond to the elements of alpha. Each column has
wolffd@0: one element for each weight in the matrix, in the order defined by the
wolffd@0: function glmpak, and each element is 1 or 0 according to whether
wolffd@0: the weight is a member of the corresponding group or not.
wolffd@0: 
wolffd@0: 
net = glm(nin, 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: 
glmpak, glmunpak, glmfwd, glmerr, glmgrad, glmtrainCopyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: wolffd@0: wolffd@0: