Skip to content

Commit

Permalink
final fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimesabalimperial committed May 2, 2022
1 parent 13ca01f commit 2daf1df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions niteshade/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def __init__(self, X, y, model, attacker=None, defender=None,
self.incorrectly_defended = 0
self.training_points = 0
self.original_points = 0

self.num_defended = 0

#if there is no attacker there wont be any poisoned points
self.not_poisoned = 0

Expand Down Expand Up @@ -270,7 +271,8 @@ def _get_id(self, hash, checkpoint):
point_id = self._original_ids.get(hash, 'd')

if point_id == 'd':
point_id = f'd_{self.correctly_defended+self.incorrectly_defended}'
point_id = f'd_{ self.num_defended}'
self.num_defended += 1

return point_id

Expand Down

0 comments on commit 2daf1df

Please sign in to comment.