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 embeddingsbatch (
torch.Tensor
) – the usualbatch
object of PyGkwargs (dict) – additional and optional arguments
- Returns
a tuple (model’s output, [optional] node embeddings, [optional] additional outputs
- training: bool
readout.link_readout
- class pydgn.model.readout.link_readout.DotProductLinkReadout(dim_node_features: int, dim_edge_features: int, dim_target: int, config: dict)
Bases:
pydgn.model.interface.ReadoutInterface
Class that implements a simple readout mapping for link prediction via dot product
- forward(node_embeddings, batch, **kwargs)
Performs a forward pass over a batch of graphs
- Parameters
node_embeddings (
torch_geometric.data.Batch
) – the node embeddingsbatch (
torch.Tensor
) – the usualbatch
object of PyGkwargs (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 embeddingsbatch (
torch.Tensor
) – the usualbatch
object of PyGkwargs (dict) – additional and optional arguments
- Returns
a tuple (model’s output, [optional] node embeddings, [optional] additional outputs
- training: bool