RyanHangZhou / tensorflow-LG-GAN

LG-GAN: Label Guided Adversarial Network for Flexible Targeted Attack of Point Cloud-based Deep Networks
MIT License
20 stars 4 forks source link

Errors in the code? Why optimize on test data (if I don't misunderstand) #2

Closed Wuziyi616 closed 3 years ago

Wuziyi616 commented 4 years ago

Hi! Recently I'm using your code and I find something strange in your implementation of targeted attack. So here is the code you use to generate adversarial examples on test data, though I'm not familiar with TensorFlow, I think if you run "sess.run()" including g_optim and d_optim, then you'll update the parameters of D and G right? But the feed_dict here is test_data and test_label as shown here, which means you're optimize your GAN on the test data.

I'm just confused about why you need to do so. If understand correctly, LG-GAN generates adversarial examples at one shot, so you don't need to update the parameters in G or D during the generation. Again I'm not quite sure about TensorFlow so please correct me if I'm wrong. Or, is it really a bug? Or out of some special purpose?

Wuziyi616 commented 4 years ago

So, from my perspective, if you want to perform attack on test data, you only need to run

score, test_adv_data = sess.run([pred, generator_pc], feed_dict=feed_dict)

once without including any optim in "sess.run()".

I'm not sure whether my understanding is correct. But I tried my modified version of the attack and I discover similar (even slightly better) results than reported in the paper. So I think this (possible) bug doesn't change the contribution of this paper.

But to be honest, I still want to know whether it is truly a bug. Please close this issue whether you want to modify the code or not because it doesn't affect the experimental results. But I hope you can tell me your answer :)

RyanHangZhou commented 4 years ago

Sure, I will check the code soon, and thank you so much for your effort!

Best, Hang

Hang Zhou Ph.D http://home.ustc.edu.cn/~zh2991/

From: Ziyi Wu Date: 2020-09-04 23:34 To: RyanHangZhou/LG-GAN CC: Subscribed Subject: Re: [RyanHangZhou/LG-GAN] Errors in the code? Why optimize on test data (if I don't misunderstand) (#2) So, from my perspective, if you want to perform attack on test data, you only need to run score, test_adv_data = sess.run([pred, generator_pc], feed_dict=feed_dict) once without including any optim in "sess.run()". I'm not sure whether my understanding is correct. But I tried my modified version of the attack and I discover similar (even slightly better) results than reported in the paper. So I think this (possible) bug doesn't change the contribution of this paper. But to be honest, I still want to know whether it is truly a bug. Please close this issue whether you want to modify the code or not because it doesn't affect the experimental results. But I hope you can tell me your answer :) ― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.