private void SetBackwardPassArgs() { // Arg 1: layerNodeCount (uint) ClHelpers.SetKernelArg( _backwardKernel, 1, (uint)NodeCount ); // Arg 2: nextLayerNodeCount (uint) ClHelpers.SetKernelArg( _backwardKernel, 2, (uint)0 ); // Arg 3: layerSums (float*) _layerSums.SetKernelArg(_backwardKernel, 3); // Arg 4: layerOutputs (float*) _layerOutputs.SetKernelArg(_backwardKernel, 4); // Arg 5: layerOutputs (float*) _layerDeltas.SetKernelArg(_backwardKernel, 5); // Arg 6: layerWeights (float*) _weights.SetKernelArg(_backwardKernel, 6); // Arg 7: layerBiases (float*) _biases.SetKernelArg(_backwardKernel, 7); // Arg 8: previousLayerOutputs (float*) GpuMatrix.SetNullKernelArg(_backwardKernel, 8); // Arg 9: nextLayerDeltas (float*) GpuMatrix.SetNullKernelArg(_backwardKernel, 9); // // Arg 10: nextLayerWeights (float*) GpuMatrix.SetNullKernelArg(_backwardKernel, 10); // Arg 11: targets (float*) GpuMatrix.SetNullKernelArg(_backwardKernel, 11); }
public void SetUp(FeedForwardLayer layer, ILayer previousLayer) { _dimensions = (uint)layer.Dimensionality.Length; _nodeCount = layer.NodeCount; // Arg 0: learningRate (double) ClHelpers.SetKernelArg( _updateKernel, 0, (double)_options.LearningRate ); // Arg 1: previousLayerNodeCount (uint) ClHelpers.SetKernelArg( _updateKernel, 1, (uint)previousLayer.NodeCount ); // Arg 2: layerNodeCount (uint) ClHelpers.SetKernelArg( _updateKernel, 2, (uint)layer.NodeCount ); // Arg 3: layerDeltas (float*) layer.Deltas.SetKernelArg( _updateKernel, 3 ); // Arg 4: layerWeights (float*) layer.Weights.SetKernelArg( _updateKernel, 4 ); // Arg 5: layerBiases (float*) layer.Biases.SetKernelArg( _updateKernel, 5 ); // Arg 6: previousLayerOutputs (float*) previousLayer.Outputs.SetKernelArg( _updateKernel, 6 ); }
private void SetForwardPassArgs() { // Arg 0: previousLayerNodeCount (uint) ClHelpers.SetKernelArg( _forwardKernel, 0, (uint)_previousLayerNodeCount ); // Arg 1: layerNodeCount (uint) ClHelpers.SetKernelArg( _forwardKernel, 1, (uint)NodeCount ); // Arg 3: layerWeights (float*) _weights.SetKernelArg(_forwardKernel, 3); // Arg 4: layerBiases (float*) _biases.SetKernelArg(_forwardKernel, 4); // Arg 5: layerSums (float*) _layerSums.SetKernelArg(_forwardKernel, 5); // Arg 6: layerOutputs (float*) _layerOutputs.SetKernelArg(_forwardKernel, 6); }