Skip to content

Commit

Permalink
add test example with AttackAndDefenseManager
Browse files Browse the repository at this point in the history
  • Loading branch information
LukyanovKirillML committed Jul 16, 2024
1 parent 9df52ed commit 9bbaabd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions experiments/attack_defense_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def test_attack_defense():

attack_defense_manager = AttackAndDefenseManager(gen_dataset=dataset, gnn_manager=gnn_model_manager)
attack_defense_manager.set_poison_attacker(poison_attack_config=poison_attack_config)
attack_defense_manager.set_poison_defender(poison_defense_config=poison_defense_config)

attack_defense_manager.conduct_experiment()

warnings.warn("Start training")
dataset.train_test_split()
Expand Down
2 changes: 2 additions & 0 deletions src/defense/defense_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def __init__(self, gen_dataset: GeneralDataset, model, **kwargs):


class BadRandomPoisonDefender(PoisonDefender):
name = "BadRandomPoisonDefender"

def __init__(self, gen_dataset: GeneralDataset, model, n_edges_percent=0.1):
self.defense_diff = None

Expand Down

0 comments on commit 9bbaabd

Please sign in to comment.