Package org.encog.neural

Examples of org.encog.neural.NeuralNetworkError


  @Override
  public void encodeToArray(final double[] encoded) {
    this.structure.requireFlat();
    final double[] weights = this.structure.getFlat().getWeights();
    if (weights.length != encoded.length) {
      throw new NeuralNetworkError(
          "Size mismatch, encoded array should be of length "
              + weights.length);
    }

    EngineArray.arrayCopy(weights, encoded);
View Full Code Here


   * @param l The layer.
   * @return The bias activation.
   */
  public double getLayerBiasActivation(final int l) {
    if (!isLayerBiased(l)) {
      throw new NeuralNetworkError(
          "Error, the specified layer does not have a bias: " + l);
    }

    this.structure.requireFlat();
    final int layerNumber = getLayerCount() - l - 1;
View Full Code Here

    final int layerNumber = getLayerCount() - layer - 1;
    final int index = this.structure.getFlat().getLayerIndex()[layerNumber]
        + neuronNumber;
    final double[] output = this.structure.getFlat().getLayerOutput();
    if (index >= output.length) {
      throw new NeuralNetworkError("The layer index: " + index
          + " specifies an output index larger than the network has.");
    }
    return output[index];
  }
View Full Code Here

    validateNeuron(fromLayer + 1, toNeuron);
    final int fromLayerNumber = getLayerCount() - fromLayer - 1;
    final int toLayerNumber = fromLayerNumber - 1;

    if (toLayerNumber < 0) {
      throw new NeuralNetworkError(
          "The specified layer is not connected to another layer: "
              + fromLayer);
    }

    final int weightBaseIndex
View Full Code Here

   * @param value The bias activation.
   */
  public void setLayerBiasActivation(final int l,
        final double value) {
    if (!isLayerBiased(l)) {
      throw new NeuralNetworkError(
          "Error, the specified layer does not have a bias: " + l);
    }

    this.structure.requireFlat();
    final int layerNumber = getLayerCount() - l - 1;
View Full Code Here

    this.structure.requireFlat();
    final int fromLayerNumber = getLayerCount() - fromLayer - 1;
    final int toLayerNumber = fromLayerNumber - 1;

    if (toLayerNumber < 0) {
      throw new NeuralNetworkError(
          "The specified layer is not connected to another layer: "
              + fromLayer);
    }

    final int weightBaseIndex
View Full Code Here

   * @param targetLayer The target layer.
   * @param neuron The target neuron.
   */
  public void validateNeuron(final int targetLayer, final int neuron) {
    if ((targetLayer < 0) || (targetLayer >= getLayerCount())) {
      throw new NeuralNetworkError("Invalid layer count: " + targetLayer);
    }

    if ((neuron < 0) || (neuron >= getLayerTotalNeuronCount(targetLayer))) {
      throw new NeuralNetworkError("Invalid neuron number: " + neuron);
    }
  }
View Full Code Here

  /**
   * End the current tag.
   */
  public void endTag() {
    if (this.tagStack.isEmpty()) {
      throw new NeuralNetworkError(
          "Can't create end tag, no beginning tag.");
    }
    final String tag = this.tagStack.pop();

    final StringBuilder builder = new StringBuilder();
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public void perform(final TrainingJob job) {
    if (!this.ready.get()) {
      throw new NeuralNetworkError(
          "Performer is already performing a job.");
    }

    this.ready.set(false);
    this.currentJob = job;
View Full Code Here

    this.height = theHeight;
    this.width = theWidth;

    for (final MLDataPair pair : this) {
      if (!(pair.getInput() instanceof ImageMLData)) {
        throw new NeuralNetworkError(
            "Invalid class type found in ImageNeuralDataSet, only "
                + "ImageNeuralData items are allowed.");
      }

      final ImageMLData input = (ImageMLData) pair.getInput();
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.