LCWALitModule

class LCWALitModule(dataset: str | Dataset | type[Dataset] | None = 'nations', dataset_kwargs: Mapping[str, Any] | None = None, mode: Literal['training', 'validation', 'testing'] | None = None, model: str | Model | type[Model] | None = 'distmult', model_kwargs: Mapping[str, Any] | None = None, batch_size: int = 32, learning_rate: float = 0.001, label_smoothing: float = 0.0, optimizer: str | Optimizer | type[Optimizer] | None = None, optimizer_kwargs: Mapping[str, Any] | None = None)[source]

Bases: LitModule

A PyTorch Lightning module for training a model with LCWA training loop.

Create the lightning module.

Parameters:
  • dataset (str | Dataset | type[Dataset] | None) – the dataset, or a hint thereof

  • dataset_kwargs (Mapping[str, Any] | None) – additional keyword-based parameters passed to the dataset

  • mode (Literal['training', 'validation', 'testing'] | None) – the inductive mode; defaults to transductive training

  • model (str | Model | type[Model] | None) – the model, or a hint thereof

  • model_kwargs (Mapping[str, Any] | None) – additional keyword-based parameters passed to the model

  • batch_size (int) – the training batch size

  • learning_rate (float) – the learning rate

  • label_smoothing (float) – the label smoothing

  • optimizer (str | Optimizer | type[Optimizer] | None) – the optimizer, or a hint thereof

  • optimizer_kwargs (Mapping[str, Any] | None) – additional keyword-based parameters passed to the optimizer. should not contain lr, or params.