histocartography.ml.layers.gin_layer module¶
Implementation of a GIN (Graph Isomorphism Network) layer.
- Original paper:
How Powerful are Graph Neural Networks: https://arxiv.org/abs/1810.00826
Author’s public implementation: https://github.com/weihua916/powerful-gnns
Summary¶
Classes:
- class GINLayer(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]¶
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. Default to ‘mean’.
hidden_dim (int) – Hidden dimension of the GIN MLP. Default to 32.
batch_norm (bool) – If we should use batch normalization. Default to True.
graph_norm (bool) – If we should use graph normalization. Default to False.
with_lrp (bool) – If we should use LRP. Default to False.
dropout (float) – If we should use dropout. Default to 0.
verbose (bool) – Verbosity. Default to False.
- reduce_fn(nodes)[source]¶
For each node, aggregate the nodes using a reduce function. Current supported functions are sum and mean.
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}
}