paddlespeech.t2s.training.extension module

class paddlespeech.t2s.training.extension.Extension[source]

Bases: object

Extension to customize the behavior of Trainer.

Attributes:
default_name

Default name of the extension, class name by default.

name

Methods

__call__(trainer)

Main action of the extention.

finalize(trainer)

Action that is executed when training is done.

initialize(trainer)

Action that is executed once to get the corect trainer state.

on_error(trainer, exc, tb)

Handles the error raised during training before finalization.

property default_name

Default name of the extension, class name by default.

finalize(trainer)[source]

Action that is executed when training is done. For example, visualizers would need to be closed.

initialize(trainer)[source]

Action that is executed once to get the corect trainer state. It is called before training normally, but if the trainer restores states with an Snapshot extension, this method should also be called.g

name = None
on_error(trainer, exc, tb)[source]

Handles the error raised during training before finalization.

priority = 100
trigger = (1, 'iteration')
paddlespeech.t2s.training.extension.make_extension(trigger: Optional[Callable] = None, default_name: Optional[str] = None, priority: Optional[int] = None, finalizer: Optional[Callable] = None, initializer: Optional[Callable] = None, on_error: Optional[Callable] = None)[source]

Make an Extension-like object by injecting required attributes to it.