Package org.encog

Examples of org.encog.EncogError


   * Check to see if one of the threads has thrown an error. If so, then throw
   * that error.
   */
  public void checkError() {
    if (this.threadError != null) {
      throw new EncogError(this.threadError);
    }
  }
View Full Code Here


   
    if( str==null )
      return defaultValue;
   
    if( !str.equalsIgnoreCase("true") && !str.equalsIgnoreCase("false") ) {
      throw new EncogError("Property " + name + " has an invalid value of " + str + ", should be true/false.");
    }
   
    return str.equalsIgnoreCase("true");
  }
View Full Code Here

      task.run();
    } else {
      if (this.threadError != null) {
        final Throwable t = this.threadError;
        this.threadError = null;
        throw new EncogError(t);
      }

      final PoolItem item = new PoolItem(task, group);
      if (group != null) {
        group.taskStarting();
View Full Code Here

      try {
        this.executor.shutdown();
        this.executor.awaitTermination(timeout, TimeUnit.SECONDS);
        this.executor = null;
      } catch (final InterruptedException e) {
        throw new EncogError(e);
      }
    }
  }
View Full Code Here

   * @param job
   *            The training job to add.
   */
  public void addTrainingJob(final TrainingJob job) {
    if( job.getStrategies().size()==0 ) {
      throw new EncogError("Job has no strategies, it will have no way to know when to end.");
    }
    try {
      this.accessLock.lock();
      this.queue.add(job);
    } finally {
View Full Code Here

      EncogLogging.log(EncogLogging.LEVEL_INFO,"Training iteration done, error: "
            + getError());     
    } catch (final ArrayIndexOutOfBoundsException ex) {
      EncogValidate.validateNetworkForTraining(this.network,
          getTraining());
      throw new EncogError(ex);
    }
  }
View Full Code Here

            + getError());
     
    } catch (final ArrayIndexOutOfBoundsException ex) {
      EncogValidate.validateNetworkForTraining(this.network,
          getTraining());
      throw new EncogError(ex);
    }
  }
View Full Code Here

   * @param data
   *            The data to be decoded.
   */
  public void decodeNetwork(final double[] data) {
    if (data.length != this.weights.length) {
      throw new EncogError(
          "Incompatable weight sizes, can't assign length="
              + data.length + " to length=" + data.length);
    }
    this.weights = data;

View Full Code Here

    // see if simple number
    try {
      layer.setCount(Integer.parseInt(check));
      if (layer.getCount() < 0) {
        throw new EncogError("Count cannot be less than zero.");
      }
    } catch (final NumberFormatException f) {
      EncogLogging.log(f);
    }

    // see if it is a default
    if ("?".equals(check)) {
      if (defaultValue < 0) {
        throw new EncogError("Default (?) in an invalid location.");
      } else {
        layer.setCount(defaultValue);
        layer.setUsedDefault(true);
        return layer;
      }
    }

    // single item, no function
    final int startIndex = check.indexOf('(');
    final int endIndex = check.lastIndexOf(')');
    if (startIndex == -1) {
      layer.setName(check);
      return layer;
    }

    // function
    if (endIndex == -1) {
      throw new EncogError("Illegal parentheses.");
    }

    layer.setName(check.substring(0, startIndex).trim());

    final String paramStr = check.substring(startIndex + 1, endIndex);
View Full Code Here

      final String name = ArchitectureParse.parseName(parser)
          .toUpperCase();

      parser.eatWhiteSpace();
      if (!parser.lookAhead("=", false)) {
        throw new EncogError("Missing equals(=) operator.");
      } else {
        parser.advance();
      }

      final String value = ArchitectureParse.parseValue(parser);
View Full Code Here

TOP

Related Classes of org.encog.EncogError

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.