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

BpLayer Class Reference

A feedforward backpropagation layer

See for more info: Wiki Docs For: BpLayer

 #include <BpLayer>

defined at: /mnt/ssd/grey/local/include/Emergent/BpLayer.h :31-62

Inherits From: Layer, SpecUser, taNBase, taOBase, taBase

Inherited By: BpLayer*, BpLayer&, const BpLayer

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

Sub Types


SubType Documentation

enum Layer::LayerType

type of layer, used to determine various default settings

ConstantValueDescription
Layer::HIDDEN0x00000000layer does not receive external input of any form
Layer::INPUT0x00000001layer receives external input (EXT) that drives activation states directly
Layer::TARGET0x00000002layer receives a target input (TARG) that determines correct activation states, used for training
Layer::OUTPUT0x00000003layer produces a visible output response but is not a target. any external input serves as a comparison (COMP) against current activations.

enum Layer::LayerFlags

flags for layer

ConstantValueDescription
Layer::LF_NONE0x00000000
Layer::LESIONED0x00000001this layer is temporarily lesioned (inactivated for all network-level processing functions) -- IMPORTANT: use the Lesion and UnLesion functions to set this flag -- they provide proper updating after changes -- otherwise network dynamics will be wrong and the display will not be properly updated
Layer::ICONIFIED0x00000002only display a single unit showing icon_value (set in algorithm-specific manner)
Layer::NO_ADD_SSE0x00000004do NOT add this layer's sse value (sum squared error) to the overall network sse value: this is for all types of SSE computed for ext_flag = TARG (layer_type = TARGET) or ext_flag = COMP (layer_type = OUTPUT) layers
Layer::NO_ADD_COMP_SSE0x00000008do NOT add this layer's sse value (sum squared error) to the overall network sse value: ONLY for ext_flag = COMP (OUTPUT) flag settings (NO_ADD_SSE blocks all contributions) -- this is relevant if the layer type or ext_flags are switched dynamically and only TARGET errors are relevant
Layer::SAVE_UNIT_NAMES0x00000010save the names for individual units in the unit_names matrix on this layer (the Units themselves are never saved) -- when the network is built, these names are then assigned to the units -- use SetUnitNames method to update unit names from unit_names matrix if you've changed them, and GetUnitNames to save current unit names into unit_names matrix
Layer::PROJECT_WTS_NEXT0x00000020this layer is next in line for weight projection operation
Layer::PROJECT_WTS_DONE0x00000040this layer is done with weight projection operation (prevents loops)
Layer::UN_GEOM_NOT_XY0x00000080unit geometry n != x*y -- requires extra math
Layer::LAY_FLAG_10x00000100misc layer flag 1
Layer::LAY_FLAG_20x00000200misc layer flag 2
Layer::LAY_FLAG_30x00000400misc layer flag 3
Layer::LAY_FLAG_40x00000800misc layer flag 2

enum Layer::ExtFlags

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

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


Regular (preferred) Member and Method Documentation

Members

Member Category: Activation

Member Category: Statistic

Member Category: Structure

Member Category: _NoCategory

Member Category: taBase

Methods

Method Category: Access

Method Category: Activation

Method Category: Display

Method Category: File

Method Category: Learning

Method Category: ObjectMgmt

Method Category: State

Method Category: Statistic

Method Category: Structure

Method Category: UserData

Method Category: _NoCategory


Member Documentation

Member Category: Activation

Layer::ext_flag : Layer::ExtFlags

indicates which kind of external input layer received -- this is normally set by the ApplyInputData function -- it is not to be manipulated directly

Layer::layer_type : Layer::LayerType

type of layer: determines default way that external inputs are presented, and helps with other automatic functions (e.g., wizards)

Member Category: Statistic

Layer::avg_sse : Average

average sum squared error over an epoch or similar larger set of external input patterns

Layer::cnt_err : float

count of number of times the sum squared error was above cnt_err_tol over an epoch or similar larger set of external input patterns

Layer::epc_prerr : PRerrVals

precision and recall error values over an epoch or similar larger set of external input patterns

Layer::output_name : taString

name for the output produced by the network (algorithm/program dependent, e.g., unit name of most active unit)

Layer::pct_cor : float

epoch-wise average of count of number of times the sum squared error was below cnt_err_tol over an epoch or similar larger set of external input patterns (= 1 - pct_err -- just for convenience for whichever you want to plot)

Layer::pct_err : float

epoch-wise average of count of number of times the sum squared error was above cnt_err_tol over an epoch or similar larger set of external input patterns (= cnt_err / n)

Layer::sse : float

sum squared error over the network, for the current external input pattern

Member Category: Structure

Layer::brain_area : taString

Which brain area this layer's units should be mapped to in a brain view. Must match a label from the atlas chosen for the network. Layer will not render to brain view if LESIONED flag is checked.

Layer::disp_scale : float

display scale factor for layer -- multiplies overall layer size -- 1 is normal, < 1 is smaller and > 1 is larger -- can be especially useful for shrinking very large layers to better fit with other smaller layers

Layer::dist : LayerDistances

distances from closest input/output layers to this layer

Layer::gp_geom : XYNGeom

geometry of unit sub-groups (if unit_groups) -- this is the layout of the groups, with un_geom defining the layout of units within the groups

Layer::gp_spc : PosVector2i

spacing between unit sub-groups (if unit_groups) -- this is *strictly* for display purposes, and does not affect anything else in terms of projection connectivity calculations etc.

Layer::pos2d_abs : PosVector2i

absolute 2D network view display position of layer always relative to the overall nework (0,0 is lower left hand corner)

Layer::pos_abs : PosVector3i

absolute position of layer always relative to overall network position (0,0,0 is lower left hand corner) -- not relative to owning layer group

Layer::pos_rel : LayerRelPos

position this layer relative to another layer -- this is recommended and keeps positioning adaptive to layer sizes -- just start with one or a few 'anchor' layers with absolute positioning, and position everything else relative to them

Layer::un_geom : XYNGeom

two-dimensional layout and number of units within the layer or each unit group within the layer

Layer::unit_groups : bool

organize units into functional subgroups within the layer (akin to hypercolumns in cortex), with each unit group having the geometry specified by un_geom

Layer::unit_spec : UnitSpec_SPtr

default unit specification for units in this layer

Layer::voxel_fill_pct : float

Percent of brain_area voxels to be filled by units in this layer.

Member Category: _NoCategory

Layer::desc : taString

Description of this layer -- what functional role it plays, how it maps onto the brain, etc

Layer::flags : Layer::LayerFlags

flags controlling various aspects of layer funcdtion

Layer::gp_unit_names_4d : bool

if there are unit subgroups, create a 4 dimensional set of unit names which allows for distinct names for each unit in the layer -- otherwise a 2d set of names is created of size un_geom, all unit groups have the same repeated set of names

Member Category: taBase

taNBase::name : taString

name of the object


Method Documentation

Method Category: Access

BpUnit* BpLayer::GetUnitFlatXY ( int flat_x, int flat_y )

get unit state at given flat X,Y coordinates -- preferred Program interface as no NetworkState arg is required

Show Source Code

BpUnit* BpLayer::GetUnitGpIdxUnXY ( int gp_idx, int un_x, int un_y )

get the unit state at given group index and unit X,Y coordinate -- preferred Program interface as no NetworkState arg is required

Show Source Code

BpUnit* BpLayer::GetUnitGpUnIdx ( int gp_idx, int un_idx )

get unit state at given group and unit indexes -- preferred Program interface as no NetworkState arg is required

Show Source Code

BpUnit* BpLayer::GetUnitGpUnXY ( int gp_x, int gp_y, int un_x, int un_y )

get the unit state at given group X,Y and unit X,Y coordinates -- preferred Program interface as no NetworkState arg is required

Show Source Code

BpUnit* BpLayer::GetUnitGpXYUnIdx ( int gp_x, int gp_y, int un_idx )

get the unit state at given group X,Y coordinate and unit indexes -- preferred Program interface as no NetworkState arg is required

Show Source Code

BpUnit* BpLayer::GetUnitIdx ( int un_idx )

get unit state at given unit index (0..n_units) -- preferred Program interface as no NetworkState arg is required

Show Source Code

UnitState_cpp* Layer::UnitAtDispCoord ( int x, int y )

get unitstate at given *display* coordinates relative to layer -- this takes into account spaces between groups etc

Show Source Code

Method Category: Activation

void Layer::ApplyInputData ( taMatrix* data, Layer::ExtFlags ext_flags = NO_EXTERNAL, Random* ran = __null, PosVector2i* offset = __null, bool na_by_range = false )

apply the 2d or 4d external input pattern to the network, optional random additional values, and offsetting; uses a flat 2-d model where grouped layer or 4-d data are flattened to 2d; frame<0 means from end; na_by_range means that values are not applicable if they fall outside act_range on unit spec, and thus don't have flags or values set

Show Source Code

void Layer::SetLayUnitExtFlags ( int flg )

set external input data flags for layer and all units in the layer

Show Source Code

Method Category: Display

void Layer::DeIconify ( )

de-iconify this layer in the network display (make full size)

Show Source Code

void Layer::Iconify ( )

iconify this layer in the network display (shrink to size of 1 unit, and make them invisible if lesioned)

Show Source Code

void Layer::SetDispScale ( float disp_sc )

set the display scale for the layer -- can change how much space it takes up relative to other layers

Show Source Code

Method Category: File

bool Layer::LoadWeights ( taString& fname, bool quiet = false )

read weight values in from a simple ordered list of weights (fmt is read from file) (leave fname empty to pull up file chooser)

Show Source Code

void Layer::SaveWeights ( taString& fname )

write weight values out in a simple ordered list of weights (optionally in binary fmt) (leave fname empty to pull up file chooser)

Show Source Code

Method Category: Learning

void Layer::AddNoiseToWeights ( Random& noise_spec )

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

Show Source Code

void Layer::Init_Weights ( bool recv_cons )

initialize weights for all of the projections into (recv_cons = true) or out of (recv_cons = false) this layer

Show Source Code

void Layer::TransformWeights ( SimpleMathSpec& trans )

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

Show Source Code

Method Category: ObjectMgmt

bool Layer::ChangeMyType ( TypeDef* new_type )

Change me into a different type of object, copying current info (done through owner)

Show Source Code

taString taNBase::GetName ( )

Get the name of the object

Show Source Code

bool taNBase::HasName ( )

does the object have a name field that can be set?

Show Source Code

void taNBase::MakeNameUnique ( )

make sure my name is unique relative to names of objects associated with my owner (e.g., if it is a list object), typically because my name has changed, and owner needs to ensure that all names are unique

Show Source Code

bool taNBase::SetName ( taString& nm )

Set the object's name

Show Source Code

Method Category: State

void Layer::Copy_Weights ( Layer* src, bool recv_cons )

copy weights from other layer, going projection-by-projection in order by index (only sensible if the layers have matching projection structure) -- either recv or send

Show Source Code

PrjnState_cpp* Layer::FindRecvPrjnFrom ( NetworkState_cpp* net, int send_lay_idx )

find receiving projection from given layer index -- NULL if not found

Show Source Code

PrjnState_cpp* Layer::FindRecvPrjnFromLay ( NetworkState_cpp* net, LayerState_cpp* send_lay )

find receiving projection from given sending layer -- NULL if not found

Show Source Code

PrjnState_cpp* Layer::FindRecvPrjnFromName ( NetworkState_cpp* net, char* fm_layer_nm )

find receiving projection from given layer name -- NULL if not found

Show Source Code

PrjnState_cpp* Layer::FindSendPrjnTo ( NetworkState_cpp* net, int to_lay_idx )

find sending projection to given layer index -- NULL if not found

Show Source Code

PrjnState_cpp* Layer::FindSendPrjnToLay ( NetworkState_cpp* net, LayerState_cpp* to_lay )

find sending projection to given layer -- NULL if not found

Show Source Code

PrjnState_cpp* Layer::FindSendPrjnToName ( NetworkState_cpp* net, char* to_layer_nm )

find sending projection to given layer name -- NULL if not found

Show Source Code

bool Layer::FlatUnIdxInRange ( int un_no )

is flat unit index (for full set of units in layer, regardless of sub unit groups) in range (0 <= idx < n_units)?

Show Source Code

int Layer::GetGpIdxFmXY ( int gp_x, int gp_y )

get group-level index for group X,Y coordinates -- valid for unit groups

Show Source Code

void Layer::GetGpUnXYFmIdx ( int un_idx, int& gp_x, int& gp_y, int& un_x, int& un_y )

get group X,Y and unit X,Y coordinates from overall unit index within the layer

Show Source Code

void Layer::GetGpXYFmIdx ( int gp_idx, int& gp_x, int& gp_y )

get group X,Y from group index within the layer

Show Source Code

LayerState_cpp* Layer::GetLayGpLayer ( NetworkState_cpp* net, int lgp_idx )

get the given layer in the layer group this layer belongs in

Show Source Code

UnGpState_cpp* Layer::GetLayUnGpState ( NetworkState_cpp* net )

get the main unit group state for this layer

Show Source Code

LayerSpec_cpp* Layer::GetLayerSpec ( NetworkState_cpp* net )

get the layer spec for this layer

Show Source Code

LayerState_cpp* Layer::GetLayerState ( NetworkState_cpp* net )

get the layer state for this layer

Show Source Code

PrjnState_cpp* Layer::GetRecvPrjnState ( NetworkState_cpp* net, int prjn_no )

get the receiving projection state for given projection index within this layer (0 = first one for this layer, etc)

Show Source Code

PrjnState_cpp* Layer::GetSendPrjnState ( NetworkState_cpp* net, int prjn_no )

get the sending projection state for given projection index within this layer (0 = first one for this layer, etc)

Show Source Code

void Layer::GetUnFlatXYFmIdx ( int un_idx, int& un_x, int& un_y )

get unit X,Y from flat unit index within layer

Show Source Code

UnGpState_cpp* Layer::GetUnGpState ( NetworkState_cpp* net, int ungp_no )

get the sub-unit group state for given unit group number for this layer

Show Source Code

UnGpState_cpp* Layer::GetUnGpStateXY ( NetworkState_cpp* net, int gp_x, int gp_y )

get the sub-unit group state for given unit group X,Y coordinates

Show Source Code

int Layer::GetUnIdxFmXY ( int un_x, int un_y )

get unit-level index for unit X,Y coordinates -- valid for index within unit group or within entire layer if no unit groups

Show Source Code

void Layer::GetUnXYFmIdx ( int un_idx, int& un_x, int& un_y )

get unit X,Y from unit index within a unit group

Show Source Code

UnitSpec_cpp* Layer::GetUnitSpec ( NetworkState_cpp* net )

get the unit spec for this layer

Show Source Code

UnitState_cpp* Layer::GetUnitState ( NetworkState_cpp* net, int un_no )

get the unit state at given index within full list of units in the layer

Show Source Code

UnitState_cpp* Layer::GetUnitStateFlatXY ( NetworkState_cpp* net, int fl_x, int fl_y )

get the unit state at given flat X,Y coordinates -- NULL if out of range

Show Source Code

UnitState_cpp* Layer::GetUnitStateGpIdxUnXY ( NetworkState_cpp* net, int gp_dx, int un_x, int un_y )

get the unit state at given group index and unit X,Y coordinate

Show Source Code

UnitState_cpp* Layer::GetUnitStateGpUnIdx ( NetworkState_cpp* net, int gp_dx, int un_dx )

get the unit state at given group and unit indexes -- also works for gp_dx = 0 if there are no sub unit groups

Show Source Code

UnitState_cpp* Layer::GetUnitStateGpUnXY ( NetworkState_cpp* net, int gp_x, int gp_y, int un_x, int un_y )

get the unit state at given group X,Y and unit X,Y coordinates

Show Source Code

UnitState_cpp* Layer::GetUnitStateGpXYUnIdx ( NetworkState_cpp* net, int gp_x, int gp_y, int un_dx )

get the unit state at given group X,Y coordinate and unit indexes

Show Source Code

UnitState_cpp* Layer::GetUnitStateSafe ( NetworkState_cpp* net, int un_no )

get the unit state at given index within full list of units in the layer -- safe range checking

Show Source Code

NetworkState_cpp* Layer::GetValidNetState ( )

get our network state -- only will be returned if network is built and intact

Show Source Code

bool Layer::GpIdxInRange ( int gp_no )

is sub unit group index in range? always false if layer does not have unit groups

Show Source Code

bool Layer::HasUnitGroups ( )

does this layer have sub-unit groups

Show Source Code

bool Layer::LayerNameContains ( char* lay_name )

return true if the layer name contains the given string

Show Source Code

bool Layer::LayerNameIs ( char* lay_name )

return true if that is the name of the layer

Show Source Code

void Layer::SetLayerName ( char* lay_name )

set layer name to given name

Show Source Code

void Layer::SyncLayerState ( )

synchronize layer main state with LayerState computational state object -- each variable is either on one side or the other, and sync copies in proper direction

Show Source Code

bool Layer::UnIdxInRange ( int un_no )

is unit index in range according to un_geom_n (0 <= idx < un_geom_n) -- valid for units without sub unit groups or for accessing units within unit group

Show Source Code

Method Category: Statistic

DataTable* Layer::ConVarsToTable ( 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

void Layer::MonitorVar ( NetMonitor* net_mon, taString& variable )

monitor (record in a datatable) the given variable on this layer (can be a variable on the units or connections -- in which case a matrix with a value for each will be created -- e.g., 'act' will monitor activations of all units within the layer)

Show Source Code

BpUnit* BpLayer::MostActiveUnit ( int& idx )

Return the unit with the highest activation (act) value -- index of unit is returned in idx

Show Source Code

DataTable* Layer::PrjnsToTable ( DataTable* dt = __null, bool sending = false )

record the layer projections (receiving unless sending clicked) to given data table, with one row per projection, including the connection and projection specs used

Show Source Code

bool Layer::Snapshot ( 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

DataTable* Layer::VarToTable ( DataTable* dt, taString& variable )

send given variable to data table -- number of columns depends on variable (for projection variables, specify prjns.; 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

DataTable* Layer::WeightsToTable ( DataTable* dt, Layer* send_lay )

send entire set of weights from sending layer to given table (e.g., for analysis), with one row per receiving unit, and the pattern in the event reflects the weights into that unit

Show Source Code

Method Category: Structure

void Layer::CheckSpecs ( )

check to make sure that specs are not null and set to the right type, and update with new specs etc to fix any errors (with notify), so that at least network operations will not crash -- called in Build and CheckConfig

Show Source Code

void Layer::Compute_PrjnDirections ( )

compute the directions of projections based on the relative distances from input/output layers

Show Source Code

void Layer::ConnectBidir ( Layer* lay )

bidirectionally connect with one or more other layers to (receive from and send to other layer(s)) -- makes new projections between layers

Show Source Code

void Layer::ConnectFrom ( Layer* lay )

connect from one or more other layers to this layer (receive from other layer(s)) -- in network view, receiver is FIRST layer selected -- makes a new projection between layers

Show Source Code

void Layer::ConnectSelf ( )

create a new self-connection within this layer (a projection to/from this layer)

Show Source Code

void Layer::DisConnect ( )

disconnect layer from all others

Show Source Code

UnitState_cpp* Layer::FindUnitNamed ( taString& nm, bool err = true )

look in unit_names for given name -- returns flat index of the corresponding unit in the layer if err = true, issues an error if not found

Show Source Code

int Layer::FindUnitNamedIdx ( taString& nm, bool err = true )

look in unit_names for given name -- returns flat index of the corresponding unit in the layer if err = true, issues an error if not found

Show Source Code

void Layer::GetAbsPos ( taVector3i& abs_pos )

get absolute pos, which factors in offsets from layer groups

Show Source Code

void Layer::GetAbsPos2d ( taVector2i& abs_pos )

get absolute pos, which factors in offsets from layer groups

Show Source Code

LayerSpec* Layer::GetMainLayerSpec ( )

get the layer spec for this layer (if used)

Show Source Code

UnitSpec* Layer::GetMainUnitSpec ( )

get the unit spec for this unit -- this is controlled entirely by the layer and all units in the layer have the same unit spec

Show Source Code

void Layer::GetRelPos ( taVector3i& rel_pos )

get relativeabsolute pos, which factors in offsets from layer groups

Show Source Code

taString Layer::GetUnitName ( UnitState_cpp* un )

get name for given unit

Show Source Code

taString Layer::GetUnitNameIdx ( int un_idx )

get name for given unit index within layer

Show Source Code

bool Layer::InLayerSubGroup ( )

is this layer in a layer subgroup or directly in network.layers main layer group?

Show Source Code

void Layer::Lesion ( )

set the lesion flag on layer -- removes it from all processing operations

Show Source Code

int Layer::LesionCons ( float p_lesion, bool permute = true )

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

Show Source Code

void Layer::LesionIconify ( )

set the lesion flag on layer -- removes it from all processing operations -- also iconifies the layer

Show Source Code

int Layer::LesionUnits ( float p_lesion, bool permute = true )

turn on unit LESIONED flags with prob p_lesion (permute = fixed no. lesioned)

Show Source Code

void Layer::MovePos ( int x, int y, int z = 0 )

move position of layer given increment from where it currently is, in 3d space

Show Source Code

void Layer::MovePos2d ( int x, int y )

move 2d position of layer given increment from where it currently is

Show Source Code

void Layer::PositionAbove ( Layer* lay, int space = 2 )

position this layer above other layer -- does this for both 3D and 2D displays, with given amount of space -- sets the pos_rel settings

Show Source Code

void Layer::PositionBehind ( Layer* lay, int space = 2 )

position this layer behind other layer -- does this for both 3D and 2D displays, with given amount of space -- sets the pos_rel settings

Show Source Code

void Layer::PositionRightOf ( Layer* lay, int space = 2 )

position this layer to the right of given other layer -- does this for both 3D and 2D displays, with given amount of space -- sets the pos_rel settings

Show Source Code

int Layer::ProbAddCons ( float p_add_con, float init_wt = 0.0 )

probabilistically add new connections (assuming prior pruning), init_wt = initial weight value of new connection

Show Source Code

int Layer::PruneCons ( SimpleMathSpec& pre_proc, Relation::Relations rel, float cmp_val )

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

Show Source Code

int Layer::ReplaceConSpec ( ConSpec* old_sp, ConSpec* new_sp, bool prompt = true )

switch any connections/projections using old_sp to using new_sp

Show Source Code

int Layer::ReplaceLayerSpec ( LayerSpec* old_sp, LayerSpec* new_sp, bool prompt = false )

switch any layers using old_sp to using new_sp

Show Source Code

int Layer::ReplacePrjnSpec ( ProjectionSpec* old_sp, ProjectionSpec* new_sp, bool prompt = true )

switch any projections using old_sp to using new_sp

Show Source Code

int Layer::ReplaceUnitSpec ( UnitSpec* old_sp, UnitSpec* new_sp, bool prompt = false )

switch any units/layers using old_sp to using new_sp

Show Source Code

void Layer::SetAbsPos ( int x, int y, int z )

set absolute position of layer, regardless of whether it is in a layer group or not - always relative to network 0,0,0

Show Source Code

void Layer::SetAbsPos2d ( int x, int y )

set absolute 2D position of layer, regardless of whether it is in a layer group or not - always relative to network 0,0

Show Source Code

bool Layer::SetLayerSpec ( LayerSpec* layspec )

set the layer specification

Show Source Code

void Layer::SetNUnitGroups ( int n_groups )

set number of unit groups in layer in the gp_geom member -- attempts to lay out geometry in closest to a square that fits all the groups evenly, if possible. note: does NOT rebuild the network. also does not make any changes if current number of groups is same as arg, or arg <= 0 (e.g., for startup arg, just init n_groups to -1 prior to getting arg val so it won't have any effect if arg not passed)

Show Source Code

void Layer::SetNUnits ( int n_units )

set number of units in layer in the un_geom member -- attempts to lay out geometry in closest to a square that fits all the units evenly, if possible. note: does NOT rebuild the network. also does not make any changes if current number of units is same as arg, or arg <= 0 (e.g., for startup arg, just init n_units to -1 prior to getting arg val so it won't have any effect if arg not passed)

Show Source Code

void Layer::SetRelPos ( int x, int y, int z )

set position of layer -- if in a layer group, this is relative to the owning layer group position, otherwise relative to network 0,0,0

Show Source Code

void Layer::SetRelPos2d ( int x, int y )

set 2D position of layer -- if in a layer group, this is relative to the owning layer group position, otherwise relative to network 0,0

Show Source Code

void Layer::SetUnitName ( UnitState_cpp* un, taString& nm )

set name for given unit

Show Source Code

void Layer::SetUnitNameIdx ( int un_idx, taString& nm )

set name for given unit index within layer -- turns on unit name saving if not otherwise engaged yet

Show Source Code

bool Layer::SetUnitNames ( bool force_use_unit_names = false )

update unit names geometry -- if force_use_unit_names is true, then unit_names will be configured to save values it is not already

Show Source Code

bool Layer::SetUnitNamesFromDataCol ( DataCol* unit_names_col, int max_unit_chars = -1 )

set unit names from unit names table column (string matrix with one row) -- max_unit_chars is max length of name to apply to unit (-1 = all)

Show Source Code

bool Layer::SetUnitSpec ( UnitSpec* unitspec )

set unit spec for all units in layer

Show Source Code

void Layer::UnLesion ( )

un-set the lesion flag on layer -- restores it to engage in normal processing

Show Source Code

void Layer::UnLesionDeIconify ( )

un-set the lesion flag on layer -- restores it to engage in normal processing -- also de-iconifies the layer

Show Source Code

void Layer::UnLesionUnits ( )

un-lesion units: turn off all unit LESIONED flags

Show Source Code

bool Layer::UnitSpecUpdated ( )

update unit specs for all units in the layer to use unit_spec (only if changed from last update -- force = do regardless); returns true if changed and all units can use given spec

Show Source Code

void Layer::UpdateGeometry ( )

recompute the layer's full set of size values based on un_geom, gp_geom, gp_space settings

Show Source Code

bool Layer::UpdatePosition ( )

recompute the layer's positioning in 3D space (based on relative positioning) -- returns true if any changes

Show Source Code

bool Layer::VarToVal ( taString& dest_var, float val )

set variable to given value for all units within this layer (must be a float type variable)

Show Source Code

bool Layer::VarToVarCopy ( taString& dest_var, taString& src_var )

copy one unit variable to another (un->dest_var = un->src_var) for all units within this layer (must be a float type variable)

Show Source Code

Method Category: UserData

void taOBase::RemoveAllUserData ( )

get rid of our user data list entirely -- this is done automatically when saving something that has no user data items, but you can also force it with this method -- deletes the whole list

Show Source Code

Method Category: _NoCategory

bool taNBase::AddFromTemplate ( taBase* obj, bool& is_acceptable )

handles drops from toolbar - when adding an object to a program, network, etc - e.g. dropping generic data table onto a program - set is_acceptable for objects 'not handled' but which are acceptable

Show Source Code

bool Layer::ApplySpecToMe ( BaseSpec* spec )

this is the one key method that must be overwritten in each base case to call the proper method to apply the given spec to this object -- returns true upon success, false for failure

Show Source Code

void Layer::ClearExtFlag ( int flg )

clear flag state (set off)

Show Source Code

void Layer::ClearLayerFlag ( int flg )

clear flag state (set off)

Show Source Code

bool Layer::EditConState ( int unit_no, int prjn_idx, bool recv = true )

edit the connection state object containing connections for given unit and projection number, for either recv or sending projections

Show Source Code

bool Layer::EditLayUnGpState ( )

edit the layer unit group state values that drive actual C++ computation

Show Source Code

bool Layer::EditState ( )

edit the layer state values that drive actual C++ computation

Show Source Code

bool Layer::EditUnGpState ( int un_gp_no )

edit the unit group state values for given unit group

Show Source Code

bool Layer::EditUnitState ( int unit_no )

edit the unit state values for given unit number (0 .. n_units-1)

Show Source Code

taBase* taOBase::GetOwner ( )

Show Source Code

TypeDef* BpLayer::GetTypeDef ( )

Show Source Code

bool Layer::HasExtFlag ( int flg )

check if flag is set

Show Source Code

bool Layer::HasLayerFlag ( int flg )

check if flag is set

Show Source Code

bool Layer::Iconified ( )

convenience function for checking iconified flag

Show Source Code

void Layer::SetExtFlag ( int flg )

set flag state on

Show Source Code

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

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

Show Source Code

void Layer::SetLayerFlag ( int flg )

set flag state on

Show Source Code

void Layer::SetLayerFlagState ( int flg, bool on )

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

Show Source Code

void Layer::SetLayerUnitGeom ( int x, int y, bool n_not_xy = false, int n = 0 )

set layer unit geometry (convenience function for programs)

Show Source Code

void Layer::SetLayerUnitGpGeom ( int x, int y, bool n_not_xy = false, int n = 0 )

set layer unit group geometry (convenience function for programs)

Show Source Code

void Layer::TriggerContextUpdate ( )

for algorithms/specs that suport context layers (copy of previous state) this manually triggers an update

Show Source Code

taSigLink** taOBase::addr_sig_link ( )

Show Source Code

bool Layer::lesioned ( )

check if this layer is lesioned -- use in function calls

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 Member Category: Structure

Expert Member Category: _NoCategory

Expert Member Category: taBase

Expert Methods

Expert Method Category: Statistic

Expert Method Category: Structure

Expert Method Category: UserData


Expert Member Documentation

Expert Member Category: State

Layer::flat_geom_n : int

overall flat net two-dimensional layout and number of units within the layer, multiplying un_geom * gp_geom

Layer::flat_geom_x : int

overall flat net two-dimensional layout and number of units within the layer, multiplying un_geom * gp_geom

Layer::flat_geom_y : int

overall flat net two-dimensional layout and number of units within the layer, multiplying un_geom * gp_geom

Layer::gp_geom_n : int

two-dimensional layout and number of unit groups (akin to hypercolumns in cortex) within the layer -- if n_ungps > 0 -- un_geom is geometry of each such unit group

Layer::gp_geom_x : int

two-dimensional layout and number of unit groups (akin to hypercolumns in cortex) within the layer -- if n_ungps > 0 -- un_geom is geometry of each such unit group

Layer::gp_geom_y : int

two-dimensional layout and number of unit groups (akin to hypercolumns in cortex) within the layer -- if n_ungps > 0 -- un_geom is geometry of each such unit group

Layer::gp_spc_x : int

spacing between groups -- for display only

Layer::gp_spc_y : int

spacing between groups -- for display only

Layer::layer_idx : int

index of this layer in the network state_layers list and NetworkState layers array -- -1 if not active..

Layer::layer_name : char_ary

name of this layer -- needed for loading and saving weights

Layer::laygp_lay0_idx : int

index of first layer in the layer group that this layer belongs in -- the first layer takes the lead for whole group -- -1 if not part of a layer group

Layer::laygp_n : int

number of layers in the layer group -- set for all members of the group

Layer::main_obj : bool

true if this is a main-side object (emergent, TA-enabled) as opposed to a State-side object

Layer::n_recv_prjns : int

number of active receiving projections

Layer::n_send_prjns : int

number of active sending projections

Layer::n_ungps : int

number of unit groups beyond main layer one -- 0 = no unit groups -- set during state build

Layer::n_units : int

number of units in the layer

Layer::net_state : NetworkState_cpp*

our own network state

Layer::prjn_start_idx : int

starting index of recv prjns in list of projection states, -1 if none

Layer::send_prjn_start_idx : int

starting index of sending prjns in list of sending projection indexes, -1 if none

Layer::spec_idx : int

layer spec index in list in NetworkState

Layer::un_geom_n : int

two-dimensional layout and number of units within the layer or each unit group within the layer

Layer::un_geom_x : int

two-dimensional layout and number of units within the layer or each unit group within the layer

Layer::un_geom_y : int

two-dimensional layout and number of units within the layer or each unit group within the layer

Layer::ungp_idx : int

unit group index for this layerstate in the networkstate list of unit group state -- this is the main units unit group and subsequent sub-unit-groups are ordered after this one in master list

Layer::unit_spec_idx : int

unit spec index in list in NetworkState

Layer::units_flat_idx : int

starting index for this layer into the network units_flat list, used in threading

Expert Member Category: Statistic

Layer::cur_cnt_err : float

current cnt_err -- used for computing cnt_err

Layer::gp_output_names : String_Matrix

output_name's for unit subgroups -- name for the output produced by the network (algorithm/program dependent, e.g., unit name of most active unit)

Layer::icon_value : float

value to display if layer is iconified (algorithmically determined)

Layer::prerr : PRerrVals

precision and recall error values for this layer, for the current pattern

Layer::sum_prerr : PRerrVals

precision and recall error values over an epoch or similar larger set of external input patterns -- these are always up-to-date as the system is aggregating, given the additive nature of the statistics

Expert Member Category: Structure

Layer::disp_geom : XYNGeom

actual view geometry, includes spaces and groups and everything: the full extent of units within the layer

Layer::flat_geom : XYNGeom

geometry of the units flattening out over unit groups -- same as un_geom if !unit_groups; otherwise un_geom * gp_geom -- this is in logical, structural (not display) sizes -- the n here is the total number of units that will be created

Layer::own_net : Network*

Network this layer is in

Layer::pos : PosVector3i

position of layer relative to owning layer group, or overall network position if none (0,0,0 is lower left hand corner) -- see network ABS_POS flag for which position is used by default -- can use SetRelPos or SetAbsPos to set position either way

Layer::pos2d : PosVector2i

2D network view display position of layer relative to owning layer group, or overall nework position if none (0,0 is lower left hand corner) -- see network ABS_POS flag for which position is used by default -- can use SetRelPos2d or SetAbsPos2d to set position either way

Layer::projections : Projection_Group

group of receiving projections

Layer::scaled_disp_geom : XYNGeom

scaled actual view geometry: disp_scale * disp_geom -- use for view computations

Layer::send_prjns : Projection_Group

group of sending projections

Expert Member Category: _NoCategory

Layer::n_units_built : int

number of units actually built in this layer -- use this for all iteration over units at the layer level!

Layer::unit_names : String_Matrix

set unit names from corresponding items in this matrix (dims=2 for no group layer or to just label main group, dims=4 for grouped layers, dims=0 to disable)

Layer::units_lesioned : bool

if units were lesioned in this group, don't complain about rebuilding!

Expert Member Category: taBase

taOBase::owner : taBase*

pointer to owner

taOBase::user_data_ : UserDataItem_List*

storage for user data (created if needed) DO NOT ACCESS this list directly -- use the GetUserData / SetUserData etc interface!


Expert Method Documentation

Expert Method Category: Statistic

void Layer::Init_Stats ( )

initialize statistic variables on layer -- called by Network Init_Stats

Show Source Code

Expert Method Category: Structure

void Layer::GetLocalistName ( )

look for a receiving projection from a single unit, which has a name: if found, set our unit name to that name (also sets unit_names)

Show Source Code

void Layer::PropagateInputDistance ( )

propagate my input distance (dist.fm_input) to layers I send to

Show Source Code

void Layer::PropagateOutputDistance ( )

propagate my output distance (dist.fm_output) to layers I receive from

Show Source Code

void Layer::SyncSendPrjns ( )

synchronize sending projections with the recv projections so everyone's happy

Show Source Code

void Layer::UpdateAllPrjns ( )

update all the sending and recv prjns for this layer -- e.g., after lesions

Show Source Code

void Layer::UpdateSendPrjnNames ( )

update sending prjn names to reflect any name change that might have occured with this layer

Show Source Code

Expert Method Category: UserData

UserDataItem_List* taOBase::GetUserDataList ( bool force = false )

gets the userdatalist for this class

Show Source Code


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