Package org.encog

Examples of org.encog.EncogError


    final ClassLoader loader = ResourceLoader.class.getClassLoader();
    final InputStream is = loader.getResourceAsStream(resource);

    if (is == null) {
      final String str = "Can't read resource: " + resource;
      throw new EncogError(str);
    }
    return is;
  }
View Full Code Here


        result.append(line);
        result.append("\r\n");
      }
      return result.toString();
    } catch (final IOException e) {
      throw new EncogError(e);
    } finally {
      try {
        if (is != null) {
          is.close();
        }
      } catch (final IOException e) {
        throw new EncogError(e);
      }
    }
  }
View Full Code Here

        try {
          if (!getNoTasks()) {
            this.mightBeDone.await();
          }
        } catch (InterruptedException e) {
          throw new EncogError(e);
        }
      } finally {
        this.accessLock.unlock();
      }
    }
View Full Code Here

    this.height = image.getHeight(this);
    if ((this.width == -1) || (this.height == -1)) {
      try {
        this.wait.acquire();
      } catch (final InterruptedException e) {
        throw new EncogError(e);
      }
    }

  }
View Full Code Here

   *            The input array to the activation function.
   * @return The derivative.
   */
  @Override
  public final double derivativeFunction(final double b, final double a) {
    throw new EncogError("Can't use the competitive activation function "
        + "where a derivative is required.");

  }
View Full Code Here

  public String getString(String name, boolean required, String defaultValue) {
    if (this.params.containsKey(name)) {
      return this.params.get(name);
    } else {
      if (required) {
        throw new EncogError("Missing property: " + name);
      } else {
        return defaultValue;
      }
    }
  }
View Full Code Here

      return defaultValue;
   
    try {
      return Integer.parseInt(str);
    } catch(NumberFormatException ex) {
      throw new EncogError("Property " + name + " has an invalid value of " + str + ", should be valid integer.");
    }
  }
View Full Code Here

  /**
   * Throw an error if this class is used improperly.
   */
  private void causeError() {
    throw new EncogError(FanInRandomizer.ERROR);
  }
View Full Code Here

   *            The set to determine the activations for.
   * @return The activations for the specified sets.
   */
  public final double[] encode(final int set) {
    if( set>this.matrix.length ) {
      throw new EncogError("Class out of range for equilateral: " + set);
    }
    return this.matrix[set];
  }
View Full Code Here

      return defaultValue;
   
    try {
      return this.format.parse(str);
    } catch(NumberFormatException ex) {
      throw new EncogError("Property " + name + " has an invalid value of " + str + ", should be valid floating point.");
    }
  }
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.