Skip to content

Commit

Permalink
Update i6_models/primitives/feature_extraction.py
Browse files Browse the repository at this point in the history
Co-authored-by: Albert Zeyer <[email protected]>
  • Loading branch information
michelwi and albertz authored Aug 24, 2023
1 parent 4928c02 commit bd24862
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion i6_models/primitives/feature_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def forward(self, raw_audio, length) -> Tuple[torch.Tensor, torch.Tensor]:
# For some reason torch.stft removes the batch axis for batch sizes of 1, so we need to add it again
power_spectrum = torch.unsqueeze(power_spectrum, 0)
melspec = torch.einsum("...ft,mf->...mt", power_spectrum, self.mel_basis)
log_melspec = torch.log10(torch.clamp(melspec, max=self.min_amp))
log_melspec = torch.log10(torch.clamp(melspec, min=self.min_amp))
feature_data = torch.transpose(log_melspec, 1, 2)

if self.center:
Expand Down

0 comments on commit bd24862

Please sign in to comment.