The Complete SPRLIB & ANNLIB

koh_adapt_net

- adapt a net's weights according to the Kohonen learning rule

SYNOPSIS

int koh_adapt_net (net, alpha, radius, options)

ARGUMENTS

NET *net A pointer to the NET structure under consideration.
double alpha The learning rate.
double radius The radius of the region around the winning unit in which the units should be adapted.
long options A flag - see below (FUNCTION).

RETURNS

TRUE if an error was detected, FALSE otherwise.

FUNCTION

The options paramter should be of type HIST-flags and KOHONEN-flags. In this function, only the Kohonen flag KOH_KERNEL_UPD is used (set (1) or reset (0)). The function finds, for a certain input, the winning unit using best_matching_unit. Then, for each unit in the network, the distance to the winning unit is calculated. If the KOH_KERNEL_UPD flag is set in options, all units are updated using a Gaussian weighing function on the distance to the winning unit, i.e. the learning rate alpha is replaced by alpha * exp (-distance/radius). If this flag is not set, only units within the region given by radius are updated and the others are not.

NOTE

This function is used by the koh_learn function. The distance between a unit and the winning unit is calculated using a bit-shifting technique based on the indexing of the units. That is, in a unit's index (4 bytes), each byte stands for the position in one dimension. By substracting the byte values, squaring them and finally adding them for all dimensions, the square of the unit distance can be calculated.

SEE ALSO

koh_learn

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