* .shared.neurons.SOMNeuron#updateWeights(
* com.neuralnetwork.shared.neurons.SOMLayer, double, double)}.
*/
@Test
public final void testUpdateWeights() {
SOMNeuron s = new SOMNeuron(Constants.THREE,
Constants.FIVE, Constants.TWO);
double w1 = 1.0 / Constants.TEN_D;
double w2 = 2.0 / Constants.TEN_D;
double w3 = Constants.THREE_D / Constants.TEN_D;
s.setWeight(0, w1);
s.setWeight(1, w2);
s.setWeight(2, w3);
SOMLayer l = s.getWeights();
SOMNeuron s1 = new SOMNeuron(Constants.THREE, 2, 2);
s1.setWeight(0, 0.0);
s1.setWeight(1, 0.0);
s1.setWeight(2, 0.0);
s.updateWeights(s1.getWeights(),
1.0 / Math.pow(Constants.TEN_D, Constants.THREE_D),
1.0 / Math.pow(Constants.TEN, Constants.FIVE_D));
assertEquals(s.getWeights(), l);