LossFunction

LossFunction#

MIOpen: LossFunction
LossFunction

Enumerations

enum  miopenCTCLossAlgo_t { MIOPEN_CTC_LOSS_ALGO_DETERMINISTIC = 0 }
 

Functions

 MIOPEN_DECLARE_OBJECT (miopenCTCLossDescriptor)
 Creates the miopenCTCLossDescriptor_t type. More...
 
miopenStatus_t miopenCreateCTCLossDescriptor (miopenCTCLossDescriptor_t *ctcLossDesc)
 Create a CTC loss function Descriptor. More...
 
miopenStatus_t miopenGetCTCLossDescriptor (miopenCTCLossDescriptor_t ctcLossDesc, miopenDataType_t *dataType, int *blank_label_id, bool *apply_softmax_layer)
 Retrieves a CTC loss function descriptor's details. More...
 
miopenStatus_t miopenDestroyCTCLossDescriptor (miopenCTCLossDescriptor_t ctcLossDesc)
 Destroys a CTC loss function descriptor object. More...
 
miopenStatus_t miopenSetCTCLossDescriptor (miopenCTCLossDescriptor_t ctcLossDesc, miopenDataType_t dataType, const int blank_label_id, bool apply_softmax_layer)
 Set the details of a CTC loss function descriptor. More...
 
miopenStatus_t miopenGetCTCLossWorkspaceSize (miopenHandle_t handle, const miopenTensorDescriptor_t probsDesc, const miopenTensorDescriptor_t gradientsDesc, const int *labels, const int *labelLengths, const int *inputLengths, miopenCTCLossAlgo_t algo, const miopenCTCLossDescriptor_t ctcLossDesc, size_t *workSpaceSize)
 Query the amount of memory required to execute miopenCTCLoss. More...
 
miopenStatus_t miopenCTCLoss (miopenHandle_t handle, const miopenTensorDescriptor_t probsDesc, const void *probs, const int *labels, const int *labelLengths, const int *inputLengths, void *losses, const miopenTensorDescriptor_t gradientsDesc, void *gradients, miopenCTCLossAlgo_t algo, const miopenCTCLossDescriptor_t ctcLossDesc, void *workSpace, size_t workSpaceSize)
 Execute forward inference for CTCLoss layer. More...
 

Detailed Description

Enumeration Type Documentation

◆ miopenCTCLossAlgo_t

Algorithms available to execute the CTC loss operation

Enumerator
MIOPEN_CTC_LOSS_ALGO_DETERMINISTIC 

Results are guaranteed to be reproducible

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.

Function Documentation

◆ MIOPEN_DECLARE_OBJECT()

MIOPEN_DECLARE_OBJECT ( miopenCTCLossDescriptor  )

Creates the miopenCTCLossDescriptor_t type.

◆ miopenCreateCTCLossDescriptor()

miopenStatus_t miopenCreateCTCLossDescriptor ( miopenCTCLossDescriptor_t *  ctcLossDesc)

Create a CTC loss function Descriptor.

API for creating an uninitialized CTC loss function descriptor.

Parameters
ctcLossDescPointer to the CTC loss function descriptor type (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.

◆ miopenCTCLoss()

miopenStatus_t miopenCTCLoss ( miopenHandle_t  handle,
const miopenTensorDescriptor_t  probsDesc,
const void *  probs,
const int *  labels,
const int *  labelLengths,
const int *  inputLengths,
void *  losses,
const miopenTensorDescriptor_t  gradientsDesc,
void *  gradients,
miopenCTCLossAlgo_t  algo,
const miopenCTCLossDescriptor_t  ctcLossDesc,
void *  workSpace,
size_t  workSpaceSize 
)

Execute forward inference for CTCLoss layer.

Interface for executing the forward inference pass on a CTCLoss.

Parameters
handleMIOpen handle (input)
probsDescTensor descriptor for probabilities (input)
probsPointer to the probabilities tensor (input)
labelsPointer to the flattened labels list (input)
labelLengthsPointer to the lengths list for "labels" (input)
inputLengthsPointer to the list of the time steps in each batch (input)
lossesPointer to the computed losses of CTC (Output)
gradientsDescTensor descriptor for gradients (input)
gradientsPointer to the computed gradients of CTC (Output)
algoCTC loss algorithm selected (input)
ctcLossDescCTC loss function descriptor type (input)
workSpacePointer to memory allocated for execute CTC loss operation (input)
workSpaceSizeNumber of bytes of workspace required for CTC loss operation with selected algorithm (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.

◆ miopenDestroyCTCLossDescriptor()

miopenStatus_t miopenDestroyCTCLossDescriptor ( miopenCTCLossDescriptor_t  ctcLossDesc)

Destroys a CTC loss function descriptor object.

Parameters
ctcLossDescCTC loss function descriptor type (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.

◆ miopenGetCTCLossDescriptor()

miopenStatus_t miopenGetCTCLossDescriptor ( miopenCTCLossDescriptor_t  ctcLossDesc,
miopenDataType_t dataType,
int *  blank_label_id,
bool *  apply_softmax_layer 
)

Retrieves a CTC loss function descriptor's details.

Parameters
ctcLossDescCTC loss function descriptor (input)
dataTypeData type used in this CTC loss operation, only fp32 currently supported (output)
blank_label_idUser defined index for blank label (output)
apply_softmax_layerBoolean to toggle input layer property (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.

◆ miopenGetCTCLossWorkspaceSize()

miopenStatus_t miopenGetCTCLossWorkspaceSize ( miopenHandle_t  handle,
const miopenTensorDescriptor_t  probsDesc,
const miopenTensorDescriptor_t  gradientsDesc,
const int *  labels,
const int *  labelLengths,
const int *  inputLengths,
miopenCTCLossAlgo_t  algo,
const miopenCTCLossDescriptor_t  ctcLossDesc,
size_t *  workSpaceSize 
)

Query the amount of memory required to execute miopenCTCLoss.

This function calculates the amount of memory required to run the CTC loss function given a CTC loss function descriptor with the specified algorithm.

Parameters
handleMIOpen handle (input)
probsDescTensor descriptor for probabilities (input)
gradientsDescTensor descriptor for gradients (input)
labelsPointer to the flattened labels list (input)
labelLengthsPointer to the lengths list for "labels" (input)
inputLengthsPointer to the list of the time steps in each batch (input)
algoCTC loss algorithm selected (input)
ctcLossDescCTC loss function descriptor type (input)
workSpaceSizeNumber of bytes of workspace required for CTC loss operation with selected algorithm (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.

◆ miopenSetCTCLossDescriptor()

miopenStatus_t miopenSetCTCLossDescriptor ( miopenCTCLossDescriptor_t  ctcLossDesc,
miopenDataType_t  dataType,
const int  blank_label_id,
bool  apply_softmax_layer 
)

Set the details of a CTC loss function descriptor.

Parameters
ctcLossDescCTC loss function descriptor type (input)
dataTypeData type used in this CTC loss operation, only fp32 currently supported (input)
blank_label_idUser defined index for blank label, default 0 (input)
apply_softmax_layerBoolean to toggle input layer property (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.2/include/miopen/miopen.h.