Package org.encog.neural.som

Examples of org.encog.neural.som.SOM


  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
   
  private SOM create()
  {
    SOM network = new SOM(4,2);
    return network;
  }
View Full Code Here


    return network;
  }
 
  public void testPersistEG()
  {
    SOM network = create();

    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    SOM network2 = (SOM)EncogDirectoryPersistence.loadObject(EG_FILENAME);
   
    validate(network2);
  }
View Full Code Here

    validate(network2);
  }
 
  public void testPersistSerial() throws IOException, ClassNotFoundException
  {
    SOM network = create();   
    SerializeObject.save(SERIAL_FILENAME, network);
    SOM network2 = (SOM)SerializeObject.load(SERIAL_FILENAME);
       
    validate(network2);
  }
View Full Code Here

   * Generate the RSOM network.
   *
   * @return The neural network.
   */
  public final MLMethod generate() {
    SOM som = new SOM(this.inputNeurons,this.outputNeurons);
    som.reset();
    return som;
  }
View Full Code Here

  public SOM getNetwork() {
    return this.network;
  }

  private SOM createNetwork() {
    SOM result = new SOM(3,MapPanel.WIDTH * MapPanel.HEIGHT);
    result.reset();
    return result;
  }
View Full Code Here

 
    // create the training set
    MLDataSet training = new BasicMLDataSet(SOM_INPUT,null);
   
    // Create the neural network.
    SOM network = new SOM(4,2);
    network.reset();
   
    BasicTrainSOM train = new BasicTrainSOM(
        network,
        0.7,
        training,
        new NeighborhoodSingle());
       
    int iteration = 0;
   
    for(iteration = 0;iteration<=10;iteration++)
    {
      train.iteration();
      System.out.println("Iteration: " + iteration + ", Error:" + train.getError());
    }
   
    MLData data1 = new BasicMLData(SOM_INPUT[0]);
    MLData data2 = new BasicMLData(SOM_INPUT[1]);
    System.out.println("Pattern 1 winner: " + network.winner(data1));
    System.out.println("Pattern 2 winner: " + network.winner(data2));
  }
View Full Code Here

        }

        trainingSet.add(new BasicMLDataPair(item, null));
      }

      this.net = new SOM(inputNeuron,outputNeuron);
      this.net.reset();

      SOMClusterCopyTraining train = new SOMClusterCopyTraining(this.net,trainingSet);
           
      int tries = 1;
View Full Code Here

    // create the training set
    final MLDataSet training = new BasicMLDataSet(
        TestCompetitive.SOM_INPUT, null);

    // Create the neural network.
    SOM network = new SOM(4,2);   
    network.setWeights(new Matrix(MATRIX_ARRAY));

    final BasicTrainSOM train = new BasicTrainSOM(network, 0.4,
        training, new NeighborhoodSingle());
    train.setForceWinner(true);
    int iteration = 0;

    for (iteration = 0; iteration <= 100; iteration++) {
      train.iteration();
    }

    final MLData data1 = new BasicMLData(
        TestCompetitive.SOM_INPUT[0]);
    final MLData data2 = new BasicMLData(
        TestCompetitive.SOM_INPUT[1]);
   
    int result1 = network.winner(data1);
    int result2 = network.winner(data2);
   
    Assert.assertTrue(result1!=result2);

  }
View Full Code Here

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
   
  private SOM create()
  {
    SOM network = new SOM(4,2);
    return network;
  }
View Full Code Here

    return network;
  }
 
  public void testPersistEG()
  {
    SOM network = create();

    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    SOM network2 = (SOM)EncogDirectoryPersistence.loadObject(EG_FILENAME);
   
    validate(network2);
  }
View Full Code Here

TOP

Related Classes of org.encog.neural.som.SOM

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.