• Github
Table of Contents
0.16.1.0+118
  • Welcome to PsyNeuLink
  • Basics and Primer
  • Quick Reference
  • Core
  • Library
  • Contributors Guide
  • Docs >
  • Library >
  • Components >
  • Mechanisms >
  • Processing Mechanisms >
  • Transfer Mechanisms >
  • KohonenMechanism
Shortcuts

KohonenMechanism

Contents

  • Overview

  • Creating a KohonenMechanism

  • Structure
    • Learning

  • Execution

  • Class Reference

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

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 the learned_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 the learning_mechanism (see learning_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:

MappingProjection

learning_function

function used by learning_mechanism to update matrix of learned_projection.

Type:

LearningFunction, function or method

learning_mechanism

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

Type:

LearningMechanism

output_ports

an OrderedDict with the following OutputPorts:

  • RESULT – value is the result of function;

  • INPUT_PATTERN – value is the value of the KohonenMechanism’s variable, which is provided to the ACTIVATION_OUTPUT InputPort of its learning_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:

KohonenMechanism

_validate_params(request_set, target_set=None, context=None)

Validate FUNCTION and Mechanism params

_instantiate_attributes_after_function(context=None)

Determine number of items expected by termination_measure and check clip if specified

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: Components that must have values in a given Context for this Component to execute in that Context

exception psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenError(message, component=None)
Next Previous

© Copyright 2016, Jonathan D. Cohen.

Built with Sphinx using a theme provided by Read the Docs.
  • KohonenMechanism
    • Contents
    • Overview
    • Creating a KohonenMechanism
    • Structure
      • Learning
    • Execution
    • Class Reference
    • KohonenMechanism
      • KohonenMechanism.distance_function
      • KohonenMechanism.matrix
      • KohonenMechanism.learning_enabled
      • KohonenMechanism.learning_rate
      • KohonenMechanism.learned_projection
      • KohonenMechanism.learning_function
      • KohonenMechanism.learning_mechanism
      • KohonenMechanism.output_ports
      • KohonenMechanism.standard_output_ports
      • KohonenMechanism._validate_params()
      • KohonenMechanism._instantiate_attributes_after_function()
      • KohonenMechanism.configure_learning()
      • KohonenMechanism._projection_added()
      • KohonenMechanism._dependent_components
    • KohonenError
  • Github