org.apache.commons.math3.ml.neuralnet.twod

## Class NeuronSquareMesh2D

- java.lang.Object
- - org.apache.commons.math3.ml.neuralnet.twod.NeuronSquareMesh2D

- All Implemented Interfaces:
    Serializable

      public class NeuronSquareMesh2D
      extends Object
      implements Serializable

  Neural network with the topology of a two-dimensional surface. Each neuron defines one surface element.
  This network is primarily intended to represent a Self Organizing Feature Map.
  Since:
    3.3
  Version:
    $Id: NeuronSquareMesh2D.java 1566396 2014-02-09 20:36:24Z tn $
  See Also:
    `org.apache.commons.math3.ml.neuralnet.sofm`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NeuronSquareMesh2D(int numRows, boolean wrapRowDim, int numCols, boolean wrapColDim, SquareNeighbourhood neighbourhoodType, FeatureInitializer[] featureInit)` Creates a two-dimensional network composed of square cells: Each neuron not located on the border of the mesh has four neurons linked to it.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Network` | `getNetwork()` Retrieves the underlying network.
    `Neuron` | `getNeuron(int i, int j)` Retrieves the neuron at location `(i, j)` in the map.
    `int` | `getNumberOfColumns()` Gets the number of neurons in each column of this map.
    `int` | `getNumberOfRows()` Gets the number of neurons in each row of this map.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NeuronSquareMesh2D

          public NeuronSquareMesh2D(int numRows,
                            boolean wrapRowDim,
                            int numCols,
                            boolean wrapColDim,
                            SquareNeighbourhood neighbourhoodType,
                            FeatureInitializer[] featureInit)

      Creates a two-dimensional network composed of square cells: Each neuron not located on the border of the mesh has four neurons linked to it.
      The links are bi-directional.
      The topology of the network can also be a cylinder (if one of the dimensions is wrapped) or a torus (if both dimensions are wrapped).
      Parameters:
        `numRows` - Number of neurons in the first dimension.
        `wrapRowDim` - Whether to wrap the first dimension (i.e the first and last neurons will be linked together).
        `numCols` - Number of neurons in the second dimension.
        `wrapColDim` - Whether to wrap the second dimension (i.e the first and last neurons will be linked together).
        `neighbourhoodType` - Neighbourhood type.
        `featureInit` - Array of functions that will initialize the corresponding element of the features set of each newly created neuron. In particular, the size of this array defines the size of feature set.
      Throws:
        `NumberIsTooSmallException` - if `numRows < 2` or `numCols < 2`.

  - ### Method Detail

    - #### getNetwork

          public Network getNetwork()

      Retrieves the underlying network. A reference is returned (enabling, for example, the network to be trained). This also implies that calling methods that modify the `Network` topology may cause this class to become inconsistent.
      Returns:
        the network.

    - #### getNumberOfRows

          public int getNumberOfRows()

      Gets the number of neurons in each row of this map.
      Returns:
        the number of rows.

    - #### getNumberOfColumns

          public int getNumberOfColumns()

      Gets the number of neurons in each column of this map.
      Returns:
        the number of column.

    - #### getNeuron

          public Neuron getNeuron(int i,
                         int j)

      Retrieves the neuron at location `(i, j)` in the map.
      Parameters:
        `i` - Row index.
        `j` - Column index.
      Returns:
        the neuron at `(i, j)`.
      Throws:
        `OutOfRangeException` - if `i` or `j` is out of range.

Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.