Open grahamannett opened 3 years ago
Change in line https://github.com/cleverhans-lab/cleverhans/blob/master/cleverhans/tf2/attacks/carlini_wagner_l2.py#L153
From: const = tf.ones(shape) * self.initial_const
To: const = tf.ones(shape[0]) * self.initial_const
To: const = tf.ones(shape[0]) * self.initial_const
Could we please implement this in the main branch?
Seems like this is because CarliniWagnerL2.attack takes a single instance of x? Not sure if this is intended but is there anyway to allow for multiple x to be passed in at once? Would that help with the speed of the attack since at the moment generating a single attack for an in put takes ~45 seconds on a pretrained model.
The issue tracker should only be used to report bugs or feature requests. If you are looking for support from other library users, please ask a question on StackOverflow.
Describe the bug when trying to use cw2 attack from cleverhans I get an error about
To Reproduce Steps to reproduce the behavior:
results in
Where the issue is, is from (I think): https://github.com/cleverhans-lab/cleverhans/blob/master/cleverhans/tf2/attacks/carlini_wagner_l2.py#L333
where
const
is a tensor from tf.ones * initial const of the x input andloss_1
is a tensor that is the shape of the y output. I don't exactly see where this value comes from in the original paper so unsure exactly what the value should look likeExpected behavior Adversarial output
Screenshots If applicable, add screenshots to help explain your problem.