sciSOM.SOM_learn package

Submodules

sciSOM.SOM_learn.train module

class sciSOM.SOM_learn.train.SOM(x_dim, y_dim, input_dim, n_iter, learning_parameters, decay_type='exponential', neighborhood_decay='geometric_series', som_type='Kohonen', mode='batch', save_weight_cube_history=False, gamma_off=False, weight_cube=None, weight_cube_save_states=None, custom_scale_sup_matrix=0, csom_learning_radius=1, histories=False)[source]

Bases: object

SOM class:

SOM object that can be trained and used to classify data. One of the goals of this object will be to switch between different SOM implementations. For now, it will be a simple implementation and the cSOM implementation.

Parameters:
  • x_dim (int)

  • y_dim (int)

  • input_dim (int)

  • n_iter (int)

  • learning_parameters (ndarray)

  • decay_type (str)

  • neighborhood_decay (str)

  • som_type (str)

  • mode (str)

  • save_weight_cube_history (bool)

  • gamma_off (bool)

  • weight_cube (ndarray)

  • weight_cube_save_states (ndarray)

  • custom_scale_sup_matrix (float)

  • csom_learning_radius (int)

  • histories (bool)

Kohonen_SOM(data, indecies)[source]

Train the SOM using the Kohonen algorithm.

cSOM(data, indecies)[source]

Train the SOM using the concious SOM algorithm.

The implementation of the conscience SOM follows NeuralWare’s implementation that is used in the NeuroScope environment and is given in NeuralWare documentation as well as in the documentation of NeuroScope ann-SOMconsc module. For more information you may contact [Erzsébet Merényi](erzsebet@rice.edu):

Prof. Merényi was not consulted on the implementation of sciSOM functions that

intend to mimic NeuroScope functionalities of the same name, nor did she have opportunity to inspect proof of faithfulness to the same-name module in NeuroScope or correctness of the corresponding sciSOM code. Therefore, Dr. Merényi and the NeuroScope group take no responsibility for the likeness and the correctness of the functions implemented to mimic (partial) NeuroScope capabilities in sciSOM.

compute_bmu(data, indecies, iteration)[source]
compute_bmu_cSOM(data, indecies, iteration, suppession_matrix)[source]
compute_neighborhood(x_bmu, y_bmu, radius)[source]

Compute the neighborhood of the BMU.

decay_cSOM(i)[source]

Decides how the learning rate and other parameters will decrease over time ** Not in use yet **

decay_kohonen(i)[source]

Decides how the learning rate and other parameters will decrease over time ** Not in use yet **

neighborhood_function(x_bmu, y_bmu, iter, radius)[source]

Calculate the neighborhood function for the SOM. This function should decay with the distance from the BMU.

train(data)[source]

Train the SOM object.

Parameters: data (np.array): The data to train the SOM on.

weight_cube()[source]

Return the weight cube of the SOM.

sciSOM.SOM_learn.train.check_field_exists(structured_array, field_name)[source]

Check if a field exists in a structured array.

Parameters:
  • structured_array (ndarray)

  • field_name (str)

Return type:

bool

sciSOM.SOM_learn.train.log_parameters(parameters)[source]

Make a log of the parameters used to train the SOM and save this onto a file.

Parameters:

parameters (dict)

Module contents