The Complete SPRLIB & ANNLIB

bp_learn

- perform a number of learning cycles with the backpropagation learning algorithm

SYNOPSIS

int bp_learn (net, data_set, eta, alpha, cycles, options)

ARGUMENTS

NET *net Pointer to a net; must be initialised by bp_init.
DATASET *data_set A pointer to a learning set (must be an IOSET).
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 cycles Number of learning cycles to be performed.
long options See the note below.

RETURNS

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

FUNCTION

The function bp_adapt_net is called cycles times. Depending on the flags specified in options, this function is called with BPUPDATE set when the BPBATCH flag was not specified, or with BPUPDATE not set except for the last sample in dset when the BPBATCH flag was specified. In other words, in the first case the weights are updated for each sample, while in the latter case the accumulated weight changes are applied only once per cycle.

NOTE

In the options parameter the following flags are 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.
BPACCUM (Don't) accumulate the delta's.
BPUPDATE (Don't) update the weights.
BPBATCH (Don't) perform batch-updating backpropagation (i.e. update the weights after the last sample).

Note that the HIST-flags and BP-flags may be ORed. Furthermore, note the following for (BPBATCH, BPACCUM, BPUPDATE) - triples:
0 0 0: Combination does not make sense (nothing is done).
0 0 1: Yields no backpropagation, only updates.
0 1 0: Yields only backpropagation, no updates.
0 1 1: Specifies normal mode, i.e. backpropagation and update.
1 0 0: Combination does not make sense (nothing is done).
1 0 1: Error: impossible combination.
1 1 0: Specifies normal batch mode.
1 1 1: Error: impossible combination.

SEE ALSO

bp_adapt_unit, bp_adapt_weights, bp_adapt_net

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