# KohonenMechanism¶

## 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.

TBD

TBD

TBD

## Class Reference¶

class psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenMechanism(default_variable=None, size=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, or np.matrix of numeric values: default False) – specifies the learning rate used by its learning function. If it is None, the default learning_rate for a LearningMechanism is used; if it is assigned a value, that is used as the learning_rate (see learning_rate for details). learning_function (LearningFunction, function or method : default Kohonen(distance_function=GUASSIAN)) – specifies function used by learning_mechanism to update matrix of learned_projection .
distance_function

Function, function or method : default Gaussian – determines the function used to evaluate the distance of each element from the most active one one identified by selection_function

matrix

2d np.arraymatrix parameter of the learned_projection.

learning_enabled

bool – indicates whether learning is enabled; see learning_enabled for additional details.

learning_rate

float, 1d or 2d np.array, or np.matrix of numeric values : default None – determines the learning rate used by the learning_function of the learning_mechanism (see learning_rate for details concerning specification and default value assignment).

learned_projection

MappingProjectionMappingProjection that projects to the Mechanism and is trained by its learning_mechanism.

learning_function

LearningFunction, function or method – function used by learning_mechanism to update matrix of learned_projection <KohonenMechanism.learned_projection>.

learning_mechanism

LearningMechanism – created automatically if learning is specified, and used to train the learned_projection.

output_ports

Dict[str, OutputPort] – an OrderedDict with the following OutputPorts:

standard_output_ports

list[dict] – list of Standard OutputPort that includes the following in addition to the standard_output_ports of a TransferMechanism:

MAXIMUM_ACTIVITY : 1d array
“one hot” encoding of the most active element of the Mechanism’s value in the last execution.
Returns: instance of KohonenMechanism KohonenMechanism
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 Learning Mechanism – 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;