Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ratio for attacker.data(), attacker.edge_flips(), and attacker.feat_flips() #5

Merged
merged 3 commits into from Nov 7, 2022

Conversation

EdisonLeeeee
Copy link
Owner

This PR allows specifying an argument ratio for attacker.edge_flips(), and attacker.feat_flips(), which determines how many generated perturbations were used for further evaluation/visualization. Correspondingly, attacker.data() holds edge_ratio and feat_ratio for these two methods when constructing perturbed graph.

  • Example
attacker = ...
attacker.reset()
attacker.attack(...)

# Case1: Only 50% of generated edge perturbations were used
trainer.evaluate(attacker.data(edge_ratio=0.5), mask=...)

# Case2: Only 50% of generated feature perturbations were used
trainer.evaluate(attacker.data(feat_ratio=0.5), mask=...)

# NOTE: both arguments can be used simultaneously

@EdisonLeeeee EdisonLeeeee added the enhancement New feature or request label Nov 7, 2022
@EdisonLeeeee EdisonLeeeee self-assigned this Nov 7, 2022
@EdisonLeeeee EdisonLeeeee merged commit 9837dc9 into master Nov 7, 2022
@EdisonLeeeee EdisonLeeeee deleted the data branch November 7, 2022 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant