Library/ManagedCuda/CudaDNN/CudaDNNNativeMethods.cs
/// <summary>
/// return the ctc costs and gradients, given the probabilities and labels
/// </summary>
/// <param name="handle"></param>
/// <param name="probsDesc"></param>
/// <param name="probs"></param>
/// <param name="labels"></param>
/// <param name="labelLengths"></param>
/// <param name="inputLengths"></param>
/// <param name="costs"></param>
/// <param name="gradientsDesc"></param>
/// <param name="gradients"></param>
/// <param name="algo"></param>
/// <param name="ctcLossDesc"></param>
/// <param name="workspace"></param>
/// <param name="workSpaceSizeInBytes"></param>
/// <returns></returns>
return the ctc costs and gradients, given the probabilities and labels
return the ctc costs and gradients given the probabilities and labels
[DllImport(CUDNN_API_DLL_NAME)]
        public static extern cudnnStatus cudnnCTCLoss(cudnnHandle handle,
                                        cudnnTensorDescriptor probsDesc,     
                                        CUdeviceptr probs,                          
                                        int[] labels,                          
                                        int[] labelLengths,                    
                                        int[] inputLengths,                    
                                        CUdeviceptr costs,                                
                                        cudnnTensorDescriptor gradientsDesc, 
                                        CUdeviceptr gradients,                      
                                        cudnnCTCLossAlgo algo,                     
                                        cudnnCTCLossDescriptor ctcLossDesc,
                                        CUdeviceptr workspace,                            
                                        SizeT workSpaceSizeInBytes);
[ DllImport ( CUDNN_API_DLL_NAME ) ] public static extern cudnnStatus cudnnCTCLoss ( cudnnHandle handle , cudnnTensorDescriptor probsDesc , CUdeviceptr probs , int [ ] labels , int [ ] labelLengths , int [ ] inputLengths , CUdeviceptr costs , cudnnTensorDescriptor gradientsDesc , CUdeviceptr gradients , cudnnCTCLossAlgo algo , cudnnCTCLossDescriptor ctcLossDesc , CUdeviceptr workspace , SizeT workSpaceSizeInBytes ) ;
return the ctc costs and gradients, given the probabilities and labels
return the ctc costs and gradients given the probabilities and labels
/* Tensor descriptor for probabilities, the dimensions are T,N,A (T is the timing steps, N is the mini batch size, A is the alphabet size)  */ /* probabilities after softmax, in GPU memory */ /* labels, in CPU memory */ /* the length of each label, in CPU memory */ /* the lengths of timing steps in each batch, in CPU memory */ /* the returned costs of CTC, in GPU memory */ /* Tensor descriptor for gradients, the dimensions are T,N,A */ /* the returned CTC gradients, in GPU memory, to compute costs only, set it to NULL */ /* algorithm selected, supported now 0 and 1 */ /* pointer to the workspace, in GPU memory */
None
handle
cudnnHandle
None
probsDesc
cudnnTensorDescriptor
None
probs
CUdeviceptr
None
labels
int[]
None
labelLengths
int[]
None
inputLengths
int[]
None
costs
CUdeviceptr
None
gradientsDesc
cudnnTensorDescriptor
None
gradients
CUdeviceptr
None
algo
cudnnCTCLossAlgo
None
ctcLossDesc
cudnnCTCLossDescriptor
None
workspace
CUdeviceptr
None
workSpaceSizeInBytes
SizeT
None