utterance_classification_task#
(s3prl.task.utterance_classification_task)
Utterance Classification Tasks
- Authors
Leo 2022
UtteranceClassifierExample#
- class s3prl.task.utterance_classification_task.UtteranceClassifierExample(input_size=3, output_size=4)[source][source]#
Bases:
Module
UtteranceClassificationTask#
- class s3prl.task.utterance_classification_task.UtteranceClassificationTask(model: UtteranceClassifierExample, category: CategoryEncoder)[source][source]#
Bases:
Task
- predict(x: Tensor, x_len: LongTensor)[source][source]#
- Parameters:
x (torch.Tensor) – (batch_size, timestamps, input_size)
x_len (torch.LongTensor) – (batch_size, )
- Returns:
(batch_size, output_size) prediction (list): prediction strings
- Return type:
logits (torch.Tensor)
- forward(_mode: str, x: Tensor, x_len: LongTensor, class_id: LongTensor, label: List[str], unique_name: List[str], _dump_dir: Optional[str] = None)[source][source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.