Class Ai4r::Som::Som
In: lib/ai4r/som/som.rb
Parent: Object

Introduction

This is an implementation of a Kohonen Self-Organizing Maps

Features

  • Support for any network architecture (number of layers and neurons)
  • Configurable propagation function
  • Optional usage of bias
  • Configurable momentum
  • Configurable learning rate
  • Configurable initial weight function
  • 100% ruby code, no external dependency

Parameters

  • dim => dimension of the input vector
  • number_of_nodes => is the number of nodes per row/column (square som).
  • layer => instante of a layer-algorithm class

About the project

Author:Thomas Kern
License:MPL 1.1
Url:ai4r.rubyforge.org

Methods

Included Modules

Ai4r::Data::Parameterizable

Public Class methods

Public Instance methods

adjusts all nodes within a certain radius to the bmu

finds the best matching unit (bmu) of a certain input in all the @nodes returns an array of length 2 => [node, distance] (distance is of eucledian type, not a neighborhood distance)

returns the node at position (x,y) in the square map

calculates the global distance error for all data entries

intitiates the map by creating (@number_of_nodes * @number_of_nodes) nodes

main method for the som. trains the map with the passed data vector calls train_step as long as train_step returns false

trains the map with the data as long as the @epoch is smaller than the epoch-value of @layer returns true if @epoch is greater than the fixed epoch-value in @layer, otherwise false 1 is added to @epoch at each method call the radius and learning rate is decreased at each method call/epoch as well

[Validate]