pygip.models.attack.Realistic¶
Classes
|
DGL version of edge prediction module. |
|
DGL version of surrogate model. |
|
DGL-based GNN model extraction attack with updated metrics API. |
- class pygip.models.attack.Realistic.DGLEdgePredictor(*args: Any, **kwargs: Any)[source]¶
Bases:
ModuleDGL version of edge prediction module.
- class pygip.models.attack.Realistic.DGLSurrogateModel(*args: Any, **kwargs: Any)[source]¶
Bases:
ModuleDGL version of surrogate model.
- class pygip.models.attack.Realistic.RealisticAttack(dataset, attack_x_ratio, attack_a_ratio, model_path=None, hidden_dim=64, threshold_s=0.7, threshold_a=0.5)[source]¶
Bases:
BaseAttackDGL-based GNN model extraction attack with updated metrics API.
- _abc_impl = <_abc_data object>¶
- _evaluate_and_update_metrics(enhanced_graph, metric, metric_comp)[source]¶
Evaluate surrogate against target on the real test set and update metric containers.
- add_potential_edges(candidate_edges, labeled_nodes)[source]¶
Add potential edges whose predicted probability exceeds the threshold.
- attack()[source]¶
Execute the attack and return two JSON-like dicts: performance and computation metrics.
- generate_candidate_edges(labeled_nodes, unlabeled_nodes)[source]¶
Generate candidate edges based on feature cosine similarity threshold.
- simulate_target_model_queries(query_nodes, error_rate=0.15)[source]¶
Query the target model for labels on query_nodes and introduce a small error rate.
- supported_api_types = {'dgl'}¶
- supported_datasets = {}¶