Skip to content

Commit 0261594

Browse files
authored
Merge pull request #1892 from monshri/bug_fix_sleeper_agent
Bug fix sleeper agent
2 parents a79c797 + f6e7c2c commit 0261594

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

art/attacks/poisoning/sleeper_agent_attack.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ def poison( # type: ignore
229229
best_B = B_ # pylint: disable=C0103
230230
best_x_poisoned = x_poisoned
231231
best_indices_poison = self.indices_poison
232+
if best_B == np.finfo(np.float32).max:
233+
logger.warning("Attack unsuccessful: all loss values were non-finite. Defaulting to final trial.")
234+
best_B = B_ # pylint: disable=C0103
235+
best_x_poisoned = x_poisoned
236+
best_indices_poison = self.indices_poison
232237

233238
# Apply De-Normalization
234239
if isinstance(

0 commit comments

Comments
 (0)