readout.graph_readout

class pydgn.model.readout.graph_readout.LinearGraphReadout(dim_node_features, dim_edge_features, dim_target, config)

Bases: pydgn.model.interface.ReadoutInterface

Class that implements a simple readout mapping for graph prediction

forward(node_embeddings, batch, **kwargs)

Performs a forward pass over a batch of graphs

Parameters
  • node_embeddings (torch_geometric.data.Batch) – the node embeddings

  • batch (torch.Tensor) – the usual batch object of PyG

  • kwargs (dict) – additional and optional arguments

Returns

a tuple (model’s output, [optional] node embeddings, [optional] additional outputs

training: bool

readout.node_readout

class pydgn.model.readout.node_readout.LinearNodeReadout(dim_node_features, dim_edge_features, dim_target, config)

Bases: pydgn.model.interface.ReadoutInterface

Class that implements a simple readout mapping for node prediction

forward(node_embeddings, batch, **kwargs)

Performs a forward pass over a batch of graphs

Parameters
  • node_embeddings (torch_geometric.data.Batch) – the node embeddings

  • batch (torch.Tensor) – the usual batch object of PyG

  • kwargs (dict) – additional and optional arguments

Returns

a tuple (model’s output, [optional] node embeddings, [optional] additional outputs

training: bool