The Complete SPRLIB & ANNLIB

create_ml_units

- create all the units needed for a maximum likelihood network (LOCAL)

SYNOPSIS

int create_ml_units (UnitVect, HidVect, net)

ARGUMENTS

int *UnitVect A vector containing 3 elements: the number of input units; the total number of kernels and the number of output units (classes), in that order.
int *HidVect A vector specifying, for each class, the number of hidden units.
NET *net The NET structure to which the units have to be attached.

RETURNS

TRUE in case of an error, FALSE in case of success.

FUNCTION

This function allocates all units necessary for a maximum likelihood network and fills their fields with default values. In more detail: first, the input units are allocated (using malloc_unit) and filled. UnitName is set to "Input terminal", the UnitId field is filled with increasing values and the LayerId field is set to 1. UnitFlag is set to INUNIT (see UNIT-flags) and the InOutIndex field is correctly filled. Finally, the bias (theta) is disabled by setting Theta.WeightFlag to FIXWEIGHT (see WEIGHT-flags) and the activation and transfer functions (ActFunc, TransFunc, DerTransFunc) are set to NULL. Secondly, the hidden units are created. These units are given a MLUNIT_TEXT (see MLNET-constants) UnitName and a HIDUNIT UnitFlag. The LayerId is set to 2. The bias (theta) is enabled by setting Theta.WeightFlag to VARWEIGHT. Furthermore, these units are kernels of which the amplitude (height) and variance have to be learned: thus, they get an ActInprod activation function and a TransGauss and DerTransGauss (derivative) transfer function. The NumInLinks field is set to the number of input units; the NumOutLinks field is set to 1. Finally, all output units are constructed. The UnitName is again set to MLUNIT_TEXT; the UnitFlag is OUTUNIT. The LayerId is set to 3. The bias is disabled (Theta.Weightflag = FIXWEIGHT) and the InOutIndex is correctly set. The activation function is set to be ActInprod; the transfer functions are linear (TransLinear , DerTransLinear). The NumInLinks is set to the number of hidden units, the NumOutLinks to 0. All units are put into a double linked list and attached to net 's FirstUnit and LastUnit pointers.

NOTE

This function is used by create_mlnet.

SEE ALSO

create_ml_links, create_ml_weights, create_mlnet

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