|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.ai.neurocomputing.NeuralNetwork
org.jscience.computing.ai.neurocomputing.KohonenNN
public class KohonenNN
This class provides a simple implementation of a two-dimensional Kohonen
self- organizing map. KohonenNN.train only implements one
iteration of the training algorithm, and as such does not handle the
learning rate and neighbourhood alterations. KohonenTrainer
provides the necessary implementation for that.
train(double[],
double[]),
KohonenTrainer,
KohonenTrainer.doStep()| Field Summary | |
|---|---|
protected int |
featureVectors
The number of feature vectors |
protected int |
height
The height of the network. |
protected double |
k
The learning constant. |
protected int |
neighbourhoodRadius
The neighbourhood radius used during learning. |
protected double[][][] |
weights
The network's weights. |
protected int |
width
The width of the network. |
| Fields inherited from class org.jscience.computing.ai.neurocomputing.NeuralNetwork |
|---|
activation, visualization |
| Constructor Summary | |
|---|---|
KohonenNN()
Creates a new instance of KohonenNN |
|
KohonenNN(int w,
int h)
Create a new instance of the network with additional size information. |
|
KohonenNN(int w,
int h,
int v)
Creates a new KohonenNN object. |
|
| Method Summary | |
|---|---|
int[] |
getClosestNeuron(double[] input)
Retrieves the closest neuron to the input point. |
int |
getFeatureVectors()
DOCUMENT ME! |
int |
getHeight()
Return the height of the network. |
double |
getK()
Retrieve the K-value. |
int |
getNeighbourhoodRadius()
Retrieve the neighbourhood radius. |
double[][][] |
getWeights()
Return the array of PlotPoints used to store the
weights. |
int |
getWidth()
Return the width of the network. |
void |
initialize()
Initialize the network. |
void |
initialize(double min,
double max)
Initialize the network. |
void |
reduceK(double kd)
Reduce the learning constant by a specified amount. |
void |
reduceNeighbourhoodRadius(int nrd)
Reduces the neighbourhood radius by the specified amount. |
double |
run(double[] inputData)
Run the network for a given input. |
void |
setDimensions(int w,
int h,
int v)
Set the dimensions of the network. |
void |
setK(double nk)
Set k, the learning constant. |
void |
setNeighbourhoodRadius(int nr)
Set the neighbourhood radius used during training. |
double |
train(double[] inputData,
double[] expectedOutput)
Train the network using KohonenData. |
| Methods inherited from class org.jscience.computing.ai.neurocomputing.NeuralNetwork |
|---|
getVisualization, render, setActivation, setVisualization, train, train, writeImage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int width
protected int height
protected int featureVectors
protected double k
protected double[][][] weights
protected int neighbourhoodRadius
| Constructor Detail |
|---|
public KohonenNN()
public KohonenNN(int w,
int h)
w - the width of the network.h - the height of the network.
public KohonenNN(int w,
int h,
int v)
w - DOCUMENT ME!h - DOCUMENT ME!v - DOCUMENT ME!| Method Detail |
|---|
public void setDimensions(int w,
int h,
int v)
w - the width of the network.h - the height of the network.v - DOCUMENT ME!public int getWidth()
public int getHeight()
public int getFeatureVectors()
public void setNeighbourhoodRadius(int nr)
nr - the new neighbourhood radius.public int getNeighbourhoodRadius()
public void reduceNeighbourhoodRadius(int nrd)
nrd - the neighbourhood radius delta. The delta is subtracted from
the current neighbourhood radius.public void setK(double nk)
nk - the new value of k.public double getK()
public void reduceK(double kd)
kd - the k delta. This value will be subtracted from the
current k.public void initialize()
initialize in class NeuralNetwork
public void initialize(double min,
double max)
min - the minimum value.max - the maximum value.
java.lang.IllegalArgumentException - DOCUMENT ME!public int[] getClosestNeuron(double[] input)
input - input x
PlotPoint) closest in distance to the
inputs.public double run(double[] inputData)
run in class NeuralNetworkinputData - the input data.
public double train(double[] inputData,
double[] expectedOutput)
KohonenData. This
implementation of the training algorithm only trains for one iteration,
using the given learning rate and neighbourhood size. See the
main function for a complete training cycle.
train in class NeuralNetworkinputData - the input data.expectedOutput - unused.
public double[][][] getWeights()
PlotPoints used to store the
weights. Useful for plotting the weights on a grid.
PlotPoints.org.jscience.computing.ai.util.PlotGrid#setGridPoints(PlotPoint[][])
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||