base#

(s3prl.task.base)

The abstract Task

Authors
  • Leo 2022

Task#

class s3prl.task.base.Task[source][source]#

Bases: Module

get_state()[source][source]#
set_state(state: dict)[source][source]#
parse_cached_results(cached_results: List[dict])[source][source]#
abstract predict()[source][source]#
forward(mode: str, *args, **kwargs)[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.

reduction(mode: str, *args, **kwargs)[source][source]#
abstract train_step()[source][source]#
abstract valid_step()[source][source]#
abstract test_step()[source][source]#
abstract train_reduction()[source][source]#
abstract valid_reduction()[source][source]#
abstract test_reduction()[source][source]#
call_super_init: bool = False[source]#
dump_patches: bool = False[source]#
training: bool[source]#