fairseq2.recipes.wav2vec2.train¶
classDiagram ABC <|-- CliCommandHandler CliCommandHandler <|-- RecipeCommandHandler Generic <|-- RecipeCommandHandler
Classes¶
- class fairseq2.recipes.wav2vec2.train.Wav2Vec2TrainConfig(*, dataset='librispeech_960h', train_split='train', valid_split='valid', min_audio_len=32000, max_audio_len=250000, max_num_elements=1500000, normalize_audio=False, batch_shuffle_window=0, num_prefetch=4, model_family='wav2vec2', model_arch='base', model_config=None, dtype=torch.float16, data_parallelism='ddp', fsdp_wrap_granularity='stack', torch_compile=False, optimizer='adamw', optimizer_config=<factory>, lr_scheduler='polynomial-decay', lr_scheduler_config=<factory>, max_gradient_norm=None, fp16_loss_scale=(128.0, 0.0001), gradient_accumulation=1, diversity_loss_weight=0.1, feature_penalty_weight=10.0, max_num_steps=400000, max_num_data_epochs=None, validate_every_n_steps=5000, checkpoint_every_n_steps=25000, keep_best_n_checkpoints=1, publish_metrics_every_n_steps=200, resume_checkpoint_dir=None, seed=2, profile=None, monitored_gang=False, anomaly_detection=False)[source]¶
Bases:
object
Holds the configuration of a wav2vec 2.0 model training task.
The default values correspond to the base ls960h training setup as described in Baevski et al. [BZMA20].
- dataset: str | AssetCard | Path = 'librispeech_960h'¶
The name, path or path to the asset card of the speech dataset.
- fsdp_wrap_granularity: Literal['layer', 'stack', 'model'] = 'stack'¶
The granularity at which to wrap the model.
- max_gradient_norm: float | None = None¶
The maximum gradient norm. If
None
, no clipping will be applied.
- fp16_loss_scale: tuple[float, float] = (128.0, 0.0001)¶
The initial and minimum loss scale for fp16 training.
- gradient_accumulation: int = 1¶
The number of steps to accumulate gradients before an optimizer update.
- feature_penalty_weight: float = 10.0¶
The weight of the regularization penalty applied to the extracted features.
- keep_best_n_checkpoints: int | None = 1¶
The number of checkpoints to keep based on their validation score. If
None
, none will be deleted.
- resume_checkpoint_dir: Path | None = None¶
If not
None
, adds the specified path to the default asset store.