emergent 8.2.2 BpUnitState_cpp Class Reference
emergent 8.2.2   Home · Wiki Docs For: BpUnitState_cpp · Emergent Help Browser 

BpUnitState_cpp Class Reference

Backprop unit state values

See for more info: Wiki Docs For: BpUnitState_cpp

 #include <BpUnitState_cpp>

defined at: /mnt/ssd/grey/local/include/Emergent/BpUnitState_cpp.h :31-39

Inherits From: UnitState_cpp

Inherited By: BpUnitState_cpp*, BpUnitState_cpp&, const BpUnitState_cpp, BpUnit

Index: SubTypes, Members, Methods, Static Members, Static Methods, Expert Members, Expert Methods

Sub Types


SubType Documentation

enum UnitState_cpp::ExtFlags

indicates type of external input; some flags used in Layer to control usage

ConstantValueDescription
UnitState_cpp::NO_EXTERNAL0x00000000no input
UnitState_cpp::TARG0x00000001a target value used to train the network (value goes in targ field of unit)
UnitState_cpp::EXT0x00000002an external input value that drives activations (value goes in ext field of unit)
UnitState_cpp::COMP0x00000004a comparison value used for computing satistics but not training the network (value goes in targ field of unit)
UnitState_cpp::TARG_EXT0x00000003as both external input and target value
UnitState_cpp::COMP_TARG0x00000005as a comparision and target layer
UnitState_cpp::COMP_EXT0x00000006as a comparison and external input layer
UnitState_cpp::COMP_TARG_EXT0x00000007as a comparison, target, and external input layer

enum UnitState_cpp::UnitFlags

misc unit flags for binary state values

ConstantValueDescription
UnitState_cpp::NO_UNIT_FLAG0x00000000no flags set
UnitState_cpp::LESIONED0x00000001unit is temporarily lesioned (inactivated for all network-level processing functions) -- copied from Unit -- should not be set directly here
UnitState_cpp::UN_FLAG_10x00000002misc unit-level flag for use by algorithms to set binary state (e.g., used in backprop to mark units that have been dropped)
UnitState_cpp::UN_FLAG_20x00000004misc unit-level flag for use by algorithms to set binary state
UnitState_cpp::UN_FLAG_30x00000008misc unit-level flag for use by algorithms to set binary state
UnitState_cpp::UN_FLAG_40x00000010misc unit-level flag for use by algorithms to set binary state


Regular (preferred) Member and Method Documentation

Members

Member Category: Activation

Member Category: Bias

Member Category: State

Member Category: Statistic

Member Category: _NoCategory

Methods

Method Category: Access

Method Category: Learning

Method Category: ObjectMgmt

Method Category: State

Method Category: Statistic

Method Category: Statistics

Method Category: Structure

Method Category: _NoCategory


Member Documentation

Member Category: Activation

UnitState_cpp::act : float

activation value -- what the unit communicates to others

UnitState_cpp::ext : float

external input: drives activation of unit from outside influences (e.g., sensory input)

UnitState_cpp::ext_flag : UnitState_cpp::ExtFlags

tells what kind of external input unit received -- this is normally set by the ApplyInputData function -- it is not to be manipulated directly

UnitState_cpp::net : float

net input value -- what the unit receives from others (typically sum of sending activations times the weights)

UnitState_cpp::targ : float

target value: drives learning to produce this activation value

UnitState_cpp::unit_flag : UnitState_cpp::UnitFlags

misc unit binary state flags -- can be extended in subclasses

Member Category: Bias

UnitState_cpp::bias_dwt : float

change in bias weight value as computed by a learning mechanism

UnitState_cpp::bias_wt : float

bias weight value -- the bias weight acts like a connection from a unit that is always active with a constant value of 1 -- reflects intrinsic excitability from a biological perspective

Member Category: State

UnitState_cpp::disp_pos_x : int

display position within layer (not unit group) -- requires special non-optimized display style if not default position

UnitState_cpp::disp_pos_y : int

display position within layer (not unit group) -- requires special non-optimized display style if not default position

UnitState_cpp::pos_x : int

structural position within group (if unit groups used) or layer -- can also use GetGp/UnXY methods to get structural coordinates based on layer geometry

UnitState_cpp::pos_y : int

structural position within group (if unit groups used) or layer -- can also use GetGp/UnXY methods to get structural coordinates based on layer geometry

Member Category: Statistic

UnitState_cpp::snap : float

current snapshot value, as computed by the Snapshot function -- this can be displayed as a border around the units in the netview

UnitState_cpp::wt_prjn : float

weight projection value -- computed by Network::ProjectUnitWeights (triggered in GUI by setting wt prjn variable in netview control panel to point to a layer instead of NULL) -- represents weight values projected through any intervening layers from source unit (selected unit in netview or passed to ProjectUnitWeights function directly)

Member Category: _NoCategory

BpUnitState_cpp::bias_pdw : float

previous bias weight change

BpUnitState_cpp::dEdA : float

derivative of error wrt activation

BpUnitState_cpp::dEdNet : float

derivative of error wrt net input

BpUnitState_cpp::err : float

error value -- this is E for target units, not dEdA

BpUnitState_cpp::misc1 : float

miscellaneous computational value -- used for exp(netin) in SOFTMAX case, and to hold the index of the most active unit among input connections for MAX_POOL (cast to int)


Method Documentation

Method Category: Access

float UnitState_cpp::GetCnValName ( NetworkState_cpp* nnet, Variant& prjn, int cn_idx, taString& var_nm, bool recv = true )

get recv connection variable value (specified by name, e.g., wt, dwt, pdw) in given projection (can be specified by name or index, defaults to recv -- send if false) at given connection index (cn_idx) -- for use by programs

Show Source Code

float UnitState_cpp::GetUnValName ( NetworkState_cpp* nnet, taString& var_nm )

get unit variable value (specified by name, e.g., act, net, bias_wt) -- for use by programs or other generic access via name variable

Show Source Code

bool UnitState_cpp::SetCnValName ( NetworkState_cpp* nnet, float val, Variant& prjn, int cn_idx, taString& var_nm, bool recv = true )

set recv connection variable (specified by name, e.g., wt, dwt, pdw) in given projection (can be specified by name or index, defaults to recv -- send if false) at given connection index (cn_idx), to given value -- for use by programs, which cannot assign the value through the SafeCn function

Show Source Code

bool UnitState_cpp::SetUnValName ( NetworkState_cpp* nnet, float val, taString& var_nm )

set unit variable (specified by name, e.g., act, net, bias_wt) to given value -- for use by programs, which cannot assign the value through the direct variable access functions (e.g., act())

Show Source Code

Method Category: Learning

void UnitState_cpp::AddNoiseToWeights ( NetworkState_cpp* nnet, Random& noise_spec, PrjnState_cpp* prjn = __null )

add noise to weights using given noise specification -- must call Init_Weights_post at network level after running this!

Show Source Code

void UnitState_cpp::RenormWeights ( NetworkState_cpp* nnet, bool mult_norm, float avg_wt, PrjnState_cpp* prjn = __null )

renormalize the weight values using either multiplicative (for positive-only weight values such as Leabra) or subtractive normalization (for pos/neg weight values, such as backprop) to hit the given average weight value -- must call Init_Weights_post at network level after running this!

Show Source Code

void UnitState_cpp::RescaleWeights ( NetworkState_cpp* nnet, const float rescale_factor, PrjnState_cpp* prjn = __null )

rescale weights by multiplying by given factor -- must call Init_Weights_post at network level after running this!

Show Source Code

void UnitState_cpp::TransformWeights ( NetworkState_cpp* nnet, SimpleMathSpec& trans, PrjnState_cpp* prjn = __null )

apply given transformation to weights -- must call Init_Weights_post at network level after running this!

Show Source Code

Method Category: ObjectMgmt

void UnitState_cpp::Copy_Weights ( NetworkState_cpp* nnet, PrjnState_cpp* prjn, UnitState_cpp* src, PrjnState_cpp* src_prjn )

copies weights from other unit (incl wts assoc with unit bias member) for given projections on each unit

Show Source Code

Method Category: State

int UnitState_cpp::ConnectFrom ( NetworkState_cpp* nnet, UnitState_cpp* su, PrjnState_cpp* prjn, bool alloc_send = false, bool ignore_alloc_errs = false, bool set_init_wt = false, float init_wt = 0.0f )

make a recv connection from given unit to this unit using given projection -- requires both recv and sender to have sufficient connections allocated already, unless alloc_send is true, then it only allocates connections on the sender -- does NOT make any connection on the receiver -- use this in a loop that runs connections twice, with first pass as allocation (then call SendConstPostAlloc) and second pass as actual connection making -- return val is index of recv connection -- can also optionally set initial weight value

Show Source Code

int UnitState_cpp::ConnectFromCk ( NetworkState_cpp* nnet, UnitState_cpp* su, PrjnState_cpp* prjn, bool ignore_alloc_errs = false, bool set_init_wt = false, float init_wt = 0.0f )

does ConnectFrom but checks for an existing connection to prevent double-connections -- note that this is expensive -- only use if there is a risk of multiple connections. This does not support alloc_send option -- can call in 2nd pass if needed -- return val is index of recv connection -- can also optionally set initial weight value

Show Source Code

void UnitState_cpp::CountCons ( NetworkState_cpp* nnet, int& n_recv, int& n_send )

count total number recv, sending connections

Show Source Code

void UnitState_cpp::DisConnectAll ( NetworkState_cpp* nnet )

disconnect unit from all other units

Show Source Code

bool UnitState_cpp::DisConnectFrom ( NetworkState_cpp* nnet, UnitState_cpp* su, PrjnState_cpp* prjn = __null )

remove connection from given unit (projection is optional)

Show Source Code

ConState_cpp* UnitState_cpp::FindRecvConStateFrom ( NetworkState_cpp* nnet, LayerState_cpp* fm_lay )

get receiving connection state from given sending layer

Show Source Code

ConState_cpp* UnitState_cpp::FindRecvConStateFromName ( NetworkState_cpp* nnet, char* fm_layer_nm )

get receiving connection state from given sending layer name

Show Source Code

ConState_cpp* UnitState_cpp::FindSendConStateTo ( NetworkState_cpp* nnet, LayerState_cpp* to_lay )

get sending connection state from given sending layer

Show Source Code

ConState_cpp* UnitState_cpp::FindSendConStateToName ( NetworkState_cpp* nnet, char* to_layer_nm )

get sending connection state to given receiving layer name

Show Source Code

void UnitState_cpp::GetGpUnXY ( NetworkState_cpp* nnet, int& gp_x, int& gp_y, int& un_x, int& un_y )

get group X,Y and unit X,Y coordinates from our overall unit index within the layer -- use this for structural coordinates, not pos_x,y

Show Source Code

void UnitState_cpp::GetGpXY ( NetworkState_cpp* nnet, int& gp_x, int& gp_y )

get group X,Y from our group index within the layer -- use this for structural coordinates, not pos_x,y

Show Source Code

LayerState_cpp* UnitState_cpp::GetOwnLayer ( NetworkState_cpp* nnet )

get the layer state that owns us

Show Source Code

UnGpState_cpp* UnitState_cpp::GetOwnUnGp ( NetworkState_cpp* nnet )

get the unit group state that owns us

Show Source Code

void UnitState_cpp::GetUnFlatXY ( NetworkState_cpp* nnet, int& un_x, int& un_y )

get unit X,Y from our unit index within overall layer (flat index) -- use this for structural coordinates, not pos_x,y

Show Source Code

void UnitState_cpp::GetUnXY ( NetworkState_cpp* nnet, int& un_x, int& un_y )

get unit X,Y from our unit index within a unit group -- use this for structural coordinates, not pos_x,y

Show Source Code

UnitSpec_cpp* UnitState_cpp::GetUnitSpec ( NetworkState_cpp* nnet )

get our unit spec

Show Source Code

bool UnitState_cpp::InSubGp ( )

returns true if this unit lives within a sub-unit-group of layer -- otherwise no groups and is just within overall layer group

Show Source Code

void UnitState_cpp::Lesion ( )

lesion this unit

Show Source Code

int UnitState_cpp::LesionCons ( NetworkState_cpp* nnet, float p_lesion, bool permute = true, PrjnState_cpp* prjn = __null )

remove connections with prob p_lesion (permute = fixed no. lesioned)

Show Source Code

int UnitState_cpp::PruneCons ( NetworkState_cpp* nnet, SimpleMathSpec& pre_proc, Relation::Relations rel, float cmp_val, PrjnState_cpp* prjn = __null )

remove weights that (after pre-proc) meet relation to compare val

Show Source Code

void UnitState_cpp::RecvConsAllocInc ( NetworkState_cpp* nnet, PrjnState_cpp* prjn, int no )

increment size by given no of recv connections -- later call RecvConsPostAlloc to actually allocate connections

Show Source Code

void UnitState_cpp::RecvConsPostAlloc ( NetworkState_cpp* nnet, PrjnState_cpp* prjn )

post-allocate given no of recv connections (calls AllocConsFmSize on recv con state) -- if connections were initially made using the alloc_send = true, then this must be called to actually allocate connections -- then routine needs to call ConnectFrom again to make the connections

Show Source Code

void UnitState_cpp::RecvConsPreAlloc ( NetworkState_cpp* nnet, PrjnState_cpp* prjn, int no )

pre-allocate given no of receiving connections -- sufficient connections must be allocated in advance of making specific connections

Show Source Code

void UnitState_cpp::SendConsAllocInc ( NetworkState_cpp* nnet, PrjnState_cpp* prjn, int no )

increment size by given no of sending connections -- later call SendConsPostAlloc to actually allocate connections

Show Source Code

void UnitState_cpp::SendConsPostAlloc ( NetworkState_cpp* nnet, PrjnState_cpp* prjn )

post-allocate given no of sending connections (calls AllocConsFmSize on send con state) -- if connections were initially made using the alloc_send = true, then this must be called to actually allocate connections -- then routine needs to call ConnectFrom again to make the connections

Show Source Code

void UnitState_cpp::SendConsPreAlloc ( NetworkState_cpp* nnet, PrjnState_cpp* prjn, int no )

pre-allocate given no of sending connections -- sufficient connections must be allocated in advance of making specific connections

Show Source Code

bool UnitState_cpp::ShareRecvConsFrom ( NetworkState_cpp* nnet, UnitState_cpp* shu, PrjnState_cpp* prjn )

share our receiving connection state connection memory for given projection from given other source unit -- shu must appear prior to this layer in the same layer

Show Source Code

void UnitState_cpp::UnLesion ( )

un-lesion this unit

Show Source Code

void UnitState_cpp::UpdtActiveCons ( NetworkState_cpp* nnet )

update the active state of all connection states

Show Source Code

DataTable* UnitState_cpp::VarToTable ( NetworkState_cpp* nnet, DataTable* dt, taString& variable )

send given variable to data table -- number of columns depends on variable (for connection variables, specify r. or s. (e.g., r.wt)) -- this uses a NetMonitor internally, so see documentation there for more information

Show Source Code

bool UnitState_cpp::lesioned ( )

check if this unit is lesioned -- must check for all processing functions (threaded calls automatically exclude lesioned units)

Show Source Code

Method Category: Statistic

bool UnitState_cpp::Snapshot ( Network* nnet, taString& variable, SimpleMathSpec& math_op, bool arg_is_snap = true )

take a snapshot of given variable: assign snap value on unit to given variable value, optionally using simple math operation on that value. if arg_is_snap is true, then the 'arg' argument to the math operation is the current value of the snap variable. for example, to compute intersection of variable with snap value, use MIN and arg_is_snap.

Show Source Code

Method Category: Statistics

DataTable* UnitState_cpp::ConVarsToTable ( NetworkState_cpp* nnet, DataTable* dt, taString& var1, taString& var2, taString& var3, taString& var4, taString& var5, taString& var6, taString& var7, taString& var8, taString& var9, taString& var10, taString& var11, taString& var12, taString& var13, taString& var14, PrjnState_cpp* prjn = __null )

record given connection-level variable to data table with column names the same as the variable names, and one row per *connection* (unlike monitor-based operations which create matrix columns) -- this is useful for performing analyses on learning rules as a function of sending and receiving unit variables -- uses receiver-based connection traversal -- connection variables are just specified directly by name -- corresponding receiver unit variables are 'r.var' and sending unit variables are 's.var' -- prjn restricts to that prjn

Show Source Code

Method Category: Structure

int UnitState_cpp::NRecvConGps ( NetworkState_cpp* nnet )

get number of receiving connection states (determined by number of active layer projections at time of build)

Show Source Code

int UnitState_cpp::NSendConGps ( NetworkState_cpp* nnet )

get number of sending connection states (determined by number of active layer send_prjns at time of build)

Show Source Code

ConState_cpp* UnitState_cpp::RecvConState ( NetworkState_cpp* nnet, int rcg_idx )

get receiving connection state at given index -- no safe range checking is applied to rcg_idx!

Show Source Code

ConState_cpp* UnitState_cpp::RecvConStatePrjn ( NetworkState_cpp* nnet, PrjnState_cpp* prjn )

get con state at given prjn->recv_idx -- if it is not in range, emits error message and returns NULL

Show Source Code

ConState_cpp* UnitState_cpp::RecvConStateSafe ( NetworkState_cpp* nnet, int rcg_idx )

get receiving connection state at given index

Show Source Code

ConState_cpp* UnitState_cpp::SendConState ( NetworkState_cpp* nnet, int scg_idx )

get sendingconnection state at given index -- no safe range checking is applied to scg_idx!

Show Source Code

ConState_cpp* UnitState_cpp::SendConStatePrjn ( NetworkState_cpp* nnet, PrjnState_cpp* prjn )

get con state at given prjn->send_idx -- if it is not in range, emits error message and returns NULL

Show Source Code

ConState_cpp* UnitState_cpp::SendConStateSafe ( NetworkState_cpp* nnet, int scg_idx )

get sending connection state at given index

Show Source Code

Method Category: _NoCategory

void UnitState_cpp::ClearExtFlag ( int flg )

clear flag state (set off)

Show Source Code

void UnitState_cpp::ClearUnitFlag ( int flg )

clear flag state (set off)

Show Source Code

bool UnitState_cpp::HasExtFlag ( int flg )

check if flag is set

Show Source Code

bool UnitState_cpp::HasUnitFlag ( int flg )

check if flag is set

Show Source Code

void UnitState_cpp::SetExtFlag ( int flg )

set flag state on

Show Source Code

void UnitState_cpp::SetExtFlagState ( int flg, bool on )

set flag state according to on bool (if true, set flag, if false, clear it)

Show Source Code

void UnitState_cpp::SetUnitFlag ( int flg )

set flag state on

Show Source Code

void UnitState_cpp::SetUnitFlagState ( int flg, bool on )

set flag state according to on bool (if true, set flag, if false, clear it)

Show Source Code

Static Member and Method Documentation

Static Members

Static Methods


Static Method Documentation


Expert Member and Method Documentation

Expert Members

Expert Member Category: State

Expert Member Category: Statistic

Expert Methods


Expert Member Documentation

Expert Member Category: State

UnitState_cpp::flat_idx : int

index of this unit in a flat array of unit state -- 0 is special null case -- real idx's start at 1

UnitState_cpp::gp_idx : int

index of the sub-unit group this unit belongs in, if this unit belongs in a unit group (always -1 if no unit groups) -- same as layer_gp_idx of owning unit gp

UnitState_cpp::lay_un_idx : int

index of this unit in owning layer ('leaf index') -- index in flat list of units irrespective of group structure

UnitState_cpp::own_lay_idx : int

index of layer that we live in

UnitState_cpp::own_ungp_idx : int

index of unitgroup that we live in within networkstate master list of unit groups (either a sub unit group or the master layer units group)

UnitState_cpp::spec_idx : int

index of unit spec in NetworkState

UnitState_cpp::thr_un_idx : int

thread-based unit index where this unit state lives

UnitState_cpp::thread_no : int

which thread we live on

UnitState_cpp::ungp_un_idx : int

index of unit within owning unit group -- either for a sub-unit-group (at gp_idx) if layer has them, or within master layer units group

Expert Member Category: Statistic

UnitState_cpp::tmp_calc1 : float

temporary calculation variable (used for computing wt_prjn and prossibly other things)


Expert Method Documentation


Copyright © 2017Regents of the University of Colorado, Carnegie Mellon University, Princeton University.
emergent 8.2.2