Skip to content
Snippets Groups Projects
Commit d0c6153b authored by Alain Riou's avatar Alain Riou
Browse files

roll instead of sub

parent a21485d5
No related branches found
No related tags found
No related merge requests found
...@@ -215,10 +215,9 @@ class PESTO(nn.Module): ...@@ -215,10 +215,9 @@ class PESTO(nn.Module):
if batch_size: if batch_size:
activations = activations.view(batch_size, -1, activations.size(-1)) activations = activations.view(batch_size, -1, activations.size(-1))
preds = reduce_activations(activations, reduction=self.reduction) activations = activations.roll(-self.shift.cpu().item(), dims=-1)
# decrease by shift to get absolute pitch preds = reduce_activations(activations, reduction=self.reduction)
preds.sub_(self.shift)
if convert_to_freq: if convert_to_freq:
preds = 440 * 2 ** ((preds - 69) / 12) preds = 440 * 2 ** ((preds - 69) / 12)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment