athena.models.mtl_seq2seq¶
a implementation of deep speech 2 model can be used as a sample for ctc model
Module Contents¶
Classes¶
MtlTransformerCtc |
In speech recognition, adding CTC loss to Attention-based seq-to-seq model is known to |
-
class
athena.models.mtl_seq2seq.MtlTransformerCtc(data_descriptions, config=None)¶ Bases:
athena.models.base.BaseModelIn speech recognition, adding CTC loss to Attention-based seq-to-seq model is known to help convergence. It usually gives better results than using attention alone.
-
SUPPORTED_MODEL¶
-
default_config¶
-
call(self, samples, training=None)¶ call function in keras layers
-
get_loss(self, outputs, samples, training=None)¶ get loss used for training
-
compute_logit_length(self, samples)¶ compute the logit length
-
reset_metrics(self)¶ reset the metrics
-
restore_from_pretrained_model(self, pretrained_model, model_type='')¶ A more general-purpose interface for pretrained model restoration
Parameters: - pretrained_model – checkpoint path of mpc model
- model_type – the type of pretrained model to restore
-
decode(self, samples, hparams, decoder)¶ Initialization of the model for decoding, decoder is called here to create predictions :param samples: the data source to be decoded :param hparams: decoding configs are included here :param decoder: it contains the main decoding operations
Returns: the corresponding decoding results Return type: predictions
-
deploy(self)¶ deployment function
-