The Complete SPRLIB & ANNLIB

pn_learn

- perform a number of learning cycles with the pseudo-Newton learning algorithm

SYNOPSIS

int pn_learn (net, data_set, eta, alpha, mu, cycles, options)

ARGUMENTS

NET *net Pointer to a net; must be initialized by pn_init.
DATASET *dset 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.
double mu A small constant used in diverting inflection points in the pseudo-Newton method.
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

After some initial checks, the function pn_adapt_net is called for each SAMPLE in dset. If BPBATCH is specified in options, this function is called with the BPUPDATE flag not set for all samples except the last in dset, so that all weight changes are summed and the weights are only adapted after a complete showing of the set. If the BPBATCH flag was not specified, pn_adapt_net is called with BPUPDATE set.

NOTE

In options, the following flags can 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 together. 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.

Finally, note that this function use the store_hist_all_units, store_hist_all_weights and store_hist_all_thetas functions.

SEE ALSO

pn_adapt_unit, pn_adapt_weights, pn_adapt_net

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