pygip.models.defense.SurviveWM

Module Attributes

class pygip.models.defense.SurviveWM.SurviveWM(dataset, attack_node_fraction, model_path=None)[source]

Bases: BaseDefense

_abc_impl = <_abc_data object>
_load_model()[source]

Load a pre-trained model.

_to_cpu(tensor)[source]

Safely move tensor to CPU for NumPy operations

combine_with_trigger(base_graph, base_features, base_labels, trigger_data)[source]
compute_metrics(y_true, y_pred, y_score=None)[source]
defend()[source]

Execute the defense mechanism.

generate_key_graph(num_nodes=10, edge_prob=0.3)[source]
snn_loss(x, y, T=0.5)[source]
supported_api_types = {'dgl'}
train_with_snnl(model, graph, features, labels, train_mask, optimizer, T=0.5, alpha=0.1)[source]
verify_watermark(model, trigger_graph, trigger_labels)