Skip to content

Latest commit

 

History

History
119 lines (66 loc) · 4.05 KB

DOCUMENTATION.md

File metadata and controls

119 lines (66 loc) · 4.05 KB

SelfOrganizingMap


__init__(learning_rate=0, boost_factor=0, input_size=0, node_count=0, winner_count=1, initial_range=(-1,1))

Creates an instance of a self-organizing map.

  • learning_rate is a numerical value that controls the rate at which weights are changed during the learning process.
  • boost_factor is a numerical value that controls the handicap applied to the least-used nodes when selecting a winner/winners.
  • input_size is an integer value that determines the size of the weight vectors associated with each node.
  • node_count is an integer value that determines the number of nodes in the SOM and thus the size of the output vector.
  • winner_count is an integer value that determines the maximum number of nodes that are active at any given time.
  • initial_range is a numerical tuple that dictates the upper and lower limits of the initial random weight values.

load(filename)

Initializes the SelfOrganizingMap with parameters from a json file.

  • filename is a string that matches the directory of an existing json file.

update(sample)

Performs the mapping/learning process for one input (sample) and returns the result.

  • sample is a binary vector with a length equal to the input_size value passed to the SelfOrganizingMap constructor.

train(samples)

Performs the mapping/learning process for multiple inputs (samples).

  • samples is a list of binary vectors that get passed to the update function one-by-one.

test(samples)

Performs the mapping process for multiple inputs (samples) and returns the results without learning.

  • samples is a list of binary vectors that get passed to the update function one-by-one.

set_training(state)

Turns the training process either on or off.

  • state is a boolean value that determines whether or not training occurs.



SelfOrganizingNetwork


__init__(input_size=0, layer_sizes=[], input_percents=[], learning_rates=[], boost_factors=[], node_counts=[], winner_counts=[], initial_ranges=[])

Creates instance of self-organizing memory.

  • input_size is an integer value that determines the size of the weight vectors associated with each node in a SOM.
  • layer_sizes is a list of integers that dictate the size of each layer from the bottom to the top of the hierarchy.
  • input_percents is a list of values that determine the percentage of the input vector that the SOMs in each layer are connected to.
  • learning_rates is a list of numerical values that controls the rate at which weights are changed during the learning process for each layer.
  • boost_factors is a list of numerical values that controls the handicap applied to the least-used nodes for each layer.
  • node_counts is a list of integer values that determines the number of nodes in each SOM for each layer.
  • winner_counts is a list of integers that determine the maximum number of active nodes per SOM for each layer.
  • initial_ranges is a list of numerical tuples that dictates the upper and lower limits of the initial weight values for each layer.

load(filename)

Initializes the SelfOrganizingNetwork with parameters from a json file.

  • filename is a string that matches the directory of an existing json file.

update(sample)

Performs mapping/learning process for one input and returns result.

  • sample is a binary vector with a length equal to the input_size value passed to the SelfOrganizingMemory constructor.

train(samples)

Performs mapping/learning process for multiple inputs (samples).

  • samples is a list of binary vectors that get passed to the update function one-by-one.

test(samples)

Performs mapping process for multiple inputs (samples) and returns the results without learning.

  • samples is a list of binary vectors that get passed to the update function one-by-one.

set_training(state)

Turns the training process either on or off.

  • state is a boolean value that determines whether or not training occurs.