|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object databionics.esom.grid.Grid
public abstract class Grid
Abstract base class for a grid structure. A grid is a collection of weight vectors (neurons) in a grid structure. The grid concept encapsules the shape of the grid, the topology of the grid and the distance betweeen the neurons on the grid. The neurons should be uniquely numbered with 0..N-1 and be accessible via the method getNeuron(int index). The neighbors of a neuron should be can be found with the method findNeighbors(int index, IntArrayList neighbors, IntArrayList distances). Both these methods need to be implemented in subclasses. The name of all subclasses should roughly adhere to the following naming convention, consisting of
Field Summary | |
---|---|
protected int |
dim
number weights per neuron |
protected cern.colt.function.VectorVectorFunction |
distanceFunction
distance function in data space |
protected java.lang.String |
distanceFunctionName
distance function name for debugging |
protected static org.apache.log4j.Logger |
log
interface to log4j system |
protected int |
size
number of grid points |
Constructor Summary | |
---|---|
Grid()
Standard constructor |
|
Grid(int size,
int dim)
Constructor with size |
Method Summary | |
---|---|
int |
dim()
Get the value of dim. |
abstract void |
findNeighbors(int index,
int radius,
cern.colt.list.IntArrayList neighbors,
cern.colt.list.IntArrayList distances)
Find all neighbors of a neuron within a given radius along with the distance from the center. |
cern.colt.function.VectorVectorFunction |
getDistanceFunction()
Get the distance function in data space |
java.lang.String |
getDistanceFunctionName()
Get the name distance function in data space |
abstract cern.colt.matrix.DoubleMatrix1D |
getNeuron(int index)
Access to a weight vector by the neuron's index. |
void |
init(Descriptives desc)
Initialize all weights by a normal distribution. |
void |
init(java.lang.String method,
Descriptives desc)
Initialize all weights by a given method. |
void |
init(java.lang.String method,
Descriptives desc,
cern.jet.random.engine.RandomEngine random)
Initialize all weights by a given method. |
void |
setDim(int dim)
Set the value of dim. |
void |
setDistanceFunction(cern.colt.function.VectorVectorFunction v)
Set the distance function in data space |
void |
setDistanceFunction(cern.colt.function.VectorVectorFunction v,
java.lang.String n)
Set the distance function in data space |
void |
setSize(int size)
Set the value of size. |
int |
size()
Get the value of size. |
int |
transformRadius(int radius)
How to transform an official radius into the internal format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger log
protected int size
protected int dim
protected cern.colt.function.VectorVectorFunction distanceFunction
protected java.lang.String distanceFunctionName
Constructor Detail |
---|
public Grid()
public Grid(int size, int dim)
size
- number of neuronsdim
- number of weights per neuronMethod Detail |
---|
public int size()
public void setSize(int size)
size
- value of size.public int dim()
public void setDim(int dim)
dim
- size value of dim.public cern.colt.function.VectorVectorFunction getDistanceFunction()
public java.lang.String getDistanceFunctionName()
public void setDistanceFunction(cern.colt.function.VectorVectorFunction v)
v
- Value to assign to distanceFunction.public void setDistanceFunction(cern.colt.function.VectorVectorFunction v, java.lang.String n)
v
- Value to assign to distanceFunction.v
- Name of distanceFunction.public abstract cern.colt.matrix.DoubleMatrix1D getNeuron(int index)
index
- index of neuronpublic abstract void findNeighbors(int index, int radius, cern.colt.list.IntArrayList neighbors, cern.colt.list.IntArrayList distances)
index
- index of neuronradius
- radius around centerneighbors
- list of neighbors' indicesdistance
- corresponding distancespublic int transformRadius(int radius)
radius
- current maximal radius
public void init(Descriptives desc)
desc
- statistics about the training datapublic void init(java.lang.String method, Descriptives desc)
method
- name of initialization methoddesc
- statistics about the training datapublic void init(java.lang.String method, Descriptives desc, cern.jet.random.engine.RandomEngine random)
method
- name of initialization methoddesc
- statistics about the training datarandom
- An already existing random number generator.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |