cogdl.models.nn.gcn

Module Contents

Classes

GraphConvolution

Simple GCN layer, similar to https://arxiv.org/abs/1609.02907

TKipfGCN

The GCN model from the `”Semi-Supervised Classification with Graph Convolutional Networks”

class cogdl.models.nn.gcn.GraphConvolution(in_features, out_features, bias=True)[source]

Bases: torch.nn.Module

Simple GCN layer, similar to https://arxiv.org/abs/1609.02907

reset_parameters(self)[source]
forward(self, input, edge_index, edge_attr=None)[source]
__repr__(self)[source]
class cogdl.models.nn.gcn.TKipfGCN(nfeat, nhid, nclass, dropout)[source]

Bases: cogdl.models.BaseModel

The GCN model from the “Semi-Supervised Classification with Graph Convolutional Networks” paper

Args:

num_features (int) : Number of input features. num_classes (int) : Number of classes. hidden_size (int) : The dimension of node representation. dropout (float) : Dropout rate for model training.

static add_args(parser)[source]

Add model-specific arguments to the parser.

classmethod build_model_from_args(cls, args)[source]

Build a new model instance.

forward(self, x, adj)[source]
loss(self, data)[source]
predict(self, data)[source]