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

this class is used for the individual node and will be (nodes * nodes)-time instantiated

attributes

  • direct access to the x and y values is granted, those show the position of the node in

the square map

  • id => is the uniq and sequential ID of the node
  • weights => values of the current weights are stored in an array of dimension ‘dimensions’.

Weights are of type float

  • instantiated_weight => the values of the first instantiation of weights. these values are

never changed

Methods

Included Modules

Ai4r::Data::Parameterizable

Public Class methods

creates an instance of Node and instantiates the weights the parameters is a uniq and sequential ID as well as the number of total nodes dimensions signals the dimension of the input vector

Public Instance methods

returns the square distance between the current weights and the input the input is a vector/array of the same size as weights at the end, the square root is extracted from the sum of differences

returns the distance in square-form from the instance node to the passed node example: 2 2 2 2 2 2 1 1 1 2 2 1 0 1 2 2 1 1 1 2 2 2 2 2 2 0 being the current node

instantiates the weights to the dimension (of the input vector) for backup reasons, the instantiated weight is stored into @instantiated_weight as well

[Validate]