KohonenMechanism¶
Contents¶
Overview¶
A KohonenMechanism is a subclass of RecurrentTransferMechanism that implements a Kohonen network (brief explanation; nice demo),
which is a particular form of self-organized map (SOM). By
default, a KohonenMechanism uses a KohonenLearningMechanism
and the Kohonen
LearningFunction
to implement implement a form of unsupervised learning that produces the self-organized map.
Creating a KohonenMechanism¶
A KohonenMechanism can be created directly by calling its constructor.
Structure¶
TBD
Learning¶
TBD
Execution¶
TBD
Class Reference¶
- class psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenMechanism(default_variable=None, input_shapes=None, function=None, integrator_function=None, initial_value=None, noise=None, integration_rate=None, integrator_mode=None, clip=None, enable_learning=None, learning_rate=None, learning_function=None, learned_projection=None, additional_output_ports=None, name=None, prefs=None, **kwargs)¶
Subclass of TransferMechanism that learns a self-organized map of its input. See TransferMechanism for additional arguments and attributes.
- Parameters
enable_learning (boolean : default True) – specifies whether the Mechanism should be configured for learning; if it is not (the default), then learning cannot be enabled until it is configured for learning by calling the Mechanism’s
configure_learning
method.learning_rate (scalar, or list, 1d or 2d np.array of numeric values: default False) – specifies the learning rate used by its
learning function
. If it isNone
, the default learning_rate for a LearningMechanism is used; if it is assigned a value, that is used as the learning_rate (seelearning_rate
for details).learning_function (LearningFunction, function or method : default Kohonen(distance_function=GUASSIAN)) – specifies function used by
learning_mechanism
to updatematrix
oflearned_projection
.
- distance_function¶
determines the function used to evaluate the distance of each element from the most active one one identified by
selection_function
- Type
Function, function or method : default Gaussian
- matrix¶
matrix
parameter of thelearned_projection
.- Type
2d np.array
- learning_enabled¶
indicates whether learning is enabled; see
learning_enabled
for additional details.- Type
bool
- learning_rate¶
determines the learning rate used by the
learning_function
of thelearning_mechanism
(seelearning_rate
for details concerning specification and default value assignment).- Type
float, 1d or 2d np.array of numeric values : default None
- learned_projection¶
MappingProjection that projects to the Mechanism and is trained by its
learning_mechanism
.- Type
- learning_function¶
function used by
learning_mechanism
to updatematrix
oflearned_projection
.- Type
LearningFunction, function or method
- learning_mechanism¶
created automatically if learning is specified, and used to train the
learned_projection
.- Type
- output_ports¶
an OrderedDict with the following OutputPorts:
INPUT_PATTERN –
value
is the value of the KohonenMechanism’svariable
, which is provided to the ACTIVATION_OUTPUT InputPort of itslearning_mechanism
.
- Type
Dict[str, OutputPort]
- standard_output_ports¶
list of Standard OutputPort that includes the following in addition to the
standard_output_ports
of a TransferMechanism:- MAXIMUM_ACTIVITY1d array
“one hot” encoding of the most active element of the Mechanism’s
value
in the last execution.
- Type
list[dict]
- Returns
instance of KohonenMechanism
- Return type
- _validate_params(request_set, target_set=None, context=None)¶
Validate FUNCTION and Mechanism params
- _instantiate_attributes_after_function(context=None)¶
Determine numberr of items expected by termination_measure
- configure_learning(learning_function=None, learning_rate=None, learned_projection=None, context=None)¶
Provide user-accessible-interface to _instantiate_learning_mechanism
Configure KohonenMechanism for learning. Creates the following Components:
a LearningMechanism – if the learning_function and/or learning_rate arguments are specified, they are used to construct the LearningMechanism, otherwise the values specified in the KohonenMechanism’s constructor are used;
a MappingProjection from the KohonenMechanism’s primary OutputPort to the LearningMechanism’s ACTIVATION_INPUT InputPort;
a LearningProjection from the LearningMechanism’s LEARNING_SIGNAL OutputPort to the learned_projection; by default this is the KohonenMechanism’s
learned_projection
; however a different one can be specified.
- _projection_added(projection, context=None)¶
Stub that can be overidden by subclasses that need to know when a projection is added to the Mechanism
- property _dependent_components¶
Returns a set of Components that will be executed if this Component is executed
- exception psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenError(message, component=None)¶