Package org.encog.neural

Examples of org.encog.neural.NeuralNetworkError


      break;
    case NewSupportVectorRegression:
      this.params.svm_type = svm_parameter.NU_SVR;
      break;
    default:
      throw new NeuralNetworkError("Invalid svm type");
    }

    switch (kernelType) {
    case Linear:
      this.params.kernel_type = svm_parameter.LINEAR;
      break;
    case Poly:
      this.params.kernel_type = svm_parameter.POLY;
      break;
    case RadialBasisFunction:
      this.params.kernel_type = svm_parameter.RBF;
      break;
    case Sigmoid:
      this.params.kernel_type = svm_parameter.SIGMOID;
      break;
    case Precomputed:
      this.params.kernel_type = svm_parameter.PRECOMPUTED;
      break;
    default:
      throw new NeuralNetworkError("Invalid kernel type");
    }

    // params[i].kernel_type = svm_parameter.RBF;
    this.params.degree = DEFAULT_DEGREE;
    this.params.coef0 = 0;
View Full Code Here


    int inputCount = network.getFlat().getInputCount();
    int outputCount = network.getFlat().getOutputCount();   

    if (inputCount != training.getInputSize()) {
      throw new NeuralNetworkError("The input layer size of "
          + inputCount
          + " must match the training input size of "
          + training.getInputSize() + ".");
    }

    if ((training.getIdealSize() > 0)
        && (outputCount != training.getIdealSize())) {
      throw new NeuralNetworkError("The output layer size of "
          + outputCount
          + " must match the training input size of "
          + training.getIdealSize() + ".");
    }
  }
View Full Code Here

   */
  public TrainAdaline(final BasicNetwork network, final MLDataSet training,
      final double learningRate) {
    super(TrainingImplementationType.Iterative);
    if (network.getLayerCount() > 2) {
      throw new NeuralNetworkError(
          "An ADALINE network only has two layers.");
    }
    this.network = network;

    this.training = training;
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

    final int expectedSideLength = (int) Math.pow(totalNumHiddenNeurons,
        1.0 / dimensions);
    final double cmp = Math.pow(totalNumHiddenNeurons, 1.0 / dimensions);

    if (expectedSideLength != cmp) {
      throw new NeuralNetworkError(
          "Total number of RBF neurons must be some integer to the power of 'dimensions'.\n"
              + Format.formatDouble(expectedSideLength, 5)
              + " <> " + Format.formatDouble(cmp, 5));
    }
View Full Code Here

   * If an error has been reported, then throw it as an exception.
   */
  private void reportErrors() {
    for (final TrainingJob job : this.queue) {
      if (job.getError() != null) {
        throw new NeuralNetworkError(job.getError());
      }
    }
  }
View Full Code Here

        break;
      case MexicanHat:
        this.radial = new MexicanHatFunction(1);
        break;   
      default:
        throw new NeuralNetworkError("Unknown RBF type: " + type.toString());
    }
   
    this.radial.setWidth(1.0);
  }
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.