Package org.encog.persist

Examples of org.encog.persist.EncogReadHelper


   *
   * @param stream
   *            The stream to load from.
   */
  public void load(final InputStream stream) {
    EncogReadHelper reader = null;

    try {
      EncogFileSection section = null;
      reader = new EncogReadHelper(stream);

      while ((section = reader.readNextSection()) != null) {
        processSubSection(section);
      }

      // init the script
      this.script.init();
    } finally {
      if (reader != null) {
        reader.close();
      }
    }
  }
View Full Code Here


   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {

    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;
    final BasicMLDataSet samples = new BasicMLDataSet();
    Map<String, String> networkParams = null;
    PNNKernelType kernel = null;
    PNNOutputMode outmodel = null;
    int inputCount = 0;
    int outputCount = 0;
    double error = 0;
    double[] sigma = null;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("PNN")
          && section.getSubSectionName().equals("PARAMS")) {
        networkParams = section.parseParams();
      }
      if (section.getSectionName().equals("PNN")
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    final SOM result = new SOM();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("SOM")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

   */
  @Override
  public Object read(final InputStream is) {
    final BasicNetwork result = new BasicNetwork();
    final FlatNetwork flat = new FlatNetwork();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("BASIC")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    final HopfieldNetwork result = new HopfieldNetwork();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("HOPFIELD")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    final BoltzmannMachine result = new BoltzmannMachine();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("BOLTZMANN")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

    final NEATPopulation result = new NEATPopulation();
    final NEATInnovationList innovationList = new NEATInnovationList();
    innovationList.setPopulation(result);
    result.setInnovations(innovationList);
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("NEAT-POPULATION")
          && section.getSubSectionName().equals("INNOVATIONS")) {
        for (final String line : section.getLines()) {
          final List<String> cols = EncogFileSection
              .splitColumns(line);
View Full Code Here

  @Override
  public Object read(final InputStream is) {
    final RBFNetwork result = new RBFNetwork();
    final FlatNetworkRBF flat = (FlatNetworkRBF) result.getFlat();

    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("RBF-NETWORK")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        result.getProperties().putAll(params);
      }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public Object read(final InputStream is) {
    final TrainingContinuation result = new TrainingContinuation();
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("CONT")
          && section.getSubSectionName().equals("PARAMS")) {
        final Map<String, String> params = section.parseParams();
        for (final String key : params.keySet()) {
          if (key.equalsIgnoreCase("type")) {
View Full Code Here

    double pi[] = null;
    Matrix transitionProbability = null;
    Map<String,String> properties = null;
    List<StateDistribution> distributions = new ArrayList<StateDistribution>();
   
    final EncogReadHelper in = new EncogReadHelper(is);
    EncogFileSection section;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("HMM")
          && section.getSubSectionName().equals("PARAMS")) {
        properties = section.parseParams();
       
      }
View Full Code Here

TOP

Related Classes of org.encog.persist.EncogReadHelper

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.