|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joone.engine.SpatialMap
public abstract class SpatialMap
SpatialMap is intended to be an abstract spatial map for use with a GaussianLayer. Custom SpatialMap's need to extend the ApplyNeighborhood method and implement it based on their own spatial shape implementation. The Gaussian spatial size is updated if the current epoch is less than the ordering phase, it is also reduced over the ordering phase based on the time constant.
Field Summary | |
---|---|
(package private) double |
TimeConstant
|
Constructor Summary | |
---|---|
SpatialMap()
|
Method Summary | |
---|---|
abstract void |
ApplyNeighborhoodFunction(double[] distances,
double[] n_outs,
boolean isLearning)
Applies the neighborhood strategy based on this spatial maps implementation. |
protected double |
distanceBetween(int x1,
int y1,
int z1,
int x2,
int y2,
int z2)
Calculates the squared distance between vector (x1,y1,z1) and (x2,y2,z2) and returns the result. |
protected void |
extractWinner(double[] distances)
Extracts the X,Y,Z co-ordinates of the winning neuron in this spatial map. |
double |
getCurrentGaussianSize()
Gets the current gaussian size of the spatial neighborhood. |
double |
getInitialGaussianSize()
Gets the size of the spatial neighborhood. |
int |
getMapDepth()
Gets the depth of this spatial map. |
int |
getMapHeight()
Gets the height of this spatial map. |
int |
getMapWidth()
Gets the width of this spatial map. |
int |
getOrderingPhase()
Getter for property orderingPhase. |
double |
getTimeConstant()
Getter for property TimeConstant. |
int |
getTotalEpochs()
Gets the total number of epochs for the current session. |
protected int |
getWinnerX()
Returns the X Co-ordinate of the current winning neuron. |
protected int |
getWinnerY()
Returns the Y Co-ordinate of the current winning neuron. |
protected int |
getWinnerZ()
Returns the Z Co-ordinate of the current winning neuron. |
void |
init(int total_epochs)
Initialises this spatial map according to the total number of epochs/cycles. |
void |
setCurrentGaussianSize(double size)
Sets the current guassian size of the spatial neighborhood. |
void |
setInitialGaussianSize(double size)
Sets the initial guassian size of the spatial neighborhood. |
void |
setMapDepth(int d)
Sets the depth of this spatial map. |
void |
setMapDimensions(int x,
int y,
int z)
Sets the dimensions of the spatial map. |
void |
setMapHeight(int h)
Sets the height of this spatial map. |
void |
setMapWidth(int w)
Sets the width of this spatial map. |
void |
setOrderingPhase(int orderingPhase)
Setter for property orderingPhase. |
void |
setTimeConstant(double TimeConstant)
Setter for property TimeConstant. |
void |
updateCurrentGaussianSize(int current_epoch)
Updates the current Gaussian Size depending on the current epoch and the time constant. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
double TimeConstant
Constructor Detail |
---|
public SpatialMap()
Method Detail |
---|
public final void init(int total_epochs)
Initialises this spatial map according to the total number of epochs/cycles.
total_epochs
- The total number of epochs that will be used.public final int getTotalEpochs()
Gets the total number of epochs for the current session.
public final void setInitialGaussianSize(double size)
Sets the initial guassian size of the spatial neighborhood.
size
- The size of the neighborhood.public final double getInitialGaussianSize()
Gets the size of the spatial neighborhood.
public final void setCurrentGaussianSize(double size)
Sets the current guassian size of the spatial neighborhood.
size
- The current guassian size of the spatial neighborhood.public final double getCurrentGaussianSize()
Gets the current gaussian size of the spatial neighborhood.
public final void updateCurrentGaussianSize(int current_epoch)
Updates the current Gaussian Size depending on the current epoch and the time constant.
current_epoch
- The current epoch or cycle.public abstract void ApplyNeighborhoodFunction(double[] distances, double[] n_outs, boolean isLearning)
Applies the neighborhood strategy based on this spatial maps implementation.
distances
- The euclidean distances between input and weights calculated by previous
synapse.n_outs
- The outputs of this spatial maps neighborhood strategy.isLearning
- Is the network in the learning phase.protected final void extractWinner(double[] distances)
distances
- The distances between the input and weights vector, this should be passed in by the
previous synapse.protected final int getWinnerX()
Returns the X Co-ordinate of the current winning neuron.
protected final int getWinnerY()
Returns the Y Co-ordinate of the current winning neuron.
protected final int getWinnerZ()
Returns the Z Co-ordinate of the current winning neuron.
public final void setMapDimensions(int x, int y, int z)
Sets the dimensions of the spatial map. Allows dimension setting in one call.
x
- The x size or width of the map.y
- The y size or height of the map.z
- The z size of depth of the map.public final void setMapWidth(int w)
w
- The width or x size of the map.public final void setMapHeight(int h)
h
- The height or y size of the map.public final void setMapDepth(int d)
d
- The depth or z size of the map.public final int getMapWidth()
Gets the width of this spatial map.
public final int getMapHeight()
Gets the height of this spatial map.
public final int getMapDepth()
Gets the depth of this spatial map.
protected final double distanceBetween(int x1, int y1, int z1, int x2, int y2, int z2)
Calculates the squared distance between vector (x1,y1,z1) and (x2,y2,z2) and returns the result.
x1
- The x location of the first vector.y1
- The y location of the first vector.z1
- The z location of the first vector.x2
- The x location of the second vector.y2
- The y location of the second vector.z2
- The z location of the second vector.
public int getOrderingPhase()
public void setOrderingPhase(int orderingPhase)
orderingPhase
- New value of property orderingPhase.public double getTimeConstant()
public void setTimeConstant(double TimeConstant)
TimeConstant
- New value of property TimeConstant.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |