org.encog.engine.network.train.prop
Class OpenCLTrainingProfile

java.lang.Object
  extended by org.encog.engine.network.train.prop.OpenCLTrainingProfile

public class OpenCLTrainingProfile
extends Object

Specifies a training profile for an OpenCL training session. Includes the following information. device The device to use. local ratio: The local workgroup is a OpenCL concept where the global work group is broken into several local work groups. The bigger the local work group the faster things will run. However, your OpenCL device will impose a maximum local work group size. This ratio allows you to use a smaller local work group, for example 0.5 would be half of the max size of the local work group. You will almost always want to leave this value at the max 1.0. It is rare that you might need to decrease it because of the GPU being overtaxed. global ratio: The global work group must be a multiple of the local work group. The default value is 1, which means local and global workgroups the same size. Do not set this value lower than 1.0. Values higher than 1.0 can result in higher performance. Should be set to an integer value. For example, 2 would specify a global work workgroup twice the size of the local. Higher values will increase resource load on the GPU and may crash. segmentation ratio: The main purpose of this ratio is to allow you to scale back on how long the kernels take to execute. For maximum performance leave this value at the default 1.0 value. However, if your GPU is crashing, setting it to a value lower can help. If your are running Encog on the same GPU as your display uses, you may run into timeout issues if your kernel takes too long to execute. Setting this ratio lower can help.


Constructor Summary
OpenCLTrainingProfile(EncogCLDevice device)
          Construct a training profile with the specified device and the value of one for all ratios.
OpenCLTrainingProfile(EncogCLDevice device, double localRatio, int globalRatio, double segmentationRatio)
          Construct a training profile.
 
Method Summary
 void calculateKernelParams(EncogKernel kernel, EngineIndexableSet training)
          Calculate the kernel values.
 EncogCLDevice getDevice()
           
 int getGlobalRatio()
           
 int getKernelGlobalWorkgroup()
           
 int getKernelLocalWorkgroup()
           
 int getKernelNumberOfCalls()
           
 int getKernelRemainder()
           
 int getKernelRemainderGlobal()
           
 int getKernelRemainderPer()
           
 int getKernelWorkPerCall()
           
 double getLocalRatio()
           
 double getSegmentationRatio()
           
 void setDevice(EncogCLDevice device)
          Set the device to use.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenCLTrainingProfile

public OpenCLTrainingProfile(EncogCLDevice device)
Construct a training profile with the specified device and the value of one for all ratios.

Parameters:
device - The device to use.

OpenCLTrainingProfile

public OpenCLTrainingProfile(EncogCLDevice device,
                             double localRatio,
                             int globalRatio,
                             double segmentationRatio)
Construct a training profile.

Parameters:
device - The device to use.
localRatio - The local ratio.
globalRatio - The global ratio.
segmentationRatio - The segmentation ratio.
Method Detail

calculateKernelParams

public void calculateKernelParams(EncogKernel kernel,
                                  EngineIndexableSet training)
Calculate the kernel values.

Parameters:
kernel - The kernel to calculate for.
training - The training params to use.

getDevice

public EncogCLDevice getDevice()
Returns:
The device to use.

getGlobalRatio

public int getGlobalRatio()
Returns:
The global ratio.

getKernelGlobalWorkgroup

public int getKernelGlobalWorkgroup()
Returns:
The calculated size of the global workgroup.

getKernelLocalWorkgroup

public int getKernelLocalWorkgroup()
Returns:
The calculated size of the local workgroup.

getKernelNumberOfCalls

public int getKernelNumberOfCalls()
Returns:
The number of calls to the kernel that will be made. The number of segments.

getKernelRemainder

public int getKernelRemainder()
Returns:
The number of items in the remainder.

getKernelRemainderGlobal

public int getKernelRemainderGlobal()
Returns:
The size of the global and local workgroups for the remainder.

getKernelRemainderPer

public int getKernelRemainderPer()
Returns:
The number of training items processed per call in the remainder.

getKernelWorkPerCall

public int getKernelWorkPerCall()
Returns:
The number of training items processed per call.

getLocalRatio

public double getLocalRatio()
Returns:
The local ratio.

getSegmentationRatio

public double getSegmentationRatio()
Returns:
The segmentation ratio.

setDevice

public void setDevice(EncogCLDevice device)
Set the device to use.

Parameters:
device - The device to use.

toString

public String toString()
Overrides:
toString in class Object
Returns:
All internal values as a string.


Copyright © 2011. All Rights Reserved.