The loss
should explicitely require a gradient to be evaluated, so I would remove the loss.requires_grad = True
line. Also, try to rewrite the first line
def get_pedalboard(self):
highpass_freq = self.highpass_freq.clamp(20, 500)
Are you sure the
board = Pedalboard([
HighpassFilter(cutoff_frequency_hz=float(highpass_freq)),
])
works with PyTorch autograd?