hanglearning / VBFL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How VBFL adds noise?

BabyQWang opened this issue · comments

Thanks for sharing, while reading the code I ran into a problem and would appreciate your reply.
How does VBFL add noise to the data in the code? I found the class AddGaussianNoise(object) for adding noise in DatasetLoad.py, but only this class was imported in main.py, and it was not called.

Hello BabyQWang, I apologize for my messy code. My coding habit was bad in my early projects. I should have removed AddGaussianNoise as I did not end up using this method.

VBFL does not add noise to the data. It adds noise to the network weights. I defined a function called malicious_worker_add_noise_to_weights() on line 681 of device.py, which is called on line 718. We can define --noise_variance as an argument to main.py, and it defaults to 1.

I think I followed this tutorial https://discuss.pytorch.org/t/is-there-any-way-to-add-noise-to-trained-weights/29829/2

Please let me know if that answers your question 😊

Thanks for your reply, I think I've got the answer I was looking for.

Thank you BabyQWang! Please let me know if you find other questions.