org.encog.engine.opencl.kernels
Class KernelNetworkCalc

java.lang.Object
  extended by org.encog.engine.opencl.kernels.EncogKernel
      extended by org.encog.engine.opencl.kernels.KernelNetworkCalc

public class KernelNetworkCalc
extends EncogKernel

An OpenCL kernel that is designed to calculate the output of a neural network.


Field Summary
static int PARRAY_INPUT_COUNT
          The input count.
static int PARRAY_ITEMS_PER
          Items to train per call.
static int PARRAY_ITERATIONS
          Items to train per call.
static int PARRAY_LAYER_COUNT
          The layer count.
static int PARRAY_LEARN
          Are we learning? 0=no, 1 =yes.
static int PARRAY_OUTPUT_COUNT
          The output count.
static int PARRAY_START
          What is the starting index to train at.
 
Constructor Summary
KernelNetworkCalc(EncogCLDevice device)
          Construct a kernel to train the network.
 
Method Summary
 void calculate(int start, int size)
          Calculate one iteration over the specified range.
 void compile(FlatNetwork network)
          Compile the kernel.
 double getError()
           
 float[] getErrors()
           
 FlatNetwork getFlat()
           
 EngineIndexableSet getTraining()
           
 void release()
          Release the kernel and all buffers.
 void setFlat(FlatNetwork flat)
           
 void setTraining(EngineIndexableSet training)
           
 
Methods inherited from class org.encog.engine.opencl.kernels.EncogKernel
compile, compile, createArrayReadOnly, createArrayReadOnly, createFloatArrayWriteOnly, getCLSource, getContext, getDevice, getGlobalWork, getKernel, getLocalWork, getMaxWorkGroupSize, getProgram, getSourceName, getWorkGroupLong, prepareKernel, releaseBuffer, setArg, setCLSource, setGlobalWork, setLocalWork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARRAY_INPUT_COUNT

public static final int PARRAY_INPUT_COUNT
The input count.

See Also:
Constant Field Values

PARRAY_OUTPUT_COUNT

public static final int PARRAY_OUTPUT_COUNT
The output count.

See Also:
Constant Field Values

PARRAY_LAYER_COUNT

public static final int PARRAY_LAYER_COUNT
The layer count.

See Also:
Constant Field Values

PARRAY_LEARN

public static final int PARRAY_LEARN
Are we learning? 0=no, 1 =yes.

See Also:
Constant Field Values

PARRAY_START

public static final int PARRAY_START
What is the starting index to train at.

See Also:
Constant Field Values

PARRAY_ITEMS_PER

public static final int PARRAY_ITEMS_PER
Items to train per call.

See Also:
Constant Field Values

PARRAY_ITERATIONS

public static final int PARRAY_ITERATIONS
Items to train per call.

See Also:
Constant Field Values
Constructor Detail

KernelNetworkCalc

public KernelNetworkCalc(EncogCLDevice device)
Construct a kernel to train the network.

Parameters:
device - The OpenCL device to use.
flat - The network to train.
training - The training data.
tempDataSize - How much temp data.
Method Detail

calculate

public void calculate(int start,
                      int size)
Calculate one iteration over the specified range.

Parameters:
start - The starting position to calculate for.
size - The ending position to calculate for.
iterations - The number of iterations to execute.
learn - True, if we should learn.

compile

public void compile(FlatNetwork network)
Compile the kernel.

Parameters:
options - The options.
profile - The OpenCL training profile.
network - The network to compile for.

getErrors

public float[] getErrors()
Returns:
the errors

release

public void release()
Release the kernel and all buffers.

Overrides:
release in class EncogKernel

getFlat

public FlatNetwork getFlat()

setFlat

public void setFlat(FlatNetwork flat)

getTraining

public EngineIndexableSet getTraining()

setTraining

public void setTraining(EngineIndexableSet training)

getError

public double getError()
Returns:
The error from the last evaluation.


Copyright © 2011. All Rights Reserved.