Examples of BoltzmannMachine


Examples of org.encog.neural.thermal.BoltzmannMachine

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
   
  public void testPersistEG()
  {
    BoltzmannMachine network = new BoltzmannMachine(4);
    network.setWeight(1,1,1);
    network.getThreshold()[2] = 2;
   
    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    BoltzmannMachine network2 = (BoltzmannMachine)EncogDirectoryPersistence.loadObject(EG_FILENAME);
   
    validateHopfield(network2);
  }
View Full Code Here

Examples of org.encog.neural.thermal.BoltzmannMachine

    validateHopfield(network2);
  }
 
  public void testPersistSerial() throws IOException, ClassNotFoundException
  {
    BoltzmannMachine network = new BoltzmannMachine(4);
    network.setWeight(1,1,1);
    network.getThreshold()[2] = 2;
   
    SerializeObject.save(SERIAL_FILENAME, network);
    BoltzmannMachine network2 = (BoltzmannMachine)SerializeObject.load(SERIAL_FILENAME);
       
    validateHopfield(network2);
  }
View Full Code Here

Examples of org.encog.neural.thermal.BoltzmannMachine

   * Generate the network.
   *
   * @return The generated network.
   */
  public final MLMethod generate() {
    BoltzmannMachine boltz = new BoltzmannMachine(this.neuronCount);
    boltz.setTemperature(this.temperature);
    boltz.setRunCycles(this.runCycles);
    boltz.setAnnealCycles(this.annealCycles);
    return boltz;   
  }
View Full Code Here

Examples of org.encog.neural.thermal.BoltzmannMachine

    }
  }


  public void run() {
    BoltzmannMachine boltz = new BoltzmannMachine(NEURON_COUNT);

    createCities();
    calculateWeights(boltz);

    boltz.setTemperature(100);
    do {
      boltz.establishEquilibrium();
      System.out.println(boltz.getTemperature()+" : "+displayTour(boltz.getCurrentState()));
      boltz.decreaseTemperature(0.99);
    } while (!isValidTour(boltz.getCurrentState()));

    System.out.println("Final Length: " + this.lengthOfTour(boltz.getCurrentState()) );
  }
View Full Code Here

Examples of org.encog.neural.thermal.BoltzmannMachine

   * Generate the network.
   *
   * @return The generated network.
   */
  public MLMethod generate() {
    BoltzmannMachine boltz = new BoltzmannMachine(this.neuronCount);
    boltz.setTemperature(this.temperature);
    boltz.setRunCycles(this.runCycles);
    boltz.setAnnealCycles(this.annealCycles);
    return boltz;   
  }
View Full Code Here

Examples of org.encog.neural.thermal.BoltzmannMachine

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
   
  public void testPersistEG()
  {
    BoltzmannMachine network = new BoltzmannMachine(4);
    network.setWeight(1,1,1);
    network.getThreshold()[2] = 2;
   
    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    BoltzmannMachine network2 = (BoltzmannMachine)EncogDirectoryPersistence.loadObject(EG_FILENAME);
   
    validateHopfield(network2);
  }
View Full Code Here

Examples of org.encog.neural.thermal.BoltzmannMachine

    validateHopfield(network2);
  }
 
  public void testPersistSerial() throws IOException, ClassNotFoundException
  {
    BoltzmannMachine network = new BoltzmannMachine(4);
    network.setWeight(1,1,1);
    network.getThreshold()[2] = 2;
   
    SerializeObject.save(SERIAL_FILENAME, network);
    BoltzmannMachine network2 = (BoltzmannMachine)SerializeObject.load(SERIAL_FILENAME);
       
    validateHopfield(network2);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.