histocartography.ml.layers.dense_gin_layer module

Implementation of a Dense GIN (Graph Isomorphism Network) layer. This implementation should be used when the input graph(s) can only be represented as an adjacency (typically when dealing with dense adjacency matrices).

Original paper:

Summary

Classes:

DenseGINLayer

class DenseGINLayer(node_dim: int, out_dim: int, act: str = 'relu', agg_type: str = 'mean', hidden_dim: int = 32, batch_norm: bool = True, graph_norm: bool = False, with_lrp: bool = False, dropout: float = 0.0, verbose: bool = False)[source]

Bases: torch.nn.modules.module.Module

__init__(node_dim: int, out_dim: int, act: str = 'relu', agg_type: str = 'mean', hidden_dim: int = 32, batch_norm: bool = True, graph_norm: bool = False, with_lrp: bool = False, dropout: float = 0.0, verbose: bool = False)None[source]

Dense GIN Layer constructor

Parameters
  • node_dim (int) – Input dimension of each node.

  • out_dim (int) – Output dimension of each node.

  • act (str) – Activation function of the update function.

  • agg_type (str) – Aggregation function. Defaults to ‘mean’.

  • hidden_dim (int) – Hidden dimension of the GIN MLP. Defaults to 32.

  • batch_norm (bool) – If we should use batch normalization. Defaults to True.

  • graph_norm (bool) – If we should use graph normalization. Defaults to False.

  • with_lrp (bool) – If we should use LRP. Defaults to False.

  • dropout (float) – If we should use dropout. Defaults to 0.

  • verbose (bool) – Verbosity. Defaults to False.

forward(adj, h)[source]

Forward-pass of a Dense GIN layer. :param g: DGLGraph object. Node features in GNN_NODE_FEAT_IN_KEY :return: updated node features

Reference

If you use histocartography in your projects, please cite the following:

@inproceedings{pati2021,
    title = {Hierarchical Graph Representations for Digital Pathology},
    author = {Pushpak Pati, Guillaume Jaume, Antonio Foncubierta, Florinda Feroce, Anna Maria Anniciello, Giosuè Scognamiglio, Nadia Brancati, Maryse Fiche, Estelle Dubruc, Daniel Riccio, Maurizio Di Bonito, Giuseppe De Pietro, Gerardo Botti, Jean-Philippe Thiran, Maria Frucci, Orcun Goksel, Maria Gabrani},
    booktitle = {https://arxiv.org/pdf/2102.11057},
    year = {2021}
}