File size: 6,879 Bytes
e60d96b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# pytorch_lightning==1.9.3
seed_everything: 123
trainer:
  logger:
    class_path: pytorch_lightning.loggers.TensorBoardLogger
    init_args:
      save_dir: logs
      name: exp_contrastive_sameclip_v2
      version: null
      log_graph: false
      default_hp_metric: true
      prefix: ''
      sub_dir: null
  enable_checkpointing: true
  callbacks:
  - class_path: pytorch_lightning.callbacks.ModelCheckpoint
    init_args:
      dirpath: null
      filename: best-val-loss-{epoch}-{step}
      monitor: loss/val
      verbose: false
      save_last: null
      save_top_k: 1
      save_weights_only: false
      mode: min
      auto_insert_metric_name: true
      every_n_train_steps: null
      train_time_interval: null
      every_n_epochs: null
      save_on_train_epoch_end: null
  - class_path: pytorch_lightning.callbacks.ModelCheckpoint
    init_args:
      dirpath: null
      filename: best-eer-val-{epoch}-{step}
      monitor: EER evaluation proj/val
      verbose: false
      save_last: null
      save_top_k: 1
      save_weights_only: false
      mode: min
      auto_insert_metric_name: true
      every_n_train_steps: null
      train_time_interval: null
      every_n_epochs: null
      save_on_train_epoch_end: null
  - class_path: pytorch_lightning.callbacks.ModelCheckpoint
    init_args:
      dirpath: null
      filename: best-rank-val-{epoch}-{step}
      monitor: Order evaluation mean proj/val
      verbose: false
      save_last: null
      save_top_k: 1
      save_weights_only: false
      mode: min
      auto_insert_metric_name: true
      every_n_train_steps: null
      train_time_interval: null
      every_n_epochs: null
      save_on_train_epoch_end: null
  - class_path: pytorch_lightning.callbacks.ModelCheckpoint
    init_args:
      dirpath: null
      filename: best-alignment-val-{epoch}-{step}
      monitor: Alignment evaluation proj/val
      verbose: false
      save_last: null
      save_top_k: 1
      save_weights_only: false
      mode: min
      auto_insert_metric_name: true
      every_n_train_steps: null
      train_time_interval: null
      every_n_epochs: null
      save_on_train_epoch_end: null
  - class_path: pytorch_lightning.callbacks.ModelCheckpoint
    init_args:
      dirpath: null
      filename: best-uniformity-val-{epoch}-{step}
      monitor: Uniformity evaluation proj/val
      verbose: false
      save_last: null
      save_top_k: 1
      save_weights_only: false
      mode: min
      auto_insert_metric_name: true
      every_n_train_steps: null
      train_time_interval: null
      every_n_epochs: null
      save_on_train_epoch_end: null
  - class_path: pytorch_lightning.callbacks.ModelCheckpoint
    init_args:
      dirpath: null
      filename: cptk-{epoch}-{step}
      monitor: null
      verbose: false
      save_last: null
      save_top_k: -1
      save_weights_only: false
      mode: min
      auto_insert_metric_name: true
      every_n_train_steps: null
      train_time_interval: null
      every_n_epochs: 25
      save_on_train_epoch_end: null
  - class_path: callbacks.evaluation.OrderEvaluation
    init_args:
      log_n_epochs: 5
      on_train: true
      use_projection: true
  - class_path: callbacks.evaluation.EEREvaluation
    init_args:
      use_more_neg: false
      log_n_epochs: 5
      on_train: false
      use_projection: true
  - class_path: callbacks.evaluation.HypersphereEvaluation
    init_args:
      log_n_epochs: 5
      on_train: true
      use_projection: true
  default_root_dir: null
  gradient_clip_val: null
  gradient_clip_algorithm: null
  num_nodes: 1
  num_processes: null
  devices: null
  gpus: 1
  auto_select_gpus: null
  tpu_cores: null
  ipus: null
  enable_progress_bar: true
  overfit_batches: 0.0
  track_grad_norm: -1
  check_val_every_n_epoch: 1
  fast_dev_run: false
  accumulate_grad_batches: null
  max_epochs: 100000
  min_epochs: null
  max_steps: 1000000000
  min_steps: null
  max_time: null
  limit_train_batches: null
  limit_val_batches: null
  limit_test_batches: null
  limit_predict_batches: null
  val_check_interval: null
  log_every_n_steps: 50
  accelerator: gpu
  strategy: null
  sync_batchnorm: false
  precision: 32
  enable_model_summary: true
  num_sanity_val_steps: 2
  resume_from_checkpoint: null
  profiler: null
  benchmark: null
  deterministic: null
  reload_dataloaders_every_n_epochs: 0
  auto_lr_find: false
  replace_sampler_ddp: true
  detect_anomaly: false
  auto_scale_batch_size: false
  plugins: null
  amp_backend: null
  amp_level: null
  move_metrics_to_cpu: false
  multiple_trainloader_mode: max_size_cycle
  inference_mode: true
ckpt_path: null
model:
  class_path: models.trainer.ContrastiveTrainer
  init_args:
    feature_extractor:
      spec_layer: melspectogram
      n_fft: 2048
      hop_length: 512
    backbone:
      backbone: efficientnet_b0
      pretrained: true
      embedding_dim: 1000
    projection:
      input_dim: 1000
      output_dim: 128
      l2_normalize: true
    optimizer1_init:
      class_path: torch.optim.Adam
      init_args:
        lr: 0.0001
        weight_decay: 1.0e-05
    use_contrastive_loss: true
    temp: 0.2
    nr_negative: 250
    decouple: true
    use_norm_reg: false
    max_norm_hinge: 4.0
    norm_hinge_fact: 10.0
    use_invariance_loss: false
    fact_inv_loss: 1.0
    use_covariance_reg: false
    fact_cov: 1.0
    use_variance_reg: false
    fact_var: 1.0
    gamma: 1.0
    use_vicreg_loss: false
    use_align_loss: false
    fact_align_loss: 0.25
    fact_unif_loss: 0.5
    use_uniform_loss: false
    mask_batch: false
    compute_test_loss: false
data:
  class_path: data.vocals.VocalsDataModule
  init_args:
    augs_neg:
      enable: false
      gaussian_noise: 0.5
      pitch_shift_naive: 0
      time_stretch: 0
      gain: 0.5
      shift: 0
      parametric_eq: 0
      tanh_distortion: 0
      time_mask: 0
      formant_shift_parselmouth: 0
      pitch_shift_parselmouth: 0
      pitch_range_parselmouth: 0
      pitch_shift_parselmouth_prob: 0
    positive_examples: same_clip
    dataset_dirs:
    - tencys_vocals
    - ghero_vocals_3
    - ghero_vocals_4
    batch_size: 140
    batch_size_val: 120
    nr_samples: 176000
    normalize: true
    num_workers: 40
    sr: 44100
    batch_sampling_mode: sample_clips
    eval_frac: 0.1
    group_name_is_folder: true
    group_by_artist: true
    augs:
      enable: true
      gaussian_noise: 0.5
      pitch_shift_naive: 0
      time_stretch: 0
      gain: 0.5
      shift: 0
      parametric_eq: 0
      tanh_distortion: 0
      time_mask: 0.5
      formant_shift_parselmouth: 0
      pitch_shift_parselmouth:
      - 1
      - 1.3
      pitch_range_parselmouth: 1.5
      pitch_shift_parselmouth_prob: 0.5
    transform_override: false
    verbose: true
    use_random_loader: false
    max_groups: -1
    multi_epoch: 1
    classification: false