scene_prediction#

(s3prl.task.scene_prediction)

ScenePredictionTask#

class s3prl.task.scene_prediction.ScenePredictionTask(model: Module, category: CategoryEncoder, prediction_type: str, scores: List[str])[source][source]#

Bases: Task

predict(x, x_len)[source][source]#
forward(_mode: str, x, x_len, y, labels, unique_name: 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.

call_super_init: bool = False[source]#
dump_patches: bool = False[source]#
get_state()[source]#
log_scores(score_args)[source][source]#

Logs the metric score value for each score defined for the model

parse_cached_results(cached_results: List[dict])[source]#
set_state(state: dict)[source]#
abstract test_reduction()[source]#
abstract test_step()[source]#
abstract train_reduction()[source]#
abstract train_step()[source]#
abstract valid_reduction()[source]#
abstract valid_step()[source]#
training: bool[source]#
reduction(_mode: str, cached_results: List[dict], _dump_dir: Optional[str] = None)[source][source]#