Skip to content

Commit 8f53b64

Browse files
fix: resolve bugs in WarmupLR_withStepDecay and train config (#446)
* fix: resolve bugs in WarmupLR_withStepDecay and train config * fix: keep cmvn default as True, disable via config
1 parent 6423d3a commit 8f53b64

5 files changed

Lines changed: 28 additions & 2 deletions

File tree

examples/voxceleb/v2/conf/w2vbert_s1_lora.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ dataset_args:
4848
lora_dropout: 0.0
4949
bias: "none"
5050
# Note: w2vbert frontend handles feature extraction, no fbank_args needed
51+
cmvn: False
52+
spec_aug: False
53+
spec_aug_args:
54+
num_t_mask: 1
55+
num_f_mask: 1
56+
max_t: 10
57+
max_f: 8
58+
prob: 0.6
5159

5260
# Model definition
5361
model: W2VBert_Adapter_MFA # The new speaker model class

examples/voxceleb/v2/conf/w2vbert_s2_ft.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ dataset_args:
4242
frozen: False # Unfreeze the base W2V-BERT model
4343
use_lora: False # No LoRA in this stage
4444
lora_config_args: null
45+
cmvn: False
46+
spec_aug: False
47+
spec_aug_args:
48+
num_t_mask: 1
49+
num_f_mask: 1
50+
max_t: 10
51+
max_f: 8
52+
prob: 0.6
4553

4654
# Model definition (load S1 model, unfreeze frontend, remove LoRA)
4755
model: W2VBert_Adapter_MFA

examples/voxceleb/v2/conf/w2vbert_s3_lmft.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ dataset_args:
4343
frozen: False # Keep unfrozen
4444
use_lora: False
4545
lora_config_args: null
46+
cmvn: False
47+
spec_aug: False
48+
spec_aug_args:
49+
num_t_mask: 1
50+
num_f_mask: 1
51+
max_t: 10
52+
max_f: 8
53+
prob: 0.6
4654

4755
# Model definition (load S2 model)
4856
model: W2VBert_Adapter_MFA

wespeaker/bin/train.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ def train(config='conf/config.yaml', **kwargs):
176176
logger.info("<== Loss ==>")
177177
logger.info("loss criterion is: " + configs['loss'])
178178

179-
configs['optimizer_args']['lr'] = configs['scheduler_args']['initial_lr']
179+
if 'initial_lr' in configs['scheduler_args']:
180+
configs['optimizer_args']['lr'] = configs['scheduler_args'].pop(
181+
'initial_lr')
180182
optimizer = getattr(torch.optim,
181183
configs['optimizer'])(ddp_model.parameters(),
182184
**configs['optimizer_args'])

wespeaker/utils/schedulers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def __init__(
111111
gamma: float = 0.1,
112112
):
113113
self.optimizer = optimizer
114-
self.warmup_step = warmup_step
114+
self.warmup_step = warmup_step * epoch_iter
115115
self.num_epochs = num_epochs
116116
self.gamma = gamma
117117
self.epoch_iter = epoch_iter # number of batches in each epoch

0 commit comments

Comments
 (0)