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

关于噪声处理的问题? #13

Open
Nonbiuld opened this issue Nov 24, 2022 · 4 comments
Open

关于噪声处理的问题? #13

Nonbiuld opened this issue Nov 24, 2022 · 4 comments

Comments

@Nonbiuld
Copy link

训练生成的噪声的数值是有正有负的,下面这个操作把负的值都变成0了,这种做法不会有问题吗?不应该是噪声加图像再clamp到0-255?
self.perturb_tensor.mul(255).clamp_(0, 255).permute(0, 2, 3, 1).to('cpu').numpy()

@HanxunH
Copy link
Owner

HanxunH commented Nov 24, 2022

Yes, the noise should be added first. This could improve the protection performance. Keep me updated if you notice any difference in the results.

@Nonbiuld
Copy link
Author

训练生成噪声的代码似乎也有一点小问题,images[i] = images[i] + sample_noise,比如这里这个image加了sample_noise之后,是不是需要再clamp到(0,1)会更加合理一点,如果更改后效果有所提升我会告诉你的。

@HanxunH
Copy link
Owner

HanxunH commented Nov 24, 2022

Good catch, thanks!

@pzs19
Copy link

pzs19 commented Mar 23, 2023

@Nonbiuld 老哥,我也注意到这个问题了,请问更改之后效果如何?

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