Package org.encog.neural

Examples of org.encog.neural.NeuralNetworkError


   * @param output The toutpu
   */
  public final 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


   * 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

  public final int classify(final MLData input) {
    final BiPolarNeuralData input2 = new BiPolarNeuralData(this.f1Count);
    final BiPolarNeuralData output = new BiPolarNeuralData(this.f2Count);

    if (input.size() != input2.size()) {
      throw new NeuralNetworkError("Input array size does not match.");
    }

    for (int i = 0; i < input2.size(); i++) {
      input2.setData(i, input.getData(i) > 0);
    }
View Full Code Here

   *            The input to the network.
   * @return The output from the network.
   */
  public final 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

   * @param input
   *            NOT USED
   * @return NOT USED
   */
  public final MLData compute(final MLData input) {
    throw new NeuralNetworkError(
        "Compute on BasicNetwork cannot be used, rather call"
            + " the compute(NeuralData) method on the BAMLogic.");

  }
View Full Code Here

           = ((NEATTraining) getGeneticAlgorithm())
          .getInnovations().checkInnovation(newNeuronID, to,
              NEATInnovationType.NewLink);

      if ((innovationLink1 == null) || (innovationLink2 == null)) {
        throw new NeuralNetworkError("NEAT Error");
      }

      final NEATLinkGene link1 = new NEATLinkGene(from, newNeuronID,
          true, innovationLink1.getInnovationID(), 1.0, false);
      final NEATLinkGene link2 = new NEATLinkGene(newNeuronID, to, true,
View Full Code Here

    if (limit != null) {
      try {
        this.connectionLimited = true;
        this.connectionLimit = Double.parseDouble(limit);
      } 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

  /**
   * Throw an error if there is no flat network.
   */
  public final void requireFlat() {
    if (this.flat == null) {
      throw new NeuralNetworkError(
          "Must call finalizeStructure before using this network.");
    }
  }
View Full Code Here

   */
  public RBFNetwork(final int inputCount, final int hiddenCount,
      final int outputCount, final RBFEnum t) {

    if (hiddenCount == 0) {
      throw new NeuralNetworkError(
          "RBF network cannot have zero hidden neurons.");
    }

    final RadialBasisFunction[] rbf = new RadialBasisFunction[hiddenCount];

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.