mattricesound commited on
Commit
733f656
·
1 Parent(s): 513dd20

Add random effects to demucs

Browse files
Files changed (2) hide show
  1. exp/demucs.yaml +6 -3
  2. remfx/models.py +3 -4
exp/demucs.yaml CHANGED
@@ -13,8 +13,11 @@ model:
13
  audio_channels: 1
14
  nfft: 4096
15
  sample_rate: ${sample_rate}
16
-
17
-
18
  datamodule:
19
  dataset:
20
- effect_types: ["RAT"]
 
 
 
 
 
 
13
  audio_channels: 1
14
  nfft: 4096
15
  sample_rate: ${sample_rate}
 
 
16
  datamodule:
17
  dataset:
18
+ effect_types:
19
+ Distortion:
20
+ _target_: remfx.effects.RandomPedalboardDistortion
21
+ sample_rate: ${sample_rate}
22
+ min_drive_db: -10
23
+ max_drive_db: 50
remfx/models.py CHANGED
@@ -114,8 +114,9 @@ class RemFXModel(pl.LightningModule):
114
  self.log_next = True
115
 
116
  def on_validation_batch_start(self, batch, batch_idx, dataloader_idx):
117
- x, target, label = batch
118
- if self.log_first_metrics:
 
119
  for metric in self.metrics:
120
  # SISDR returns negative values, so negate them
121
  if metric == "SISDR":
@@ -131,9 +132,7 @@ class RemFXModel(pl.LightningModule):
131
  prog_bar=True,
132
  sync_dist=True,
133
  )
134
- self.log_first_metrics = False
135
 
136
- if self.log_next:
137
  self.model.eval()
138
  with torch.no_grad():
139
  y = self.model.sample(x)
 
114
  self.log_next = True
115
 
116
  def on_validation_batch_start(self, batch, batch_idx, dataloader_idx):
117
+ if self.log_next:
118
+ x, target, label = batch
119
+ # Log Input Metrics
120
  for metric in self.metrics:
121
  # SISDR returns negative values, so negate them
122
  if metric == "SISDR":
 
132
  prog_bar=True,
133
  sync_dist=True,
134
  )
 
135
 
 
136
  self.model.eval()
137
  with torch.no_grad():
138
  y = self.model.sample(x)