Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function computes the gradient of a pooling operation.
/// </summary>
/// <param name="poolingDesc">Handle to the previously initialized pooling descriptor.</param>
/// <param name="alpha">Pointer to scaling factors (in host memory) used to blend the computation
/// result with prior value in the output layer as follows: dstValue =
/// alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
/// additional details.</param>
/// <param name="yDesc">Handle to the previously initialized input tensor descriptor.</param>
/// <param name="y">Data pointer to GPU memory associated with the tensor descriptor srcDesc.</param>
/// <param name="dyDesc">Handle to the previously initialized input differential tensor descriptor.</param>
/// <param name="dy">Data pointer to GPU memory associated with the tensor descriptor srcDiffData.</param>
/// <param name="xDesc">Handle to the previously initialized output tensor descriptor.</param>
/// <param name="x">Data pointer to GPU memory associated with the output tensor descriptor destDesc.</param>
/// <param name="beta">Pointer to scaling factors (in host memory) used to blend the computation
/// result with prior value in the output layer as follows: dstValue =
/// alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
/// additional details.</param>
/// <param name="dxDesc">Handle to the previously initialized output differential tensor descriptor.</param>
/// <param name="dx">Data pointer to GPU memory associated with the output tensor descriptor destDiffDesc.</param>
This function computes the gradient of a pooling operation.
This function computes the gradient of a pooling operation .
public void PoolingBackward(PoolingDescriptor poolingDesc,
                                    float alpha,
                                    TensorDescriptor yDesc,
                                    CudaDeviceVariable<float> y,
                                    TensorDescriptor dyDesc,
                                    CudaDeviceVariable<float> dy,
                                    TensorDescriptor xDesc,
                                    CudaDeviceVariable<float> x,
                                    float beta,
                                    TensorDescriptor dxDesc,
                                    CudaDeviceVariable<float> dx
                                    )
        {
            res = CudaDNNNativeMethods.cudnnPoolingBackward(_handle, poolingDesc.Desc, ref alpha, yDesc.Desc, y.DevicePointer, dyDesc.Desc, dy.DevicePointer, xDesc.Desc, x.DevicePointer, ref beta, dxDesc.Desc, dx.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnPoolingBackward", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void PoolingBackward ( PoolingDescriptor poolingDesc , float alpha , TensorDescriptor yDesc , CudaDeviceVariable < float > y , TensorDescriptor dyDesc , CudaDeviceVariable < float > dy , TensorDescriptor xDesc , CudaDeviceVariable < float > x , float beta , TensorDescriptor dxDesc , CudaDeviceVariable < float > dx ) { res = CudaDNNNativeMethods . cudnnPoolingBackward ( _handle , poolingDesc . Desc , ref alpha , yDesc . Desc , y . DevicePointer , dyDesc . Desc , dy . DevicePointer , xDesc . Desc , x . DevicePointer , ref beta , dxDesc . Desc , dx . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function computes the gradient of a pooling operation.
This function computes the gradient of a pooling operation .
poolingDesc
PoolingDescriptor
Handle to the previously initialized pooling descriptor.
Handle to the previously initialized pooling descriptor .
alpha
float
Pointer to scaling factors (in host memory) used to blend the computation
result with prior value in the output layer as follows: dstValue
alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
additional details.
Pointer to scaling factors ( in host memory ) used to blend the computation result with prior value in the output layer as follows : dstValue alpha [ 0 ] * result + beta [ 0 ] * priorDstValue . Please refer to this section for additional details .
yDesc
TensorDescriptor
Handle to the previously initialized input tensor descriptor.
Handle to the previously initialized input tensor descriptor .
y
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the tensor descriptor srcDesc.
Data pointer to GPU memory associated with the tensor descriptor srcDesc .
dyDesc
TensorDescriptor
Handle to the previously initialized input differential tensor descriptor.
Handle to the previously initialized input differential tensor descriptor .
dy
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the tensor descriptor srcDiffData.
Data pointer to GPU memory associated with the tensor descriptor srcDiffData .
xDesc
TensorDescriptor
Handle to the previously initialized output tensor descriptor.
Handle to the previously initialized output tensor descriptor .
x
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the output tensor descriptor destDesc.
Data pointer to GPU memory associated with the output tensor descriptor destDesc .
beta
float
Pointer to scaling factors (in host memory) used to blend the computation
result with prior value in the output layer as follows: dstValue
alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
additional details.
Pointer to scaling factors ( in host memory ) used to blend the computation result with prior value in the output layer as follows : dstValue alpha [ 0 ] * result + beta [ 0 ] * priorDstValue . Please refer to this section for additional details .
dxDesc
TensorDescriptor
Handle to the previously initialized output differential tensor descriptor.
Handle to the previously initialized output differential tensor descriptor .
dx
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the output tensor descriptor destDiffDesc.
Data pointer to GPU memory associated with the output tensor descriptor destDiffDesc .