Examples of VectorSizeMismatchException


Examples of org.neuroph.core.exceptions.VectorSizeMismatchException

   * @param inputArray
   *            network input as double array
   */
  public void setInput(double ... inputVector) throws VectorSizeMismatchException   {
        if (inputVector.length != inputNeurons.size())
            throw new VectorSizeMismatchException("Input vector size does not match network input dimension!");

                int i = 0;
    for(Neuron neuron : this.inputNeurons) {
      neuron.setInput(inputVector[i]); // set input to the coresponding neuron
                        i++;
View Full Code Here

Examples of org.neuroph.core.exceptions.VectorSizeMismatchException

  public void addElement(TrainingElement el)
      throws VectorSizeMismatchException {
    // check input vector size if it is predefined
    if ((this.inputVectorSize != 0)
        && (el.getInput().length != this.inputVectorSize)) {
      throw new VectorSizeMismatchException(
          "Input vector size does not match training set!");
    }
    // check output vector size if it is predefined
    if (el instanceof SupervisedTrainingElement) {
      SupervisedTrainingElement sel = (SupervisedTrainingElement) el;
      if ((this.outputVectorSize != 0)
          && (sel.getDesiredOutput().length != this.outputVectorSize)) {
        throw new VectorSizeMismatchException(
            "Output vector size does not match training set!");
      }
    }
    // if everything went ok add training element
    this.elements.add(el);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.