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

NetworkState_cpp Class Reference

plain C++ implementation of NetworkState

See for more info: Wiki Docs For: NetworkState_cpp

 #include <NetworkState_cpp>

defined at: /mnt/ssd/grey/local/include/Emergent/NetworkState_cpp.h :108-283

Inherited By: NetworkState_cpp*, NetworkState_cpp&, const NetworkState_cpp, BpNetworkState_cpp, LeabraNetworkState_cpp

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

Sub Types


SubType Documentation

enum NetworkState_cpp::WtSaveFormat

ConstantValueDescription
NetworkState_cpp::TEXT0x00000000weights are saved as ascii text representation of digits (completely portable)
NetworkState_cpp::BINARY0x00000001weights are written directly to the file in binary format (no loss in accuracy and more space efficient, but possibly non-portable)

enum NetworkState_cpp::ReadTagStatus

ConstantValueDescription
NetworkState_cpp::TAG_GOT0x00000000got a starting tag <xxx...>
NetworkState_cpp::TAG_END0x00000001got an ending tag </xx>
NetworkState_cpp::TAG_NONE0x00000002no start of < tag there
NetworkState_cpp::TAG_EOF0x00000003got an EOF

enum NetworkState_cpp::NetFlags

flags for network

ConstantValueDescription
NetworkState_cpp::NF_NONE0x00000000
NetworkState_cpp::NETIN_PER_PRJN0x00000001compute netinput per projection instead of a single aggregate value across all inputs (which is the default)
NetworkState_cpp::BUILD_INIT_WTS0x00000002initialize the weights after building the network -- for very large networks, may want to turn this off to save some redundant time
NetworkState_cpp::INIT_WTS_1_THREAD0x00000004use only one (main) thread to initialize weights -- this ensures that runs with different numbers of threads have the same initial weights, but is slower
NetworkState_cpp::SAVE_KILLED_WTS0x00000008if the project is killed while running in a non-interactive mode (e.g., on cluster), save this network's weights (only if network is built and epoch > 0)
NetworkState_cpp::BUILT0x00001000is the network built -- all memory allocated, etc
NetworkState_cpp::INTACT0x00002000if the network is built, is it also still intact, with all the current params set as they were when it was built?
NetworkState_cpp::BUILT_INTACT0x00003000built and intact

enum NetworkState_cpp::WtUpdate

ConstantValueDescription
NetworkState_cpp::ON_LINE0x00000000update weights on-line (after every event) -- this is not viable for dmem processing across trials and is automatically switched to small_batch in that case
NetworkState_cpp::SMALL_BATCH0x00000001update weights every small_batch_n trials
NetworkState_cpp::BATCH0x00000002update weights in batch mode (after every epoch)

enum NetworkState_cpp::TrainMode

ConstantValueDescription
NetworkState_cpp::TEST0x00000000network is only being tested; no learning should occur
NetworkState_cpp::TRAIN0x00000001network is being trained: learning should occur

enum NetworkState_cpp::StateLayerSpecTypes

manual type registry system for all spec types used in state code -- any new spec type MUST be added to this list, extending from N case in the last list, for any derived classes, and each spec must return its appropriate enum in GetStateSpecType() method

ConstantValueDescription
NetworkState_cpp::T_LayerSpec0x00000000base LayerSpec type
NetworkState_cpp::N_NetworkLayerSpecs0x00000001derived classes start from this one -- use class name for subclasses

enum NetworkState_cpp::StatePrjnSpecTypes

manual type registry system for all spec types used in state code -- any new spec type MUST be added to this list, extending from N case in the last list, for any derived classes, and each spec must return its appropriate enum in GetStateSpecType() method

ConstantValueDescription
NetworkState_cpp::T_ProjectionSpec0x00000000base PrjnSpec type
NetworkState_cpp::T_FullPrjnSpec0x00000001
NetworkState_cpp::T_OneToOnePrjnSpec0x00000002
NetworkState_cpp::T_GpOneToOnePrjnSpec0x00000003
NetworkState_cpp::T_MarkerGpOneToOnePrjnSpec0x00000004
NetworkState_cpp::T_GpMapConvergePrjnSpec0x00000005
NetworkState_cpp::T_GpMapDivergePrjnSpec0x00000006
NetworkState_cpp::T_RandomPrjnSpec0x00000007
NetworkState_cpp::T_UniformRndPrjnSpec0x00000008
NetworkState_cpp::T_PolarRndPrjnSpec0x00000009
NetworkState_cpp::T_SymmetricPrjnSpec0x0000000A
NetworkState_cpp::T_TesselPrjnSpec0x0000000B
NetworkState_cpp::T_GpTesselPrjnSpec0x0000000C
NetworkState_cpp::T_TiledGpRFPrjnSpec0x0000000D
NetworkState_cpp::T_TiledGpRFOneToOnePrjnSpec0x0000000E
NetworkState_cpp::T_TiledGpRFOneToOneWtsPrjnSpec0x0000000F
NetworkState_cpp::T_TiledSubGpRFPrjnSpec0x00000010
NetworkState_cpp::T_TiledRFPrjnSpec0x00000011
NetworkState_cpp::T_TiledNovlpPrjnSpec0x00000012
NetworkState_cpp::T_TiledGpMapConvergePrjnSpec0x00000013
NetworkState_cpp::T_TiledDivGpRFPrjnSpec0x00000014
NetworkState_cpp::T_GaussRFPrjnSpec0x00000015
NetworkState_cpp::T_GradientWtsPrjnSpec0x00000016
NetworkState_cpp::T_PFCPrjnSpec0x00000017
NetworkState_cpp::T_BgPfcPrjnSpec0x00000018
NetworkState_cpp::T_ConPoolPrjnSpec0x00000019not converted
NetworkState_cpp::T_SmallWorldPrjnSpec0x0000001Anot converted
NetworkState_cpp::T_ScalarValSelfPrjnSpec0x0000001Bnot converted
NetworkState_cpp::T_SaliencyPrjnSpec0x0000001Cnot converted
NetworkState_cpp::T_CerebConj2PrjnSpec0x0000001Dnot converted
NetworkState_cpp::T_TopoWtsPrjnSpec0x0000001Enot converted
NetworkState_cpp::N_NetworkPrjnSpecs0x0000001Fderived classes start from this one -- use class name for subclasses

enum NetworkState_cpp::StateUnitSpecTypes

manual type registry system for all spec types used in state code -- any new spec type MUST be added to this list, extending from N case in the last list, for any derived classes, and each spec must return its appropriate enum in GetStateSpecType() method

ConstantValueDescription
NetworkState_cpp::T_UnitSpec0x00000000base UnitSpec type
NetworkState_cpp::N_NetworkUnitSpecs0x00000001derived classes start from this one -- use class name for subclasses

enum NetworkState_cpp::StateConSpecTypes

manual type registry system for all spec types used in state code -- any new spec type MUST be added to this list, extending from N case in the last list, for any derived classes, and each spec must return its appropriate enum in GetStateSpecType() method

ConstantValueDescription
NetworkState_cpp::T_ConSpec0x00000000base ConSpec type
NetworkState_cpp::N_NetworkConSpecs0x00000001derived classes start from this one -- use class name for subclasses

enum NetworkState_cpp::NetThrLayStats

stats that require holding threaded layer-level variables for subsequent aggregation

ConstantValueDescription
NetworkState_cpp::SSE0x00000000
NetworkState_cpp::PRERR0x00000001
NetworkState_cpp::N_NetThrLayStats0x00000002


Regular (preferred) Member and Method Documentation

Members

Member Category: Counter

Member Category: Learning

Member Category: Statistic

Member Category: Structure

Member Category: Threads

Methods

Method Category: Activation

Method Category: File

Method Category: Learning

Method Category: State

Method Category: Statistic

Method Category: Structure

Method Category: _NoCategory


Member Documentation

Member Category: Counter

NetworkState_cpp::batch : int

batch counter: number of times network has been trained over a full sequence of epochs (updated by program)

NetworkState_cpp::cycle : int

cycle counter: number of iterations of activation updating (settling) on the current external input pattern (updated by program)

NetworkState_cpp::epoch : int

epoch counter: number of times a complete set of training patterns has been presented (updated by program)

NetworkState_cpp::group : int

group counter: optional extra counter to record sequence-level information (sequence = group of trials)

NetworkState_cpp::tick : int

tick ..counter: optional extra counter to record a level of organization below the trial level (for cases where trials have multiple component elements)

NetworkState_cpp::time : float

the current time, relative to some established starting point, in algorithm-specific units (often miliseconds) -- updated internally by network

NetworkState_cpp::total_trials : int

total number of trials counter: number of external input patterns that have been presented since the weights were initialized -- updated internally by network

NetworkState_cpp::trial : int

trial counter: number of external input patterns that have been presented in the current epoch (updated by program)

Member Category: Learning

NetworkState_cpp::small_batch_n : int

number of events for small_batch learning mode (specifies how often weight changes are synchronized in dmem)

NetworkState_cpp::train_mode : NetworkState_cpp::TrainMode

training mode -- determines whether weights are updated or not (and other algorithm-dependent differences as well). TEST turns off learning

NetworkState_cpp::wt_update : NetworkState_cpp::WtUpdate

weight update mode: when are weights updated (only applicable if train_mode = TRAIN)

Member Category: Statistic

NetworkState_cpp::avg_sse : Average_cpp

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

NetworkState_cpp::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

NetworkState_cpp::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)

NetworkState_cpp::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)

NetworkState_cpp::sse : float

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

NetworkState_cpp::stats : NetStatsSpecs_cpp

parameters controling the computation of statistics

NetworkState_cpp::sum_sse : float

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

Member Category: Structure

NetworkState_cpp::flags : NetworkState_cpp::NetFlags

flags controlling various aspects of network function

NetworkState_cpp::n_cons : int64_t

total number of connections in the network

NetworkState_cpp::n_units : int

total number of units in the network

Member Category: Threads

NetworkState_cpp::threads : NetStateThreadMgr

parallel threading of network computation


Method Documentation

Method Category: Activation

void NetworkState_cpp::Compute_Act ( )

Compute Activation based on net input

Show Source Code

void NetworkState_cpp::Compute_Netin ( )

Compute NetInput: weighted activation from other units

Show Source Code

void NetworkState_cpp::Compute_NetinAct ( )

compute net input from other units and then our own activation value based on that -- use this for feedforward networks to propagate activation through network in one compute cycle

Show Source Code

void NetworkState_cpp::Init_Acts ( )

initialize the unit activation state variables

Show Source Code

void NetworkState_cpp::Init_InputData ( )

Initializes external and target inputs

Show Source Code

void NetworkState_cpp::Init_Sequence ( )

called by NetGroupedDataLoop at the start of a sequence (group) of input data events -- some algorithms may want to have a flag to optionally initialize activations at this point

Show Source Code

bool NetworkState_cpp::NetinPerPrjn ( )

is this network configured to compute net input on a per-prjn basis?

Show Source Code

void NetworkState_cpp::Send_Netin ( )

sender-based computation of net input: weighted activation from other units

Show Source Code

Method Category: File

int NetworkState_cpp::ConsLoadWeights_strm ( istream& strm, ConState_cpp* cg, UnitState_cpp* ru, NetworkState_cpp::WtSaveFormat fmt = TEXT, bool quiet = false )

read weight values in from a simple ordered list of weights (optionally in binary format) -- rval is taMisc::ReadTagStatus, TAG_END if successful -- the connections for both sides must already be allocated, but it can rearrange connections based on save unit indexes for random connectivity etc

Show Source Code

int NetworkState_cpp::LayerLoadWeights_LayerVars ( istream& strm, LayerState_cpp* lay, NetworkState_cpp::WtSaveFormat fmt = TEXT, bool quiet = false )

write layer state values that are key adaptive state that determines network function

Show Source Code

int NetworkState_cpp::LayerLoadWeights_strm ( istream& strm, LayerState_cpp* lay, NetworkState_cpp::WtSaveFormat fmt = TEXT, bool quiet = false, PrjnState_cpp* prjn = __null )

read weight values in from a simple ordered list of weights (optionally in binary fmt) -- rval is taMisc::ReadTagStatus = END_TAG if successful

Show Source Code

void NetworkState_cpp::LayerSaveWeights_LayerVars ( ostream& strm, LayerState_cpp* lay, NetworkState_cpp::WtSaveFormat fmt = TEXT )

write layer state values that are key adaptive state that determines network function

Show Source Code

void NetworkState_cpp::LayerSaveWeights_strm ( ostream& strm, LayerState_cpp* lay, NetworkState_cpp::WtSaveFormat fmt = TEXT, PrjnState_cpp* prjn = __null )

write weight values out in a simple ordered list of weights (optionally in binary fmt)

Show Source Code

bool NetworkState_cpp::NetworkLoadWeights_strm ( istream& strm, bool quiet = false )

read weight values in from a simple ordered list of weights (fmt is read from file)

Show Source Code

void NetworkState_cpp::NetworkSaveWeights_strm ( ostream& strm, NetworkState_cpp::WtSaveFormat fmt = TEXT )

write weight values out in a simple ordered list of weights (optionally in binary fmt)

Show Source Code

int NetworkState_cpp::UnitLoadWeights_strm ( istream& strm, UnitState_cpp* ru, NetworkState_cpp::WtSaveFormat fmt = TEXT, bool quiet = false, PrjnState_cpp* prjn = __null )

read weight values in from a simple ordered list of weights (optionally in binary fmt) -- rval is taMisc::ReadTagStatus, TAG_END if successful

Show Source Code

void NetworkState_cpp::UnitSaveWeights_strm ( ostream& strm, UnitState_cpp* ru, NetworkState_cpp::WtSaveFormat fmt = TEXT, PrjnState_cpp* prjn = __null )

write weight values out in a simple ordered list of weights (optionally in binary fmt)

Show Source Code

Method Category: Learning

void NetworkState_cpp::Compute_Weights ( )

update weights for whole net -- DMem_SumDWts must have already been called if in dmem mode

Show Source Code

void NetworkState_cpp::Compute_dWt ( )

compute weight changes -- the essence of learning

Show Source Code

void NetworkState_cpp::Init_Weights ( )

Initialize the weights -- also inits acts, counters and stats -- does unit level threaded and then does Layers after

Show Source Code

void NetworkState_cpp::Init_Weights_post ( )

post-initialize state variables (ie. for scaling symmetrical weights, other wt state keyed off of weights, etc) -- this MUST be called after any external modifications to the weights, e.g., the TransformWeights or AddNoiseToWeights calls on any lower-level objects (layers, units, con groups)

Show Source Code

void NetworkState_cpp::Init_dWt ( )

Initialize the weight change variables

Show Source Code

Method Category: State

LayerState_cpp* NetworkState_cpp::FindLayerName ( char* lay_name )

find layer of given name

Show Source Code

ConSpec_cpp* NetworkState_cpp::GetConSpec ( int spec_no )

Get con spec at given index

Show Source Code

LayerSpec_cpp* NetworkState_cpp::GetLayerSpec ( int spec_no )

Get layer spec at given index

Show Source Code

LayerState_cpp* NetworkState_cpp::GetLayerState ( int lay_idx )

get layer state for given layer index

Show Source Code

ProjectionSpec_cpp* NetworkState_cpp::GetPrjnSpec ( int spec_no )

Get projection spec at given index

Show Source Code

PrjnState_cpp* NetworkState_cpp::GetPrjnState ( int prjn_idx )

get projection state for given prjn index (organized by receiving projections by layer)

Show Source Code

PrjnState_cpp* NetworkState_cpp::GetSendPrjnState ( int prjn_idx )

get projection state for given sending projection index (see layer prjn_start_idx)

Show Source Code

char* NetworkState_cpp::GetStateSuffix ( )

get the suffix string for this state type ('_cpp', '_cuda', or blank for main)

Show Source Code

UnGpState_cpp* NetworkState_cpp::GetUnGpState ( int ungp_idx )

get unit group state for given ungp index

Show Source Code

UnitSpec_cpp* NetworkState_cpp::GetUnitSpec ( int spec_no )

Get unit spec at given index

Show Source Code

LayerState_cpp* NetworkState_cpp::LayerStateForUn ( int flat_idx )

get layer state for unit at given flat unit index

Show Source Code

void NetworkState_cpp::LayoutUnits ( )

update the UnitState positions based on layer geometry etc

Show Source Code

Method Category: Statistic

void NetworkState_cpp::Compute_EpochStats ( )

compute epoch-level statistics; calls DMem_ComputeAggs (if dmem) and EpochSSE -- specific algos may add more

Show Source Code

void NetworkState_cpp::Compute_PRerr ( )

compute precision and recall error statistics over entire network -- true positive, false positive, and false negative -- precision = tp / (tp + fp) recall = tp / (tp + fn) fmeasure = 2 * p * r / (p + r), specificity, fall-out, mcc.

Show Source Code

void NetworkState_cpp::Compute_SSE ( bool unit_avg = false, bool sqrt = false )

compute sum squared error of activations vs targets over the entire network -- optionally taking the average over units, and square root of the final results

Show Source Code

void NetworkState_cpp::Compute_TrialStats ( )

compute trial-level statistics (SSE and others defined by specific algorithms)

Show Source Code

void NetworkState_cpp::Init_Metrics ( )

this is an omnibus guy that initializes every metric: Counters, Stats, and Timers

Show Source Code

Method Category: Structure

void NetworkState_cpp::CountCons ( )

count connections for all units in network

Show Source Code

bool NetworkState_cpp::RecvOwnsCons ( )

does the receiver own the connections (default) or does the sender?

Show Source Code

Method Category: _NoCategory

void NetworkState_cpp::ClearNetFlag ( NetworkState_cpp::NetFlags flg )

clear flag state (set off)

Show Source Code

bool NetworkState_cpp::HasNetFlag ( NetworkState_cpp::NetFlags flg )

check if flag is set

Show Source Code

bool NetworkState_cpp::IsBuiltIntact ( )

is this network currently built and intact?

Show Source Code

bool NetworkState_cpp::IsIntact ( )

is this network currently intact?

Show Source Code

void NetworkState_cpp::SetNetFlag ( NetworkState_cpp::NetFlags flg )

set flag state on

Show Source Code

void NetworkState_cpp::SetNetFlagState ( NetworkState_cpp::NetFlags 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 Category: File

Static Method Category: Parse


Static Method Documentation

Static Method Category: File

int NetworkState_cpp::SkipWeights_strm ( istream& strm, NetworkState_cpp::WtSaveFormat fmt = TEXT, bool quiet = false )   [static]

skip over weight values in from a simple ordered list of weights (optionally in binary fmt) -- rval is ReadTagStatus = END_TAG if successful

Show Source Code

Static Method Category: Parse

NetworkState_cpp::ReadTagStatus NetworkState_cpp::read_tag ( istream& strm, taString& tag, taString& val )   [static]

read an html-style tag from the file: <XXX ...> tag = XXX, val = ... (optional)

Show Source Code

int NetworkState_cpp::read_till_eol ( istream& strm, bool peek = false )   [static]

eol = end of line

Show Source Code

int NetworkState_cpp::read_till_rangle ( istream& strm, bool peek = false )   [static]

rangle = >

Show Source Code

int NetworkState_cpp::skip_white ( istream& strm, bool peek = false )   [static]

skip over all whitespace

Show Source Code

int NetworkState_cpp::skip_white_noeol ( istream& strm, bool peek = false )   [static]

don't skip end-of-line

Show Source Code

Expert Member and Method Documentation

Expert Members

Expert Member Category: Learning

Expert Member Category: Specs

Expert Member Category: State

Expert Member Category: Statistic

Expert Member Category: Structure

Expert Member Category: _NoCategory

Expert Methods

Expert Method Category: Counter

Expert Method Category: Statistic


Expert Member Documentation

Expert Member Category: Learning

NetworkState_cpp::small_batch_n_eff : int

effective batch_n value = batch_n except for dmem when it = (batch_n / epc_nprocs) >= 1

Expert Member Category: Specs

NetworkState_cpp::con_specs : ConSpec_cpp**

array of pointers to specs

NetworkState_cpp::layer_specs : LayerSpec_cpp**

array of pointers to specs

NetworkState_cpp::n_con_specs_built : int

number of specs

NetworkState_cpp::n_layer_specs_built : int

number of specs

NetworkState_cpp::n_prjn_specs_built : int

number of specs

NetworkState_cpp::n_unit_specs_built : int

number of specs

NetworkState_cpp::prjn_specs : ProjectionSpec_cpp**

array of pointers to specs

NetworkState_cpp::unit_specs : UnitSpec_cpp**

array of pointers to specs

Expert Member Category: State

NetworkState_cpp::con_state_size : int

size in *bytes* of con group objects actually built

NetworkState_cpp::layer_state_size : int

size in *bytes* of the layer_state LayerState

NetworkState_cpp::main_obj : bool

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

NetworkState_cpp::max_thr_n_units : int

maximum number of units assigned to any one thread

NetworkState_cpp::n_layers_built : int

number of state layers when built -- size of state_layers array

NetworkState_cpp::n_prjns_built : int

number of state projections when builtsize of state_layers array

NetworkState_cpp::n_thrs_built : int

number of threads that the network was built for -- must use this number of threads for running network, and rebuild if the number changes

NetworkState_cpp::n_ungps_built : int

number of state unit groups when built -- size of state_ungps array

NetworkState_cpp::n_units_built : int

number of units built -- actually the n+1 size of units_flat

NetworkState_cpp::prjn_state_size : int

size in *bytes* of the prjn_state LayerState

NetworkState_cpp::ungp_state_size : int

size in *bytes* of the ungp_state LayerState

NetworkState_cpp::unit_state_size : int

size in *bytes* of the UnitState

Expert Member Category: Statistic

NetworkState_cpp::cur_cnt_err : float

current cnt_err -- used for computing cnt_err

NetworkState_cpp::epc_prerr : PRerrVals_cpp

precision and recall error values for the entire network, over an epoch or similar larger set of external input patterns

NetworkState_cpp::prerr : PRerrVals_cpp

precision and recall error values for the entire network, for the current external input pattern

NetworkState_cpp::sum_prerr : PRerrVals_cpp

precision and recall error values for the entire network, 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

NetworkState_cpp::max_prjns : int

maximum number of prjns per any given layer or unit in the network

Expert Member Category: _NoCategory

NetworkState_cpp::needs_prjn_pass2 : bool

tmp flag managed by ProjectionSpec Connect_Cons to determine if any projections need a second pass (i.e., if any respond false for pass = 1)

NetworkState_cpp::needs_wt_sym : bool

tmp flag managed by Init_Weights to determine if any connections have the wt_limits.sym flag checked and thus need weight symmetrizing to happen

NetworkState_cpp::pct_cons_vec_chunked : float

average percent of connections that are vector chunked (across owned projections and units)


Expert Method Documentation

Expert Method Category: Counter

void NetworkState_cpp::Init_Counters ( )

initialize all counter variables on network (called in Init_Weights; except batch because that loops over inits!)

Show Source Code

Expert Method Category: Statistic

void NetworkState_cpp::Init_Timers ( )

initialize statistic variables on network

Show Source Code


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