add_layer( name, size )
:Setup a new layer
component (a layer of processing nodes) and append it to the NN topology. Parameters are:
name
: string, containing name (that also Specifies type) of new layer. Names of predefined layers currently include 'pe'
(same as 'generic'
), 'pass-through'
, 'which-max'
, 'MAM'
, 'LVQ-input'
, 'LVQ-output'
, 'BP-hidden'
, 'BP-output'
, 'perceptron'
(additional names for user-defined components may be used, see note below.)
size
: integer, layer size i.e. number of pe
(Processing Elements or nodes) to create in the layer.
add_connection_set( name )
:Create a new empty connection_set
component (a set of connections between two layers). It does not connect any layers nor contain any connections between specific layer nodes. The set is appended to the NN topology. Parameters are:
name
: string, containing name (that also specifies type) of new empty connection set. Names of predefined connection sets currently include 'generic', 'pass-through'
(which does not multiply weights), 'wpass-through'
(which does multiply weights), 'MAM'
, 'LVQ'
, 'BP'
, 'perceptron'
(additional names for user-defined components may be used, see note below).
create_connections_in_sets( min_random_weight, max_random_weight )
:Find empty, unconnected connection_set
components that are between two layer
s in the topology, and set them up to connect the adjacent layers, adding connections to fully connect their nodes (n x m connections are created, with n and m the number of nodes at each layer respectively). Parameters are:
min_random_weight
: double, minimum value for random initial connection weights.
max_random_weight
: double, maximum value for random initial connection weights.
connect_layers_at( source_pos, destin_pos, name )
:Insert a new empty connection_set
component (a set of connections between two layers) between the layers at specified topology positions, and prepare it to connect them. No actual connections between any layer nodes are created. Parameters are:
source_pos
: integer, position in topology of source layer.
destin_pos
: integer, position in topology of destination layer.
name
: string, containing name (that also specifies type) of new connection set (see above).
fully_connect_layers_at( source_pos, destin_pos, name, min_random_weight, max_random_weight )
:Same as connect_layers_at
but also fills the new connection_set
with connections between the nodes of the two layers, fully connecting the layers (n x m connections are created, with n and m the number of nodes at each layer respectively). Parameters are:
source_pos
: integer, position in topology of source layer.
destin_pos
: integer, position in topology of destination layer.
name
: string, containing name (that also specifies type) of new connection set (see above).
min_random_weight
: double, minimum value for random initial connection weights.
max_random_weight
: double, maximum value for random initial connection weights.
add_single_connection( pos, source_pe, destin_pe, weight )
:Add a connection to a connection_set
that already connects two layers. Parameters are:
pos
: integer, position in topology of connection_set
to which the new connection will be added.
source_pe
: integer, pe
in source layer to connect.
destin_pe
: integer, pe
in destination layer to connect.
weight
: double, value for initial connection weight.
remove_single_connection( pos, con )
:Remove a connection from a connection_set
. Parameters are:
pos
: integer, position in topology of connection_set
.
con
: integer, connection to remove.
size()
:Returns neural network size, i.e. the number of components its topology.
sizes()
:Returns sizes of components in topology.
component_ids()
:Returns an integer vector containing the ids of the components in topology (these ids are created at run-time and identify each NN component).
input_at( pos, data_in )
:Input a data vector to the component (layer) at specified topology index. Returns TRUE if successful. Parameters are:
pos
: integer, position in topology of component to receive input.
data_in
: NumericVector, data to be sent as input to component (sizes must match).
encode_at( pos )
:Trigger the encoding operation of the component at specified topology index (note: depending on implementation, an 'encode' operation usually collects inputs, processes the data, adjusts internal state variables and/or weights, and possibly produces output). Returns TRUE if successful. Parameters are:
recall_at( pos )
:Trigger the recall (mapping, data retrieval) operation of the component at specified topology index (note: depending on implementation, a 'recall' operation usually collects inputs, processes the data, and produces output). Returns TRUE if successful. Parameters are:
encode_all( fwd )
:Trigger the encoding operation of all the components in the NN topology. Returns TRUE if successful. Parameters are:
encode_dataset_unsupervised( data, pos, epochs, fwd )
:Encode a dataset using unsupervised training. A faster method to encode a data set. All the components in the NN topology will perform 'encode' in specified direction. Returns TRUE if successful. Parameters are:
data
: numeric matrix, containing input vectors as rows.
pos
: integer, position in topology of component to receive input vectors.
epochs
: integer, number of training epochs (encoding repetitions of the entire dataset).
fwd
: logical, indicates direction, TRUE to trigger encoding forwards (first-to-last component), FALSE to encode backwards (last-to-first component).
encode_datasets_supervised( i_data, i_pos, j_data, j_pos, j_destination_register, epochs, fwd )
:Encode multiple (i,j) vector pairs stored in two corresponding data sets, using supervised training. A faster method to encode the data. All the components in the NN topology will perform 'encode' in specified direction. Returns TRUE if successful. Parameters are:
i_data
: numeric matrix, data set, each row is a vector i of vector-pair (i,j).
i_pos
: integer, position in topology of component to receive i vectors.
j_data
: numeric matrix, data set, each row is a corresponding vector j of vector-pair (i,j).
j_pos
: integer, position in topology of component to receive j vectors.
j_destination_selector
: integer, selects which internal node (pe) registers will receive vector j, i.e. if 0 internal node register 'input
' will be used (j will become the layer's input), if 1 register 'output
' will be used (j will become the layer's output), if 2 register 'misc
' will be used (implementations may use this as an alternative way to transfer data to nodes without altering current input or output).
epochs
: integer, number of training epochs (encoding repetitions of the entire data).
fwd
: logical, indicates direction, TRUE to trigger encoding forwards (first-to-last component), FALSE to encode backwards (last-to-first component).
recall_dataset( data_in, input_pos, output_pos, fwd )
:Recall (map, retrieve output for) a dataset. A faster method to recall an entire data set. All the components in the NN topology will perform 'recall' in specified direction. Returns numeric matrix containing corresponding output. Parameters are:
data_in
: numeric matrix, containing input vectors as rows.
input_pos
: integer, position in topology of component to receive input vectors.
output_pos
: integer, position in topology of component to produce output.
fwd
: logical, indicates direction, TRUE to trigger 'recall' (mapping) forwards (first-to-last component), FALSE to recall backwards (last-to-first component).
recall_all( fwd )
:Trigger the recall (mapping, data retrieval) operation of all the components in the NN topology. Returns TRUE if successful. Parameters are:
get_output_from( pos )
:Get the current output of the component at specified topology index. If successful, returns NumericVector of output values. Parameters are:
get_output_at( pos )
:Same as get_output_from
, see above.
get_input_at( pos )
:Get the current input of the component at specified topology index (depends on the implementation: for layers, this may be valid after the pe
s (nodes) have performed their input_function
on incoming values; pe
s have an overridable input_function
that collects all incoming values and produces a single value for further processing which is stored at an internal input
register (whose value is retrieved here); by default input_function
performs summation. If successful, returns NumericVector of final input
values. Parameters are:
get_weights_at( pos )
:Get the current weights of the component (connection_set
) at specified topology index. If successful, returns NumericVector of connection weights. Parameters are:
get_weight_at( pos, connection )
:Get the current weight of a connection in component (connection_set
) at specified topology index. If successful, returns weight, otherwise 0. Parameters are:
set_weight_at( pos, connection, value )
:Set the weight of a connection in component (connection_set
) at specified topology index. If successful, returns TRUE. Parameters are:
pos
: integer, position in topology of component to use.
connection
: connection to use.
value
: new weight for connection.
set_misc_values_at( pos, data_in )
:Set the values in the misc
data register that pe
and connection
objects maintain, for objects at specified topology index. If successful, returns TRUE. Parameters are:
pos
: integer, position in topology of component to use.
data_in
: NumericVector, data to be used for new values in misc
registers (sizes must match).
set_output_at( pos, data_in )
:Set the values in the output
data register that pe
objects maintain, for layer
at specified topology index (currenly only layer
components are supported). If successful, returns TRUE. Parameters are:
pos
: integer, position in topology of component to use.
data_in
: NumericVector, data to be used for new values in misc
registers (sizes must match).
print( )
:Print internal NN state, including all components in topology.
outline( )
:Print a summary description of all components in topology.
The following methods are inherited (from the corresponding class):
objectPointer ("RcppClass"), initialize ("RcppClass"), show ("RcppClass")