Package org.encog.ml

Examples of org.encog.ml.MLEncodable


      final BasicNetwork network = (BasicNetwork) method;
      for (int i = 0; i < network.getLayerCount() - 1; i++) {
        randomize(network, i);
      }
    } else if (method instanceof MLEncodable) {
      final MLEncodable encode = (MLEncodable) method;
      final double[] encoded = new double[encode.encodedArrayLength()];
      encode.encodeToArray(encoded);
      randomize(encoded);
      encode.decodeFromArray(encoded);
    }
  }
View Full Code Here


      report.tablePair("Output Count",
          Format.formatInteger(reg.getOutputCount()));
    }

    if (method instanceof MLEncodable) {
      MLEncodable encode = (MLEncodable)method;
      report.tablePair("Encoded Length",
          Format.formatInteger(encode.encodedArrayLength()));
    }

    report.tablePair("Resettable",
        (method instanceof MLResettable) ? "true" : "false");
   
View Full Code Here

   */
  private EncogProgramNode generateForMethod(
      final EncogProgramNode mainClass, final File method) {

    if (this.embedData) {
      final MLEncodable encodable = (MLEncodable) EncogDirectoryPersistence
          .loadObject(method);
      final double[] weights = new double[encodable.encodedArrayLength()];
      encodable.encodeToArray(weights);
      mainClass.createArray("WEIGHTS", weights);
    }

    return mainClass.createNetworkFunction("createNetwork", method);
  }
View Full Code Here

      final BasicNetwork network = (BasicNetwork) method;
      for (int i = 0; i < network.getLayerCount() - 1; i++) {
        randomize(network, i);
      }
    } else if (method instanceof MLEncodable) {
      final MLEncodable encode = (MLEncodable) method;
      final double[] encoded = new double[encode.encodedArrayLength()];
      encode.encodeToArray(encoded);
      randomize(encoded);
      encode.decodeFromArray(encoded);
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public Genome encode(final MLMethod phenotype) {
    final MLEncodable phenotype2 = (MLEncodable) phenotype;
    return new MLMethodGenome(phenotype2);
  }
View Full Code Here

    // Create the population
    final Population population = new BasicPopulation(populationSize, null);
    final Species defaultSpecies = population.createSpecies();

    for (int i = 0; i < population.getPopulationSize(); i++) {
      final MLEncodable chromosomeNetwork = (MLEncodable) phenotypeFactory
          .factor();
      final MLMethodGenome genome = new MLMethodGenome(chromosomeNetwork);
      defaultSpecies.add(genome);
    }
    defaultSpecies.setLeader(defaultSpecies.getMembers().get(0));
View Full Code Here

TOP

Related Classes of org.encog.ml.MLEncodable

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.