Class CTCLossDescriptor
Inheritance
Implements
Inherited Members
Namespace: ManagedCuda.CudaDNN
Assembly: CudaDNN.dll
Syntax
public class CTCLossDescriptor : IDisposable
Constructors
| Improve this Doc View SourceCTCLossDescriptor(CudaDNNContext)
Declaration
public CTCLossDescriptor(CudaDNNContext context)
Parameters
Type | Name | Description |
---|---|---|
CudaDNNContext | context |
Properties
| Improve this Doc View SourceDesc
Returns the inner handle.
Declaration
public cudnnCTCLossDescriptor Desc { get; }
Property Value
Type | Description |
---|---|
cudnnCTCLossDescriptor |
Methods
| Improve this Doc View SourceCTCLoss(CudaDNNContext, TensorDescriptor, CudaDeviceVariable<Double>, Int32[], Int32[], Int32[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, cudnnCTCLossAlgo, CudaDeviceVariable<Byte>)
This function returns the ctc costs and gradients, given the probabilities and labels.
Declaration
public void CTCLoss(CudaDNNContext handle, TensorDescriptor probsDesc, CudaDeviceVariable<double> probs, int[] labels, int[] labelLengths, int[] inputLengths, CudaDeviceVariable<double> costs, TensorDescriptor gradientsDesc, CudaDeviceVariable<double> gradients, cudnnCTCLossAlgo algo, CudaDeviceVariable<byte> workspace)
Parameters
Type | Name | Description |
---|---|---|
CudaDNNContext | handle | Handle to a previously created cuDNN context. |
TensorDescriptor | probsDesc | Handle to the previously initialized probabilities tensor descriptor. |
CudaDeviceVariable<System.Double> | probs | Pointer to a previously initialized probabilities tensor. |
System.Int32[] | labels | Pointer to a previously initialized labels list. |
System.Int32[] | labelLengths | Pointer to a previously initialized lengths list, to walk the above labels list. |
System.Int32[] | inputLengths | Pointer to a previously initialized list of the lengths of the timing steps in each batch. |
CudaDeviceVariable<System.Double> | costs | Pointer to the computed costs of CTC. |
TensorDescriptor | gradientsDesc | Handle to a previously initialized gradients tensor descriptor. |
CudaDeviceVariable<System.Double> | gradients | Pointer to the computed gradients of CTC. |
cudnnCTCLossAlgo | algo | Enumerant that specifies the chosen CTC loss algorithm. |
CudaDeviceVariable<System.Byte> | workspace | Pointer to GPU memory of a workspace needed to able to execute the specified algorithm. |
CTCLoss(CudaDNNContext, TensorDescriptor, CudaDeviceVariable<Single>, Int32[], Int32[], Int32[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, cudnnCTCLossAlgo, CudaDeviceVariable<Byte>)
This function returns the ctc costs and gradients, given the probabilities and labels.
Declaration
public void CTCLoss(CudaDNNContext handle, TensorDescriptor probsDesc, CudaDeviceVariable<float> probs, int[] labels, int[] labelLengths, int[] inputLengths, CudaDeviceVariable<float> costs, TensorDescriptor gradientsDesc, CudaDeviceVariable<float> gradients, cudnnCTCLossAlgo algo, CudaDeviceVariable<byte> workspace)
Parameters
Type | Name | Description |
---|---|---|
CudaDNNContext | handle | Handle to a previously created cuDNN context. |
TensorDescriptor | probsDesc | Handle to the previously initialized probabilities tensor descriptor. |
CudaDeviceVariable<System.Single> | probs | Pointer to a previously initialized probabilities tensor. |
System.Int32[] | labels | Pointer to a previously initialized labels list. |
System.Int32[] | labelLengths | Pointer to a previously initialized lengths list, to walk the above labels list. |
System.Int32[] | inputLengths | Pointer to a previously initialized list of the lengths of the timing steps in each batch. |
CudaDeviceVariable<System.Single> | costs | Pointer to the computed costs of CTC. |
TensorDescriptor | gradientsDesc | Handle to a previously initialized gradients tensor descriptor. |
CudaDeviceVariable<System.Single> | gradients | Pointer to the computed gradients of CTC. |
cudnnCTCLossAlgo | algo | Enumerant that specifies the chosen CTC loss algorithm. |
CudaDeviceVariable<System.Byte> | workspace | Pointer to GPU memory of a workspace needed to able to execute the specified algorithm. |
CTCLoss(CudaDNNContext, TensorDescriptor, Int32[], Int32[], Int32[], TensorDescriptor, cudnnCTCLossAlgo)
return the workspace size needed for ctc
Declaration
public SizeT CTCLoss(CudaDNNContext handle, TensorDescriptor probsDesc, int[] labels, int[] labelLengths, int[] inputLengths, TensorDescriptor gradientsDesc, cudnnCTCLossAlgo algo)
Parameters
Type | Name | Description |
---|---|---|
CudaDNNContext | handle | Handle to a previously created cuDNN context. |
TensorDescriptor | probsDesc | Handle to the previously initialized probabilities tensor descriptor. |
System.Int32[] | labels | Pointer to a previously initialized labels list. |
System.Int32[] | labelLengths | Pointer to a previously initialized lengths list, to walk the above labels list. |
System.Int32[] | inputLengths | Pointer to a previously initialized list of the lengths of the timing steps in each batch. |
TensorDescriptor | gradientsDesc | Handle to a previously initialized gradients tensor descriptor. |
cudnnCTCLossAlgo | algo | Enumerant that specifies the chosen CTC loss algorithm |
Returns
Type | Description |
---|---|
SizeT | Amount of GPU memory needed as workspace to be able to execute the CTC loss computation with the specified algo. |
Dispose()
Dispose
Declaration
public void Dispose()
Dispose(Boolean)
For IDisposable
Declaration
protected virtual void Dispose(bool fDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | fDisposing |
Finalize()
For dispose
Declaration
protected void Finalize()
SetCTCLossDescriptor(cudnnDataType)
This function initializes a previously created CTC Loss descriptor object.
Declaration
public void SetCTCLossDescriptor(cudnnDataType dataType)
Parameters
Type | Name | Description |
---|---|---|
cudnnDataType | dataType | Math precision. |