Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.SOMNeuron


   * Test method for {@link com.neuralnetwork
   * .shared.neurons.SOMNeuron#getWeights()}.
   */
  @Test
  public final void testGetWeights() {
      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();
   
    assertEquals(l.get(0), w1, Constants.TEN * Math.ulp(w1));
    assertEquals(l.get(1), w2, Constants.TEN * Math.ulp(w2));
    assertEquals(l.get(2), w3, Constants.TEN * Math.ulp(w3));
  }
 
View Full Code Here


   * .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);
   
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.neurons.SOMNeuron#getNeuralnetwork()}.
   */
  @Test
  public final void testGetNeuralnetwork() {
      SOMNeuron s = new SOMNeuron(Constants.THREE,
                                  Constants.FIVE, Constants.TWO);
    assertNotNull(s.getNeuralnetwork());
  }
View Full Code Here

   * Test method for {@link com.neuralnetwork
   * .shared.neurons.SOMNeuron#getType()}.
   */
  @Test
  public final void testGetType() {
      SOMNeuron s = new SOMNeuron(Constants.THREE,
                                  Constants.FIVE, Constants.TWO);
    assertEquals(NeuronType.SOM, s.getType());
  }
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.neurons.SOMNeuron

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.