Package org.encog.engine

Examples of org.encog.engine.EncogEngineError


    }

    copyContexts();

    if (this.reportedException != null) {
      throw (new EncogEngineError(this.reportedException));
    }
  }
View Full Code Here


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

      final cl_platform_id[] platformIDs = new cl_platform_id[5];
      CL.clGetPlatformIDs(platformIDs.length, platformIDs, numPlatforms);

      if (numPlatforms[0] == 0) {
        throw new EncogEngineError("Can't find any OpenCL platforms");
      }

      for (int i = 0; i < numPlatforms[0]; i++) {
        final cl_platform_id platformID = platformIDs[i];
        final EncogCLPlatform platform = new EncogCLPlatform(platformID);
View Full Code Here

   * Check to see if one of the threads has thrown an error. If so, then throw
   * that error.
   */
  public void checkError() {
    if (this.threadError != null) {
      throw new EncogEngineError(this.threadError);
    }
  }
View Full Code Here

      task.run();
    } else {
      if (this.threadError != null) {
        final Throwable t = this.threadError;
        this.threadError = null;
        throw new EncogEngineError(t);
      }

      final PoolItem item = new PoolItem(task, group);
      if (group != null) {
        group.taskStarting();
View Full Code Here

      try {
        this.executor.shutdown();
        this.executor.awaitTermination(timeout, TimeUnit.SECONDS);
        this.executor = null;
      } catch (final InterruptedException e) {
        throw new EncogEngineError(e);
      }
    }
  }
View Full Code Here

      final EngineDataSet training, final OpenCLTrainingProfile profile) {

    (new ValidateForOpenCL()).validate(network);

    if (!(training instanceof EngineIndexableSet)) {
      throw new EncogEngineError(
          "Training data must be Indexable for this training type.");
    }

    if (EncogEngine.getInstance().getCL() == null) {
      throw new EncogEngineError(
          "You must enable OpenCL before using this training type.");

    }

    this.profile = profile;
View Full Code Here

   */
  @Override
  public void iteration(final int iterations) {

    if (this.learningType == -1) {
      throw new EncogEngineError(
          "Learning type has not been defined yet, you must first call one of the learnXXXX methods, such as learnRPROP.");
    }

    this.iteration += iterations;
    int currentIndex = 0;
    this.error = 0;

    int count = this.profile.getKernelNumberOfCalls();

    // If we are using an OpenCL ratio other than 1.0, which means that we
    // are
    // braining up a single training iteration, there is no reason to try
    // and batch
    // up multiple iterations.
    if ((count > 0) && (iterations > 1)) {
      throw new EncogEngineError(
          "Must use an OpenCL ratio of 1.0 if you are going to use an iteration count > 1.");
    }

    this.kernel.setGlobalWork(this.profile.getKernelGlobalWorkgroup());
    this.kernel.setLocalWork(this.profile.getKernelLocalWorkgroup());
View Full Code Here

TOP

Related Classes of org.encog.engine.EncogEngineError

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.