Pretraining
Our framework BeGin supports pretraining and provides pre-implemented self-supervised learning (SSL) methods.
- class DGI(*args: Any, **kwargs: Any)[source]
An implementation of DGI for node-level and link-level problems. This code was implemented based on the official implementation by authors. For the details, see the original paper.
- Parameters
encoder (torch.nn.Module) – Pytorch model for pretraining.
- class DGISubgraphCL(*args: Any, **kwargs: Any)[source]
An implementation of GraphCL (utilized with DGI, subgraph augmentation) for node-level and link-level problems. This code was implemented based on the official implementation by authors. For the details, see the original paper.
- Parameters
encoder (torch.nn.Module) – Pytorch model for pretraining.
- class InfoGraph(*args: Any, **kwargs: Any)[source]
An implementation of InfoGraph for graph-level problems. This code was implemented based on the official implementation by authors. For the details, see the original paper.
- Parameters
encoder (torch.nn.Module) – Pytorch model for pretraining.
- class LightGCL(*args: Any, **kwargs: Any)[source]
An implementation of LightGCL for node-level and link-level problems. This code was implemented based on the official implementation by authors. Note that this method only supports bipartite graphs. For the details, see the original paper.
- Parameters
encoder (torch.nn.Module) – Pytorch model for pretraining.
- class PretrainingMethod(*args: Any, **kwargs: Any)[source]
Base framework for implementing pretraining methods.
- Parameters
encoder (torch.nn.Module) – Pytorch model for pretraining.
- class PretrainIterator(inputs, device)[source]
Base itearator for pretraining iterations. This class assumes full-batch training.
- inference(inputs)[source]
Return iterator for the given input dataset. Implementing this function is mandatory to operate the pretraining procedure.
- Parameters
inputs (object) – the input sample drawn from iterator.
- Returns
a scalar which represents loss for pretraining.
- class SubgraphCL(*args: Any, **kwargs: Any)[source]
An implementation of GraphCL (subgraph augmentation) for graph-level problems. This code was implemented based on the official implementation by authors. For the details, see the original paper.
- Parameters
encoder (torch.nn.Module) – Pytorch model for pretraining.