cogdl.models.nn.mvgrl

Module Contents

Functions

preprocess_features(features)

Row-normalize feature matrix and convert to tuple representation

normalize_adj(adj)

Symmetrically normalize adjacency matrix.

sparse_mx_to_torch_sparse_tensor(sparse_mx)

Convert a scipy sparse matrix to a torch sparse tensor.

compute_ppr(graph: networkx.Graph, alpha=0.2, self_loop=True)

class cogdl.models.nn.mvgrl.Discriminator(n_h)[source]

Bases: torch.nn.Module

weights_init(self, m)[source]
forward(self, c1, c2, h1, h2, h3, h4, s_bias1=None, s_bias2=None)[source]
class cogdl.models.nn.mvgrl.Model(n_in, n_h)[source]

Bases: torch.nn.Module

forward(self, seq1, seq2, adj, diff, sparse, msk, samp_bias1, samp_bias2)[source]
embed(self, seq, adj, diff, sparse, msk)[source]
cogdl.models.nn.mvgrl.preprocess_features(features)[source]

Row-normalize feature matrix and convert to tuple representation

cogdl.models.nn.mvgrl.normalize_adj(adj)[source]

Symmetrically normalize adjacency matrix.

cogdl.models.nn.mvgrl.sparse_mx_to_torch_sparse_tensor(sparse_mx)[source]

Convert a scipy sparse matrix to a torch sparse tensor.

cogdl.models.nn.mvgrl.compute_ppr(graph: networkx.Graph, alpha=0.2, self_loop=True)[source]
class cogdl.models.nn.mvgrl.MVGRL(nfeat, nhid, nclass, max_epochs)[source]

Bases: cogdl.models.BaseModel

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.

train(self, data, dataset_name)[source]