Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute value of the output of sinc-based convolutions? #4

Closed
hbredin opened this issue Sep 20, 2018 · 4 comments
Closed

Absolute value of the output of sinc-based convolutions? #4

hbredin opened this issue Sep 20, 2018 · 4 comments

Comments

@hbredin
Copy link
Contributor

hbredin commented Sep 20, 2018

torch.abs is applied to the output of sinc-based convolutions.

SincNet/dnn_models.py

Lines 312 to 313 in 488c982

if i==0:
x = self.drop[i](self.act[i](self.ln[i](F.max_pool1d(torch.abs(self.conv[i](x)), self.cnn_max_pool_len[i]))))

Why is that? I coudn't find an explanation in the paper.

@mravanelli
Copy link
Owner

Hi Hervé,
we tried many different alternatives at this level and experiments are still running to find better solutions. For instance, we recently compared the performance with and without the abs function you pointed out. The reason why it could make sense to add an abs function here, is that standard max-pooling only looks into the positive samples of the filtered signal, while with abs we basically consider the envelope of it. This would allow the network to extract features more related to the “energy” or “envelope” of the signal, resembling “more closely” the standard pipeline used for extracting standard fbank or mfcc features. Actually, the standard fbanks is still quite different since we average the spectrum within rectangular filters. From my experiments, however, I saw that doing average pooling at this level works slightly worse than max pooling.

@hbredin
Copy link
Contributor Author

hbredin commented Sep 21, 2018

Thanks for the clarification -- it would make a nice addition to the paper and definitely help others reproduce your experiment.

Here is my (slightly more pytorchic) version of SincConv that can be used as a drop-in replacement for torch.nn.Conv1d: https://gist.github.com/hbredin/c3bfa80f8f71181c2d499167d297f181

@hbredin hbredin closed this as completed Sep 21, 2018
@mravanelli
Copy link
Owner

Great job! thank you!

@Rachine
Copy link

Rachine commented Feb 12, 2020

It seems that the addition of this abs operation is very important for fast convergence!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants