The Complete SPRLIB & ANNLIB

create_unit

- fill one UNIT structure (LOCAL)

SYNOPSIS

int create_unit (unit, map_id, layer_flag)

ARGUMENTS

UNIT *unit A pointer to the UNIT structure to be filled.
long map_id Necessary to fill the UNIT structure's LayerId field.
long layer_flag Necessary to fill the UNIT structure's UnitName field.

RETURNS

TRUE if an error occured, FALSE if not.

FUNCTION

This function is used to fill in default values in the units in shared weights networks. The UnitName field is filled using DFLT_UNIT_TEXT, layer_flag and the layernames[] array (see SHAREDNET-constants). The UnitId field is filled using the unit_count variable, the Theta.WeightId using weight_count (see SHAREDNET-variables). NumInLinks and NumOutLinks are initialized to 0, the InLinks and OutLinks pointers to NULL. The fields are filled as follows:
InOutIndex Depending on layer_flag, filled using the in_index variable (for input units) or the out_index variable (for output units).
ActFunc If the unit is an input unit, set to NULL; otherwise, set using DFLT_ACT_FUNC.
TransFunc If the unit is an input unit, set to NULL; otherwise, set using DFLT_TRANS_FUNC.
DerTransFunc If the unit is an input unit, set to NULL; otherwise, set using DFLT_DER_TRANS_FUNC.
DerDerTransFunc If the unit is an input unit, set to NULL; otherwise, set using DFLT_DER_DER_TRANS_FUNC.
UnitFlag The appropriate flag from UNIT-flags.
Theta.WeightFlag Set to VARWEIGHT (or FIXWEIGHT for input units).

NOTE

This function is called by create_map.

SEE ALSO

create_sharednet

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