Package org.encog

Examples of org.encog.EncogError


   */
  @Override
  public final void process() {

    if (this.hidden.size() == 0) {
      throw new EncogError(
          "To calculate the optimal hidden size, at least "
              + "one hidden layer must be defined.");
    }

    this.hiddenCounts = new int[this.hidden.size()];

    // set the best network
    this.bestNetwork = null;

    // set to minimums
    int i = 0;
    for (final HiddenLayerParams parm : this.hidden) {
      this.hiddenCounts[i++] = parm.getMin();
    }

    // make sure hidden layer 1 has at least one neuron
    if (this.hiddenCounts[0] == 0) {
      throw new EncogError(
          "To calculate the optimal hidden size, at least "
              + "one neuron must be the minimum for the first hidden layer.");
    }

    super.process();
View Full Code Here


      }

      csv.close();
      is.close();
    } catch (final IOException e) {
      throw new EncogError(e);
    }
  }
View Full Code Here

          ReflectionUtil.classMap.put(c.getSimpleName(), c);
        }
      }
      is.close();
    } catch (final IOException e) {
      throw new EncogError(e);
    } catch (final ClassNotFoundException e) {
      throw new EncogError("Unknown class: " + currentClass);
    }

  }
View Full Code Here

          ReflectionUtil.classMap.put(c.getSimpleName(), c);
        }
      }
      is.close();
    } catch (final IOException e) {
      throw new EncogError(e);
    } catch (final ClassNotFoundException e) {
      throw new EncogError("Unknown class: " + currentClass);
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public final int classify(final MLData input) {
    if (this.model == null) {
      throw new EncogError(
          "Can't use the SVM yet, it has not been trained, "
          + "and no model exists.");
    }

    final svm_node[] formattedInput = makeSparse(input);
View Full Code Here

   */
  @Override
  public final MLData compute(final MLData input) {

    if (this.model == null) {
      throw new EncogError(
          "Can't use the SVM yet, it has not been trained, "
          + "and no model exists.");
    }

    final MLData result = new BasicMLData(1);
View Full Code Here

          .toByteArray()); // E
      ois = new ObjectInputStream(bin); // F
      // return the new object
      return ois.readObject(); // G
    } catch (final Exception e) {
      throw new EncogError(e);
    } finally {
      try {
        if (oos != null) {
          oos.close();
        }
        if (ois != null) {
          ois.close();
        }
      } catch (final Exception e) {
        throw new EncogError(e);
      }
    }
  }
View Full Code Here

     
      out.close();
      outFile.close();

    } catch(IOException ex) {
      throw new EncogError(ex);
    }
   
  }
View Full Code Here

      final CSVFormat format = new CSVFormat(CSVFormat
          .getDecimalCharacter(), delim);
      this.reader = new BufferedReader(new FileReader(filename));
      begin(headers, format);
    } catch (final IOException e) {
      throw new EncogError(e);
    }
  }
View Full Code Here

      final CSVFormat format) {
    try {
      this.reader = new BufferedReader(new FileReader(filename));
      begin(headers, format);
    } catch (final IOException e) {
      throw new EncogError(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.encog.EncogError

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.