danielzuegner / gnn-meta-attack

Implementation of the paper "Adversarial Attacks on Graph Neural Networks via Meta Learning".
https://www.kdd.in.tum.de/gnn-meta-attack
MIT License
143 stars 26 forks source link

Attack variants #4

Closed pazcuturi closed 4 years ago

pazcuturi commented 4 years ago

Reading the paper and going through the demo, I'm not sure I understand the differences between the attack variants ("Meta-Train", "Meta-Self","A-Meta-Train", "A-Meta-Self", "A-Meta-Both").

Particularly, when using "Meta-Train" should labels_self_training be calculated? Can I run the demo just by modifying the variant definition to be variant = "Meta-Train" and leave everything else as is or should I change anything else?

danielzuegner commented 4 years ago

Hi Paz,

thanks for your request. labels_self_training is not required for variant = "Meta-Train" because the labels for the unlabeled nodes are never used.

Can I run the demo just by modifying the variant definition to be variant = "Meta-Train" and leave everything else as is or should I change anything else? Yes, that should work.

I'm closing the issue for now. If you encounter any problems feel free to reopen it or open a new one.

Thanks!

pazcuturi commented 4 years ago

Thank you for your response! What I'm trying to do is use attack the entire graph (both training set and unlabeld set) thinking that I know all labels ahead, since it's not really and attack but more a noise introduction. Would that work? I thought of using "Meta-Train" but set idx_attack = np.union1d(split_train, split_unlabeled) and use all labels instead of just labels_self_training when initializing GNNMeta.

danielzuegner commented 4 years ago

attack the entire graph [...] thinking that I know all labels ahead

So effectively this means the Oracle setting where the attacker knows all labels of all nodes? In that case you should set labels_self_training = _Z_obs andidx_attack = np.union1d(split_train, split_unlabeled). Let me know in case I misunderstood your request.

pazcuturi commented 4 years ago

Yes, that is exactly what I meant. Although it also makes sense to change

gcn_attack.attack(perturbations, split_train, idx_attack)

to be

gcn_attack.attack(perturbations, idx_attack, idx_attack)

right?

Because now not just split_train is known, but everything is (np.union1d(split_train, split_unlabeled)).

danielzuegner commented 4 years ago

If you do that, then the model will not train in a semi-supervised but in a fully-supervised way. This is because if you set idx_labeled to idx_attack, the inner training of the GCN will train on the whole dataset, not just the training set.