Package org.encog.neural.thermal

Examples of org.encog.neural.thermal.HopfieldNetwork


  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  public void testPersistEG()
  {
    HopfieldNetwork network = new HopfieldNetwork(4);
    network.setWeight(1,1,1);
    network.setProperty("x", 10);
   
    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    HopfieldNetwork network2 = (HopfieldNetwork)EncogDirectoryPersistence.loadObject((EG_FILENAME));
   
    validateHopfield(network2);
  }
View Full Code Here


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

   * Generate the Hopfield neural network.
   *
   * @return The generated network.
   */
  public final MLMethod generate() {
    HopfieldNetwork logic = new HopfieldNetwork(this.neuronCount);
    return logic;
  }
View Full Code Here

    /*HopfieldPattern pattern = new HopfieldPattern();
    pattern.setInputNeurons(WIDTH*HEIGHT);
    BasicNetwork hopfield = pattern.generate();
    HopfieldLogic hopfieldLogic = (HopfieldLogic)hopfield.getLogic();*/
   
    HopfieldNetwork hopfieldLogic = new HopfieldNetwork(WIDTH*HEIGHT);

    for(int i=0;i<PATTERN.length;i++)
    {
      hopfieldLogic.addPattern(convertPattern(PATTERN,i));
    }
   
    evaluate(hopfieldLogic,PATTERN);
    evaluate(hopfieldLogic,PATTERN2);
  }
View Full Code Here

  public HopfieldPanel(int gridX,int gridY) {
    this.gridX = gridX;
    this.gridY = gridY;
    this.grid = new boolean[this.gridX * this.gridY];
    this.addMouseListener(this);
    this.hopfield = new HopfieldNetwork(this.gridX * this.gridY);
  }
 
View Full Code Here

            "Training set is required to train.");
        return;
      }

      if (method instanceof HopfieldNetwork) {
        HopfieldNetwork hp = (HopfieldNetwork) method;
        ProjectEGFile file = (ProjectEGFile) dialog.getComboNetwork()
            .getSelectedValue();
        for (MLDataPair pair : trainingData) {
          hp.addPattern(pair.getInput());
        }
        if (EncogWorkBench.askQuestion("Hopfield",
            "Training done, save?")) {
          file.save();
        }
View Full Code Here

    report.endHTML();
    this.editor.setText(report.toString());
  }

  private void restructureHopfield() {
    HopfieldNetwork hopfield = (HopfieldNetwork) method;
    CreateHopfieldDialog dialog = new CreateHopfieldDialog(EncogWorkBench
        .getInstance().getMainWindow());
    dialog.getNeuronCount().setValue(hopfield.getNeuronCount());

    if (dialog.process()
        && (hopfield.getNeuronCount() != dialog.getNeuronCount()
            .getValue())) {
      HopfieldPattern pattern = new HopfieldPattern();
      pattern.setInputNeurons(dialog.getNeuronCount().getValue());
      setDirty(true);
      produceReport();
View Full Code Here

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  public void testPersistEG()
  {
    HopfieldNetwork network = new HopfieldNetwork(4);
    network.setWeight(1,1,1);
    network.setProperty("x", 10);
   
    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    HopfieldNetwork network2 = (HopfieldNetwork)EncogDirectoryPersistence.loadObject((EG_FILENAME));
   
    validateHopfield(network2);
  }
View Full Code Here

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

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  public void testPersistEG()
  {
    HopfieldNetwork network = new HopfieldNetwork(1000);
    network.setWeight(1,1,1);
    network.setProperty("x", 10);
   
    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    HopfieldNetwork network2 = (HopfieldNetwork)EncogDirectoryPersistence.loadObject((EG_FILENAME));
   
    validateHopfield(network2);
  }
View Full Code Here

TOP

Related Classes of org.encog.neural.thermal.HopfieldNetwork

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.