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

Question on clamp #26

Closed
lizhenstat opened this issue Aug 25, 2019 · 2 comments
Closed

Question on clamp #26

lizhenstat opened this issue Aug 25, 2019 · 2 comments

Comments

@lizhenstat
Copy link

Hi, I have a question on clap weights
https://github.com/ShichenLiu/CondenseNet/blob/master/layers.py#L125

weight = weight.sum(0).clamp(min=1e-6).sqrt()

I don't understand the clamp function here. I tried to train condensenet-86 on cifar10 . with and without clamp functions
with clamp: error rate = 95.06
without clamp: error rate = 94.96

Thanks in advance

@ShichenLiu
Copy link
Owner

Hi,

The clamp function here is to prevent numerical issues. Since the derivative of x^p is p*x^(p-1), when p < 1, it is essential to prevent x^(p-1) to be too big which introduces numerical unstable issues.

@lizhenstat
Copy link
Author

@ShichenLiu Oh! I got it, thanks a lot

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

2 participants