Package org.encog.neural

Examples of org.encog.neural.NeuralNetworkError


   *            The input to the network.
   * @return The output from the network.
   */
  public MLData compute(final MLData input) {
    if (!(input instanceof BiPolarNeuralData)) {
      throw new NeuralNetworkError(
          "Input to ART1 logic network must be BiPolarNeuralData.");
    }

    final BiPolarNeuralData output = new BiPolarNeuralData(this.f1Count);
    compute((BiPolarNeuralData) input, output);
View Full Code Here


    this.outputCount = outputCount;

    setNEATActivationFunction(new ActivationSteepenedSigmoid());

    if (populationSize == 0) {
      throw new NeuralNetworkError(
          "Population must have more than zero genomes.");
    }

  }
View Full Code Here

   * Approximate the weights based on the input values.
   */
  private void initWeights() {

    if (this.training.getRecordCount() != this.network.getInstarCount()) {
      throw new NeuralNetworkError(
          "If the weights are to be set from the "
          + "training data, then there must be one instar "
          + "neuron for each training element.");
    }

View Full Code Here

      this.priors = new double[getOutputCount()];

      for (final MLDataPair pair : samples) {
        final int i = (int) pair.getIdeal().getData(0);
        if (i >= this.countPer.length) {
          throw new NeuralNetworkError(
              "Training data contains more classes than neural network has output neurons to hold.");
        }
        this.countPer[i]++;
      }
View Full Code Here

        .getNeuronsChromosome();
    final List<NEATLinkGene> linksChromosome = neatGenome
        .getLinksChromosome();

    if (neuronsChromosome.get(0).getNeuronType() != NEATNeuronType.Bias) {
      throw new NeuralNetworkError(
          "The first neuron must be the bias neuron, this genome is invalid.");
    }

    final List<NEATLink> links = new ArrayList<NEATLink>();
    final ActivationFunction[] afs = new ActivationFunction[neuronsChromosome
View Full Code Here

   *            The pattern to train for.
   */
  public void addPattern(final MLData pattern) {

    if (pattern.size() != getNeuronCount()) {
      throw new NeuralNetworkError("Network with " + getNeuronCount()
          + " neurons, cannot learn a pattern of size "
          + pattern.size());
    }

    // Create a row matrix from the input, convert boolean to bipolar
View Full Code Here

   */
  public void addWeight(final int fromNeuron, final int toNeuron,
      final double value) {
    final int index = (toNeuron * this.neuronCount) + fromNeuron;
    if (index >= this.weights.length) {
      throw new NeuralNetworkError("Out of range: fromNeuron:"
          + fromNeuron + ", toNeuron: " + toNeuron);
    }
    this.weights[index] += value;
  }
View Full Code Here

   * @param output The toutpu
   */
  public void init(final int neuronCount, final double[] weights,
      final double[] output) {
    if (neuronCount != output.length) {
      throw new NeuralNetworkError("Neuron count(" + neuronCount
          + ") must match output count(" + output.length + ").");
    }

    if ((neuronCount * neuronCount) != weights.length) {
      throw new NeuralNetworkError("Weight count(" + weights.length
          + ") must be the square of the neuron count(" + neuronCount
          + ").");
    }

    this.neuronCount = neuronCount;
View Full Code Here

      try {
        this.connectionLimited = true;
        this.connectionLimit = Double.parseDouble(limit);
        enforceLimit();
      } catch (final NumberFormatException e) {
        throw new NeuralNetworkError("Invalid property("
            + BasicNetwork.TAG_LIMIT + "):" + limit);
      }
    } else {
      this.connectionLimited = false;
      this.connectionLimit = 0;
View Full Code Here

   * property.
   */
  public final void finalizeStructure() {

    if (this.layers.size() < 2) {
      throw new NeuralNetworkError(
          "There must be at least two layers before the structure is finalized.");
    }

    final FlatLayer[] flatLayers = new FlatLayer[this.layers.size()];

View Full Code Here

TOP

Related Classes of org.encog.neural.NeuralNetworkError

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.