The Complete SPRLIB & ANNLIB

samann_adapt_unit

- adapt a unit according to SAMANN learning rule

SYNOPSIS

int samann_adapt_unit (unit, eta, alpha, options, pass, lambda, set_dist, map_dist)

ARGUMENTS

UNIT *unit A pointer to a UNIT structure.
double eta The coefficient eta (the learning rate) of the backpropagation rule.
double alpha The coefficient alpha (the momentum term) of the backpropagation rule.
long options See note below.
int pass The pass for which this function is called: 1 or 2 - see below.
double lambda The Sammon constant - see samann_lambda.
double set_dist The distance in the original set between the sample shown in pass 1 and that shown in pass 2.
double map_dist The current distance in the map between the sample shown in pass 1 and that shown in pass 2.

RETURNS

TRUE if an error was detected, FALSE if no error was detected.

FUNCTION

This function is used in adapting one unit. The SAMANN learning rule works by drawing two samples from the dataset and updating the weights according to the difference between the network output for the first and the second sample. If pass = 1, the routine only stores the output of each unit in that unit's SAMANN_STRUCT. If pass = 2, the incoming weights are updated. For a full description of the learning rule, see: Mao, J. and Jain, A.K., Artificial neural networks for feature extraction and multivariate data projection, IEEE Transactions on Neural Networks, 6(2):296-317, 1995. The set_dist and map_dist parameters are used in the calculation of the error.

NOTE

In options the following flags can to be specified:
HISTU (Don't) store history of unit values at each update.
HISTT (Don't) store history of unit thetas at each update.
HISTW (Don't) store history of weights at each update.
SAACCUM (Don't) accumulate the delta's.
SAUPDATE (Don't) update the weights.
SAOLDPRP (Don't) backpropagate using the original weights (i.e., the weights as they were before this update of the network).

Note that the individual HIST-flags and SAMANN-flags may be OR'ed together. The update process is divided into two phases: first, the weight-change is computed (optionally, only if SAACCUM is set), then the actual weight-change is done (optionally, only if SAUPDATE is set). Also, note that by default (when SAOLDPRP is not set) the newly calculated weight-change is performed immediately (assuming SAACCUM and SAUPDATE are set), while the standard rule, in which weight-changes are made effective only in the next cycle, requires SAOLDPRP to be set. In effect, not specifying SAOLDPRP causes a random disturbance of the minimization process which might result in a speed up, but may cause problems in difficult learning processes. Furthermore, note the following for (SAACCUM, SAUPDATE) - pairs:
0 0 Combination does not make sense (nothing is done).
0 1 Yields no backpropagation, only updates.
1 0 Yields only backpropagation, no updates.
1 1 Specifies normal mode, i.e. backpropagation and update.

This function is used by samann_adapt_net.

SEE ALSO

samann_adapt_net, samann_learn

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998