I have a question,
I need to calculate the gradient against a minibatch of the dataset,
But model.fit and model.train_on_batch method do not give the gradient,
They immediately apply the gradient to weights.
Thanks. After more checking it seems that my expectations for human-imperceptable perturbations were not realistic. It seems that authors often just pick the “best” adversarial examples to put in their figures. The images at the bottom of this webpage are in accord with what I’m getting, for similar epsilon values. So all is well! https://pytorch.org/tutorials/beginner/fgsm_tutorial.html