grb.attack¶
grb.attack.base¶
- class grb.attack.base.Attack[source]¶
Bases:
object
Abstract class for graph adversarial attack.
- abstract attack(model, adj, features, **kwargs)[source]¶
- Parameters
model (torch.nn.module) – Model implemented based on
torch.nn.module
.adj (scipy.sparse.csr.csr_matrix) – Adjacency matrix in form of
N * N
sparse matrix.features (torch.FloatTensor) – Features in form of
N * D
torch float tensor.kwargs – Keyword-only arguments.
- class grb.attack.base.EarlyStop(patience=1000, epsilon=0.0001)[source]¶
Bases:
object
Strategy to early stop attack process.