espnet2.asr.transducer.rnnt_multi_blank.rnnt_multi_blank.MultiblankRNNTLossNumba
Less than 1 minute
espnet2.asr.transducer.rnnt_multi_blank.rnnt_multi_blank.MultiblankRNNTLossNumba
class espnet2.asr.transducer.rnnt_multi_blank.rnnt_multi_blank.MultiblankRNNTLossNumba(blank, big_blank_durations, reduction='mean', fastemit_lambda: float = 0.0, clamp: float = -1, sigma: float = 0.0)
Bases: Module
Multiblank RNNT Loss Numba
- Parameters:
- blank (int) – standard blank label.
- big_blank_durations – list of durations for multi-blank transducer, e.g. [2, 4, 8].
- sigma – hyper-parameter for logit under-normalization method for training multi-blank transducers. Recommended value 0.05.
- https (Refer to) – //arxiv.org/pdf/2211.03541 for detailed explanations for the above parameters;
- reduction (string , optional) – Specifies the reduction to apply to the output: ‘none’ | ‘mean’ | ‘sum’. ‘none’: no reduction will be applied, ‘mean’: the output losses will be divided by the target lengths and then the mean over the batch is taken. Default: ‘mean’
- fastemit_lambda – Float scaling factor for FastEmit regularization. Refer to FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization.
- clamp – Float value. When set to value >= 0.0, will clamp the gradient to [-clamp, clamp].
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(acts, labels, act_lens, label_lens)
MultiblankRNNTLossNumba Forward.
log_probs: Tensor of (batch x seqLength x labelLength x outputDim) : containing output from network
labels: 2 dimensional Tensor containing all the targets of : the batch with zero padded
act_lens: Tensor of size (batch) containing size of each output : sequence from the network
label_lens: Tensor of (batch) containing label length of each example