Package org.encog.persist

Examples of org.encog.persist.EncogReadHelper


   * {@inheritDoc}
   */
  @Override
  public final Object read(final InputStream is) {
    final SVM result = new SVM();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("SVM")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here


   * {@inheritDoc}
   */
  @Override
  public final Object read(final InputStream is) {
    final SOM result = new SOM();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("SOM")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public final Object read(final InputStream is) {

    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;
    final BasicMLDataSet samples = new BasicMLDataSet();
    Map<String, String> networkParams = null;
    PNNKernelType kernel = null;
    PNNOutputMode outmodel = null;
    int inputCount = 0;
    int outputCount = 0;
    double error = 0;
    double[] sigma = null;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("PNN")
          && section.getSubSectionName().equals("PARAMS")) {
        networkParams = section.parseParams();
      }
      if (section.getSectionName().equals("PNN")
View Full Code Here

  public void loadConfig() {
    try {
      String home = System.getProperty("user.home");
      File file = new File(home, EncogWorkBench.CONFIG_FILENAME);
      InputStream is = new FileInputStream(file);
      EncogReadHelper in = new EncogReadHelper(is);
     
      // read the config file
      EncogFileSection section;
     
      while( (section = in.readNextSection()) != null ) {
        if( section.getSectionName().equals("ENCOG") && section.getSubSectionName().equals("TRAINING") ) {
          Map<String,String> params = section.parseParams();
          this.defaultError = EncogFileSection.parseDouble(params, EncogWorkBenchConfig.PROPERTY_DEFAULT_ERROR);
          this.threadCount = EncogFileSection.parseInt(params, EncogWorkBenchConfig.PROPERTY_THREAD_COUNT);
          this.useOpenCL = EncogFileSection.parseInt(params, EncogWorkBenchConfig.PROPERTY_THREAD_COUNT)>0;
View Full Code Here

  /**
   * Load an Encog script.
   * @param stream The stream to load from.
   */
  public final void load(final InputStream stream) {
    EncogReadHelper reader = null;

    try {
      EncogFileSection section = null;
      reader = new EncogReadHelper(stream);

      while ((section = reader.readNextSection()) != null) {
        processSubSection(section);
      }

      // init the script
      this.script.init();
    } finally {
      if (reader != null) {
        reader.close();
      }
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    final BAM result = new BAM();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("BAM")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public final Object read(final InputStream is) {
    final BayesianNetwork result = new BayesianNetwork();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;
    String queryType = "";
    String queryStr = "";
    String contentsStr = "";

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("BAYES-NETWORK")
          && section.getSubSectionName().equals("BAYES-PARAM")) {
        final Map<String, String> params = section.parseParams();
        queryType = params.get("queryType");
        queryStr = params.get("query");
View Full Code Here

  public Object read(final InputStream is) {
    final EncogProgramContext context = new EncogProgramContext();

    final PrgPopulation result = new PrgPopulation(context, 0);

    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    int count = 0;
    Species lastSpecies = null;
    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("BASIC")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      } else if (section.getSectionName().equals("BASIC")
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    Map<String, String> networkParams = null;
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;
    int inputCount = 0;
    int instarCount = 0;
    int outputCount = 0;
    int winnerCount = 0;
    Matrix m1 = null;
    Matrix m2 = null;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("CPN")
          && section.getSubSectionName().equals("PARAMS")) {
        networkParams = section.parseParams();
      }
      if (section.getSectionName().equals("CPN")
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    final ART1 result = new ART1();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("ART1")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

TOP

Related Classes of org.encog.persist.EncogReadHelper

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.