dgn.toy_dgn

class pydgn.model.dgn.toy_dgn.ToyDGN(*args: Any, **kwargs: Any)

Bases: pydgn.model.interface.ModelInterface

A toy Deep Graph Network used to test the library

forward(data: torch_geometric.data.Batch) Tuple[torch.Tensor, Optional[torch.Tensor], Optional[List[object]]]

Implements an Toy DGN with some SAGE graph convolutional layers.

Parameters

data (torch_geometric.data.Batch) – a batch of graphs

Returns

the output depends on the readout passed to the model as argument.

dgn.toy_mlp

class pydgn.model.dgn.toy_mlp.ToyMLP(*args: Any, **kwargs: Any)

Bases: pydgn.model.interface.ModelInterface

A toy MLP model used to test the library. Technically, a DGN that ignores the adjacency matrix.

forward(data: torch_geometric.data.Batch) Tuple[torch.Tensor, Optional[torch.Tensor], Optional[List[object]]]

Implements an MLP (structure agnostic baseline)

Parameters

data (torch_geometric.data.Batch) – a batch of graphs

Returns

a tuple (output, node_embedddings)