mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
feat: use SWA when finetuning
This commit is contained in:
1 parent
4eb719046b
commit
88b14f6ce1
1 file changed
+7
-1
@@ -36,6 +36,7 @@ from pytorch_lightning.callbacks import (
|
||||
LearningRateMonitor,
|
||||
ModelCheckpoint,
|
||||
RichProgressBar,
|
||||
StochasticWeightAveraging,
|
||||
)
|
||||
from pytorch_lightning.loggers import TensorBoardLogger
|
||||
from torch_audiomentations.utils.config import from_dict as get_augmentation
|
||||
@@ -110,7 +111,12 @@ def train(cfg: DictConfig) -> Optional[float]:
|
||||
# TODO: for fine-tuning and/or transfer learning, we start by fitting
|
||||
# TODO: task-dependent layers and gradully unfreeze more layers
|
||||
# TODO: callbacks.append(GraduallyUnfreeze(epochs_per_stage=1))
|
||||
pass
|
||||
swa = StochasticWeightAveraging(
|
||||
1e-2,
|
||||
swa_epoch_start=2,
|
||||
annealing_epochs=10,
|
||||
)
|
||||
callbacks.append(swa)
|
||||
|
||||
checkpoint = ModelCheckpoint(
|
||||
monitor=monitor,
|
||||
|
||||
Reference in new issue
Block a user