Top Description Inners Fields Constructors Methods
org.apache.commons.math3.ml.neuralnet.oned

public Class NeuronString

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, .ObjectInputStream, org.apache.commons.math3.ml.neuralnet.Network, .FeatureInitializer, org.apache.commons.math3.exception.NumberIsTooSmallException, .OutOfRangeException

Neural network with the topology of a one-dimensional line. Each neuron defines one point on the line.
Since
3.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final long[]
identifiers

Mapping of the 1D coordinate to the neuron identifiers (attributed by the network instance).

private final Network
network

Underlying network.

private static final long
serialVersionUID

Serial version ID

private final int
size

Number of neurons.

private final boolean
wrap

Wrap.

Constructor Summary

AccessConstructor and Description
pack-priv
NeuronString(boolean
Whether to wrap the dimension (i.e the first and last neurons will be linked together).
wrap
,
double[][]
Arrays that will initialize the features sets of the network's neurons.
featuresList
)

Constructor with restricted access, solely used for deserialization.

public
NeuronString(int
Number of neurons.
num
,
boolean
Whether to wrap the dimension (i.e the first and last neurons will be linked together).
wrap
,
FeatureInitializer[]
Arrays that will initialize the features sets of the network's neurons.
featureInit
)

Creates a one-dimensional network: Each neuron not located on the border of the mesh has two neurons linked to it.

Method Summary

Modifier and TypeMethod and Description
public double[]

Returns:

the features of the neuron at index i.
getFeatures
(int
Neuron index.
i
)

Retrieves the features set from the neuron at location i in the map.

public Network

Returns:

the network.
getNetwork
()

Retrieves the underlying network.

public int

Returns:

the number of neurons.
getSize
()

Gets the number of neurons.

private void
readObject(ObjectInputStream
Input stream.
in
)

Prevents proxy bypass.

private Object

Returns:

the proxy instance that will be actually serialized.
writeReplace
()

Custom serialization.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

identifiersback to summary
private final long[] identifiers

Mapping of the 1D coordinate to the neuron identifiers (attributed by the network instance).

networkback to summary
private final Network network

Underlying network.

serialVersionUIDback to summary
private static final long serialVersionUID

Serial version ID

sizeback to summary
private final int size

Number of neurons.

wrapback to summary
private final boolean wrap

Wrap.

Constructor Detail

NeuronStringback to summary
pack-priv NeuronString(boolean wrap, double[][] featuresList)

Constructor with restricted access, solely used for deserialization.

Parameters
wrap:boolean

Whether to wrap the dimension (i.e the first and last neurons will be linked together).

featuresList:double[][]

Arrays that will initialize the features sets of the network's neurons.

Exceptions
NumberIsTooSmallException:
if num < 2.
NeuronStringback to summary
public NeuronString(int num, boolean wrap, FeatureInitializer[] featureInit)

Creates a one-dimensional network: Each neuron not located on the border of the mesh has two neurons linked to it.
The links are bi-directional. Neurons created successively are neighbours (i.e. there are links between them).
The topology of the network can also be a circle (if the dimension is wrapped).

Parameters
num:int

Number of neurons.

wrap:boolean

Whether to wrap the dimension (i.e the first and last neurons will be linked together).

featureInit:FeatureInitializer[]

Arrays that will initialize the features sets of the network's neurons.

Exceptions
NumberIsTooSmallException:
if num < 2.

Method Detail

getFeaturesback to summary
public double[] getFeatures(int i)

Retrieves the features set from the neuron at location i in the map.

Parameters
i:int

Neuron index.

Returns:double[]

the features of the neuron at index i.

Exceptions
OutOfRangeException:
if i is out of range.
getNetworkback to summary
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:Network

the network.

getSizeback to summary
public int getSize()

Gets the number of neurons.

Returns:int

the number of neurons.

readObjectback to summary
private void readObject(ObjectInputStream in)

Prevents proxy bypass.

Parameters
in:ObjectInputStream

Input stream.

writeReplaceback to summary
private Object writeReplace()

Custom serialization.

Returns:Object

the proxy instance that will be actually serialized.

org.apache.commons.math3.ml.neuralnet.oned back to summary

private Class NeuronString.SerializationProxy

extends Object
implements Serializable
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.ml.neuralnet.oned.NeuronString.SerializationProxy
All Implemented Interfaces
java.io.Serializable

Serialization.

Field Summary

Modifier and TypeField and Description
private final double[][]
featuresList

Neurons' features.

private static final long
serialVersionUID

Serializable.

private final boolean
wrap

Wrap.

Constructor Summary

AccessConstructor and Description
pack-priv
SerializationProxy(boolean
Whether the dimension is wrapped.
wrap
,
double[][]
List of neurons features. neuronList.
featuresList
)

Method Summary

Modifier and TypeMethod and Description
private Object

Returns:

the Neuron for which this instance is the proxy.
readResolve
()

Custom serialization.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

featuresListback to summary
private final double[][] featuresList

Neurons' features.

serialVersionUIDback to summary
private static final long serialVersionUID

Serializable.

wrapback to summary
private final boolean wrap

Wrap.

Constructor Detail

SerializationProxyback to summary
pack-priv SerializationProxy(boolean wrap, double[][] featuresList)
Parameters
wrap:boolean

Whether the dimension is wrapped.

featuresList:double[][]

List of neurons features. neuronList.

Method Detail

readResolveback to summary
private Object readResolve()

Custom serialization.

Returns:Object

the Neuron for which this instance is the proxy.