/*
This is a proprietary part of DataMelt package.
License: the Creative Commons Attribution-Share Alike License; either version 3.0 of the License,
or any later version.
http://creativecommons.org/licenses/by-sa/3.0/
Redistributions of the source code, or parts of the source codes,
must retain the copyright notice, this list of conditions and the following disclaimer
(all at the top of each source code) and requires the written permission from DataMelt.
Redistribution in binary form of all or parts of a class must reproduce the
copyright notice, this list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution and requires the written permission of ScaVis
Details about license agreement or commercial use are: http://jwork.org/scavis/
*/
package jhpro.nnet;
public class MapNeuron extends Neuron
{
public MapNeuron()
{
init(0, 0);
}
public MapNeuron(int i, int j)
{
init(i, j);
}
public void init(int i, int j)
{
x = i;
y = j;
feedback = 0.0F;
}
public int getXPos()
{
return x;
}
public int getYPos()
{
return y;
}
public float getFeedback()
{
return feedback;
}
public float computeFeedback(MapNeuron mapneuron, double d)
{
int i = Math.abs(x - mapneuron.getXPos());
int j = Math.abs(y - mapneuron.getYPos());
return (float)Math.exp((double)(-(i * i + j * j)) / d);
}
int x;
int y;
float feedback;
}
Ads help maintain this website.