Class SpatialMap
- java.lang.Object
-
- org.joone.engine.SpatialMap
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- CircularSpatialMap, GaussianSpatialMap
public abstract class SpatialMap extends java.lang.Object implements java.io.SerializableSpatialMap 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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SpatialMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidApplyNeighborhoodFunction(double[] distances, double[] n_outs, boolean isLearning)Applies the neighborhood strategy based on this spatial maps implementation.doublegetCurrentGaussianSize()Gets the current gaussian size of the spatial neighborhood.doublegetInitialGaussianSize()Gets the size of the spatial neighborhood.intgetMapDepth()Gets the depth of this spatial map.intgetMapHeight()Gets the height of this spatial map.intgetMapWidth()Gets the width of this spatial map.intgetOrderingPhase()Getter for property orderingPhase.doublegetTimeConstant()Getter for property TimeConstant.intgetTotalEpochs()Gets the total number of epochs for the current session.voidinit(int total_epochs)Initialises this spatial map according to the total number of epochs/cycles.voidsetCurrentGaussianSize(double size)Sets the current guassian size of the spatial neighborhood.voidsetInitialGaussianSize(double size)Sets the initial guassian size of the spatial neighborhood.voidsetMapDepth(int d)Sets the depth of this spatial map.voidsetMapDimensions(int x, int y, int z)Sets the dimensions of the spatial map.voidsetMapHeight(int h)Sets the height of this spatial map.voidsetMapWidth(int w)Sets the width of this spatial map.voidsetOrderingPhase(int orderingPhase)Setter for property orderingPhase.voidsetTimeConstant(double TimeConstant)Setter for property TimeConstant.voidupdateCurrentGaussianSize(int current_epoch)Updates the current Gaussian Size depending on the current epoch and the time constant.
-
-
-
Method Detail
-
init
public final void init(int total_epochs)
Initialises this spatial map according to the total number of epochs/cycles.
- Parameters:
total_epochs- The total number of epochs that will be used.
-
getTotalEpochs
public final int getTotalEpochs()
Gets the total number of epochs for the current session.
- Returns:
- The total number of epochs for the current session.
-
setInitialGaussianSize
public final void setInitialGaussianSize(double size)
Sets the initial guassian size of the spatial neighborhood.
- Parameters:
size- The size of the neighborhood.
-
getInitialGaussianSize
public final double getInitialGaussianSize()
Gets the size of the spatial neighborhood.
- Returns:
- The size of the spatial neighborhood.
-
setCurrentGaussianSize
public final void setCurrentGaussianSize(double size)
Sets the current guassian size of the spatial neighborhood.
- Parameters:
size- The current guassian size of the spatial neighborhood.
-
getCurrentGaussianSize
public final double getCurrentGaussianSize()
Gets the current gaussian size of the spatial neighborhood.
- Returns:
- The current gaussian size of the spatial neighborhood.
-
updateCurrentGaussianSize
public final void updateCurrentGaussianSize(int current_epoch)
Updates the current Gaussian Size depending on the current epoch and the time constant.
- Parameters:
current_epoch- The current epoch or cycle.
-
ApplyNeighborhoodFunction
public abstract void ApplyNeighborhoodFunction(double[] distances, double[] n_outs, boolean isLearning)Applies the neighborhood strategy based on this spatial maps implementation.
- Parameters:
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.
-
setMapDimensions
public final void setMapDimensions(int x, int y, int z)Sets the dimensions of the spatial map. Allows dimension setting in one call.
- Parameters:
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.
-
setMapWidth
public final void setMapWidth(int w)
Sets the width of this spatial map.- Parameters:
w- The width or x size of the map.
-
setMapHeight
public final void setMapHeight(int h)
Sets the height of this spatial map.- Parameters:
h- The height or y size of the map.
-
setMapDepth
public final void setMapDepth(int d)
Sets the depth of this spatial map.- Parameters:
d- The depth or z size of the map.
-
getMapWidth
public final int getMapWidth()
Gets the width of this spatial map.
- Returns:
- The width of this spatial map.
-
getMapHeight
public final int getMapHeight()
Gets the height of this spatial map.
- Returns:
- The height of this spatial map.
-
getMapDepth
public final int getMapDepth()
Gets the depth of this spatial map.
- Returns:
- The depth of this spatial map.
-
getOrderingPhase
public int getOrderingPhase()
Getter for property orderingPhase.- Returns:
- Value of property orderingPhase.
-
setOrderingPhase
public void setOrderingPhase(int orderingPhase)
Setter for property orderingPhase.- Parameters:
orderingPhase- New value of property orderingPhase.
-
getTimeConstant
public double getTimeConstant()
Getter for property TimeConstant.- Returns:
- Value of property TimeConstant.
-
setTimeConstant
public void setTimeConstant(double TimeConstant)
Setter for property TimeConstant.- Parameters:
TimeConstant- New value of property TimeConstant.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG