Package com.neuralnetwork.shared.neurons

Examples of com.neuralnetwork.shared.neurons.SOMLayer


    timeConstant = numIterations / Math.log(latticeRadius);
   
    int iteration = 0;
    double nbhRadius;
    SOMNeuron bmu = null, temp = null;
    SOMLayer curInput = null;
    double learningRate = initialLearningRate;
   
    while (iteration < numIterations && running) {

          LOGGER.debug("Training, iteration: " + iteration);
View Full Code Here


   */
  @Test
  public final void testGetBMU() {
      SOMLattice s = new SOMLattice(Constants.FIVE,
                                    Constants.FIVE, Constants.FIVE);
    SOMLayer i = new SOMLayer();
    i.add(0.0);
    i.add(0.0);
    i.add(0.0);
    i.add(0.0);
    i.add(0.0);
    assertEquals(s.getBMU(i).getType(), NeuronType.SOM);
  }
View Full Code Here

   */
    @BeforeClass
    public static void setUp() {
    r = new Random(SEED);
        inData = new Vector<SOMLayer>(INPUT_SIZE);
        input = new SOMLayer();
       
        for (int i = 0; i < INPUT_SIZE; i++) {
          input = new SOMLayer();
          for (int j = 0; j < INPUT_SIZE; j++) {
            input.add(r.nextDouble());
          }
          inData.add(input);
        }
View Full Code Here

   * .shared.neurons.SOMLayer
   * #SOMLayer()}.
   */
  @Test
  public final void testSOMLayer() {
    SOMLayer l = new SOMLayer();

    assertNotNull(l);
    assertEquals(l.size(), 0);
  }
View Full Code Here

   * .shared.neurons.SOMLayer
   * #SOMLayer(int)}.
   */
  @Test
  public final void testSOMLayerInt() {
    SOMLayer l = new SOMLayer(Constants.TEN);

    assertNotNull(l);
    assertEquals(l.size(), Constants.TEN);
  }
View Full Code Here

   * .shared.neurons.SOMLayer
   * #dist(com.neuralnetwork.shared.neurons.SOMLayer)}.
   */
  @Test
  public final void testDist() {
    SOMLayer l = new SOMLayer(Constants.FIVE);
    SOMLayer l1 = new SOMLayer(Constants.FIVE);

    assertEquals(0.0, l.dist(l1), Constants.TEN * Math.ulp(0));
   
    l = new SOMLayer();
    l1 = new SOMLayer();
   
    l.add(Constants.TEN_D);
    l.add(Constants.TEN_D);
    l.add(Constants.TEN_D);
    l.add(Constants.TEN_D);
    l.add(Constants.TEN_D);
    l1.add(Constants.TEN_D);
    l1.add(Constants.TEN_D);
    l1.add(Constants.TEN_D);
    l1.add(Constants.TEN_D);
    l1.add(Constants.TEN_D);
   
    assertEquals(0.0, l.dist(l1), Constants.TEN * Math.ulp(0));
   
    l1.add(Constants.TEN_D);
    assertFalse(0.0 == l.dist(l1));
  }
View Full Code Here

      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

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

TOP

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

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.