class_docstr: A base module for training models with PyTorch Lightning.
  
  .. seealso::
      :class:`pykeen.training.training_loop.TrainingLoop`
class_docstr_tok: ["A","base","module","for","training","models","with","PyTorch","Lightning",".","..","seealso",":",":",":","class",":","`","pykeen.training.training_loop.TrainingLoop","`"]
docstr: Create the lightning module.
  
  :param dataset:
      the dataset, or a hint thereof
  :param dataset_kwargs:
      additional keyword-based parameters passed to the dataset
  :param mode:
      the inductive mode; defaults to transductive training
  
  :param model:
      the model, or a hint thereof
  :param model_kwargs:
      additional keyword-based parameters passed to the model
  
  :param batch_size:
      the training batch size
  :param learning_rate:
      the learning rate
  :param label_smoothing:
      the label smoothing
  
  :param optimizer:
      the optimizer, or a hint thereof
  :param optimizer_kwargs:
      additional keyword-based parameters passed to the optimizer. should not contain `lr`, or `params`.
docstr_tok: ["Create","the","lightning","module",".",":","param","dataset",":","the","dataset",",","or","a","hint","thereof",":","param","dataset_kwargs",":","additional","keyword-based","parameters","passed","to","the","dataset",":","param","mode",":","the","inductive","mode",";","defaults","to","transductive","training",":","param","model",":","the","model",",","or","a","hint","thereof",":","param","model_kwargs",":","additional","keyword-based","parameters","passed","to","the","model",":","param","batch_size",":","the","training","batch","size",":","param","learning_rate",":","the","learning","rate",":","param","label_smoothing",":","the","label","smoothing",":","param","optimizer",":","the","optimizer",",","or","a","hint","thereof",":","param","optimizer_kwargs",":","additional","keyword-based","parameters","passed","to","the","optimizer",".","should","not","contain","`","lr","`",",","or","`","params","`","."]
code: def __init__(
      self,
      # dataset
      dataset: HintOrType[Dataset] = "nations",
      dataset_kwargs: OptionalKwargs = None,
      mode: Optional[InductiveMode] = None,
      # model
      model: HintOrType[Model] = "distmult",
      model_kwargs: OptionalKwargs = None,
      # stored outside of the training loop / optimizer to give access to auto-tuning from Lightning
      batch_size: int = 32,
      learning_rate: float = 1.0e-03,
      label_smoothing: float = 0.0,
      # optimizer
      optimizer: HintOrType[torch.optim.Optimizer] = None,
      optimizer_kwargs: OptionalKwargs = None,
  ):
      """
      Create the lightning module.
  
      :param dataset:
          the dataset, or a hint thereof
      :param dataset_kwargs:
          additional keyword-based parameters passed to the dataset
      :param mode:
          the inductive mode; defaults to transductive training
  
      :param model:
          the model, or a hint thereof
      :param model_kwargs:
          additional keyword-based parameters passed to the model
  
      :param batch_size:
          the training batch size
      :param learning_rate:
          the learning rate
      :param label_smoothing:
          the label smoothing
  
      :param optimizer:
          the optimizer, or a hint thereof
      :param optimizer_kwargs:
          additional keyword-based parameters passed to the optimizer. should not contain `lr`, or `params`.
      """
      super().__init__()
      self.dataset = get_dataset(
          dataset=dataset, dataset_kwargs=dataset_kwargs
      )
      self.model = model_resolver.make(
          model, model_kwargs, triples_factory=self.dataset.training
      )
      self.loss = self.model.loss
      self.optimizer = optimizer
      self.optimizer_kwargs = optimizer_kwargs
      self.learning_rate = learning_rate
      self.batch_size = batch_size
      self.mode = mode
      self.label_smoothing = label_smoothing
  
imports: from abc import abstractmethod
  from typing import Optional
  import click
  import pytorch_lightning
  import torch
  import torch.utils.data
  from class_resolver import ClassResolver, HintOrType, OptionalKwargs
  from pykeen.datasets import dataset_resolver, get_dataset
  from pykeen.datasets.base import Dataset
  from pykeen.losses import Loss, loss_resolver
  from pykeen.models import Model, model_resolver
  from pykeen.models.cli import options
  from pykeen.optimizers import optimizer_resolver
  from pykeen.sampling import NegativeSampler
  from pykeen.training import LCWATrainingLoop, SLCWATrainingLoop
  from pykeen.triples.triples_factory import CoreTriplesFactory
  from pykeen.typing import InductiveMode, OneOrSequence
label_desc: Use image node_id 1 to create a new LitModule object from inherited base classes: pytorch_lightning with example: obj = LitModule(dataset, dataset_kwargs, mode, model, model_kwargs, batch_size, learning_rate, label_smoothing, optimizer, optimizer_kwargs)