Open HuangZuShu opened 2 years ago
https://github.com/Jeffkang-94/pytorch-adversarial-attack/blob/3b5877b3fd30524ccf9318e005b5b6cef3453652/attack/mifgsm.py#L32 The right code should be as following:
if self.target is None: cost = -F.cross_entropy(logit, y) else: cost = F.cross_entropy(logit, self.target)
https://github.com/Jeffkang-94/pytorch-adversarial-attack/blob/3b5877b3fd30524ccf9318e005b5b6cef3453652/attack/mifgsm.py#L32 The right code should be as following: