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

How targeted_attack attack a subset of nodes? #134

Open
Xxxxxsun opened this issue Mar 27, 2023 · 2 comments
Open

How targeted_attack attack a subset of nodes? #134

Xxxxxsun opened this issue Mar 27, 2023 · 2 comments

Comments

@Xxxxxsun
Copy link

Xxxxxsun commented Mar 27, 2023

Hello! I have encountered a problem while using DeepRobust (Nettack) to attack the Cora dataset. I have noticed that in the Nettack API, the target_node argument should be an integer. How can I modify this API to attack a list of nodes instead?
target_node = 0
model = Nettack(surrogate, nnodes=adj.shape[0], attack_structure=True, attack_features=True, device='cpu').to('cpu')
model.attack(features, adj, labels, target_node, n_perturbations=5)

@ChandlerBang
Copy link
Collaborator

Hey, you may take a look here: test_nettack.py. It shows how to perform targeted attack on target nodes.

@Xxxxxsun
Copy link
Author

Thank you so much for your quick response!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants