This class implements a layer that calculates the loss function used for connectionist temporal classification (CTC).
void SetBlankLabel( int blankLabel );
Sets the value of the "blank" label that will be used as the space between other labels.
void SetAllowBlankLabelSkips( bool enabled );
Sets the flag that allows skipping the blank labels when aligning.
void SetLossWeight( float lossWeight );
Sets the multiplier for this function gradient during training. The default value is 1
. You may wish to change the default if you are using several loss functions in your network.
void SetMaxGradientValue( float maxValue );
Sets the upper limit for the absolute value of the function gradient. Whenever the gradient exceeds this limit its absolute value will be reduced to GetMaxGradientValue()
.
This layer has no trainable parameters.
The layer may have two to five inputs:
- The first input accepts a blob with the network response, of the dimensions:
BatchLength
is the maximum sequence length in the responseBatchWidth
is the number of sequences in the setListSize
is equal to1
Height * Width * Depth * Channels
is equal to the number of classes
- The second input accepts a blob with
int
data containing the correct labels, of the dimensions:BatchLength
is the maximum labels sequence lengthBatchWidth
is the number of sequences (should be equal toBatchWidth
of the first input)- the other dimensions are equal to
1
- [Optional] The third input accepts a blob with
int
data containing the label sequences' lengths. If this input is not connected, the label sequences are considered to be the second input'sBatchLength
long. This input dimensions are:BatchWidth
equal to the first inputBatchWidth
- the other dimensions are equal to
1
- [Optional] The fourth input accepts a blob with
int
data that contains the network response sequences' lengths. If this input is not connected, the network response sequences are considered to be the first input'sBatchLength
long. This input dimensions are:BatchWidth
equal to the first inputBatchWidth
- the other dimensions are equal to
1
- [Optional] The fifth input accepts a blob with the sequences' weights, of the dimensions:
BatchWidth
equal to the first inputBatchWidth
- the other dimensions are equal to
1
This layer has no output.
float GetLastLoss() const;
Use this method to get the value of the loss function calculated on the network's last run.