Package org.encog.neural.networks.training

Examples of org.encog.neural.networks.training.TrainingError


        return result;
      }
    }

    throw new TrainingError("Failed to find innovation for neuron: " + neuronID );
  }
View Full Code Here


   *            The population to use.
   */
  public NEATTraining(final CalculateScore calculateScore,
      final Population population) {
    if (population.size() < 1) {
      throw new TrainingError("Population can not be empty.");
    }

    final NEATGenome genome = (NEATGenome) population.getGenomes().get(0);
    setCalculateScore(new GeneticScoreAdapter(calculateScore));
    setComparator(new GenomeComparator(getCalculateScore()));
View Full Code Here

   * @param strategy
   *            Not used.
   */
  @Override
  public void addStrategy(final Strategy strategy) {
    throw new TrainingError(
        "Strategies are not supported by this training method.");
  }
View Full Code Here

    }

    // check the population
    for (final Genome obj : getPopulation().getGenomes()) {
      if (!(obj instanceof NEATGenome)) {
        throw new TrainingError(
            "Population can only contain objects of NEATGenome.");
      }

      final NEATGenome neat = (NEATGenome) obj;

      if ((neat.getInputCount() != this.inputCount)
          || (neat.getOutputCount() != this.outputCount)) {
        throw new TrainingError(
            "All NEATGenome's must have the same input and output sizes as the base network.");
      }
      neat.setGeneticAlgorithm(this);
    }
View Full Code Here

   */
  public void init(final MLTrain train) {
    this.train = train;
   
    if( !(train.getMethod() instanceof MLResettable) ) {
      throw new TrainingError("To use the required improvement strategy the machine learning method must support MLResettable.");
    }
   
    this.method = (MLResettable)this.train.getMethod();
  }
View Full Code Here

   */
  public void init(final MLTrain train) {
    this.train = train;
   
    if( !(train.getMethod() instanceof MLResettable) ) {
      throw new TrainingError("To use the reset strategy the machine learning method must support MLResettable.");
    }
   
    this.method = (MLResettable)this.train.getMethod();
  }
View Full Code Here

  public void init(final MLTrain train) {
    this.train = train;
    this.ready = false;
   
    if( !(train.getMethod() instanceof MLEncodable) ) {
      throw new TrainingError("To make use of the Greedy strategy the machine learning method must support MLEncodable.");
    }
   
    this.method = ((MLEncodable)train.getMethod());
    this.lastNetwork = new double[this.method.encodedArrayLength()];
  }
View Full Code Here

   * @param data1
   *            Not used.
   */
  @Override
  public final void add(final MLData data1) {
    throw new TrainingError(FoldedDataSet.ADD_NOT_SUPPORTED);

  }
View Full Code Here

   * @param idealData
   *            Not used.
   */
  @Override
  public final void add(final MLData inputData, final MLData idealData) {
    throw new TrainingError(FoldedDataSet.ADD_NOT_SUPPORTED);

  }
View Full Code Here

   * @param inputData
   *            Not used.
   */
  @Override
  public final void add(final MLDataPair inputData) {
    throw new TrainingError(FoldedDataSet.ADD_NOT_SUPPORTED);

  }
View Full Code Here

TOP

Related Classes of org.encog.neural.networks.training.TrainingError

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.