Skip to content

Commit

Permalink
fixed attack invocation in fl
Browse files Browse the repository at this point in the history
  • Loading branch information
photonshi committed Dec 2, 2024
1 parent cd614bb commit 6ef1cd4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/algos/fl.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,13 @@ def single_round(self, round: int, attack_start_round: int = 0, attack_end_round
attack_end_round (int): The last round for the attack to be performed.
"""

# Normal training when outside the attack range

if round < attack_start_round or round > attack_end_round:
self.receive_and_aggregate()
# Determine if the attack should be performed
attack_in_progress = self.gia_attacker and attack_start_round <= round <= attack_end_round

if attack_in_progress:
self.receive_attack_and_aggregate(round, attack_start_round, attack_end_round)
else:
self.receive_attack_and_aggregate(round, attack_start_round, attack_end_round, dump_file_name)
self.receive_and_aggregate()


def run_protocol(self):
Expand Down

0 comments on commit 6ef1cd4

Please sign in to comment.