docstr: This class implements the default methods for a Pytorch lightning module `pl.LightningModule`.
  Its methods are called when the `fit()` method is called. To know more about these methods, refer to https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_module.html.
  
  :param model: Neural network modules used for training
  :param optimizer: Optimization algorithm used for training. Currently supports "Adam" and "SGD".
  :param lr: Value of learning rate
  :param weight_decay: Value of weight decay for optimizer
  :param betas: Adam configuration parameters (beta1, beta2), exponential decay rate for the first moment and second-moment estimates, respectively.
  :param momentum: Value of momentum for SGD optimzer
docstr_tok: ["This","class","implements","the","default","methods","for","a","Pytorch","lightning","module","`","pl.LightningModule","`",".","Its","methods","are","called","when","the","`","fit","(",")","`","method","is","called",".","To","know","more","about","these","methods",",","refer","to","https",":","\/\/pytorch-lightning.readthedocs.io\/en\/stable\/common\/lightning_module.html",".",":","param","model",":","Neural","network","modules","used","for","training",":","param","optimizer",":","Optimization","algorithm","used","for","training",".","Currently","supports","``","Adam","''","and","``","SGD","''",".",":","param","lr",":","Value","of","learning","rate",":","param","weight_decay",":","Value","of","weight","decay","for","optimizer",":","param","betas",":","Adam","configuration","parameters","(","beta1",",","beta2",")",",","exponential","decay","rate","for","the","first","moment","and","second-moment","estimates",",","respectively",".",":","param","momentum",":","Value","of","momentum","for","SGD","optimzer"]
code: def __init__(
      self, model, optimizer, lr, weight_decay, betas, momentum
  ):
      """
      This class implements the default methods for a Pytorch lightning module `pl.LightningModule`.
      Its methods are called when the `fit()` method is called. To know more about these methods, refer to https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_module.html.
  
      :param model: Neural network modules used for training
      :param optimizer: Optimization algorithm used for training. Currently supports "Adam" and "SGD".
      :param lr: Value of learning rate
      :param weight_decay: Value of weight decay for optimizer
      :param betas: Adam configuration parameters (beta1, beta2), exponential decay rate for the first moment and second-moment estimates, respectively.
      :param momentum: Value of momentum for SGD optimzer
      """
      super().__init__()
  
      self.model = model
      self.optimizer = optimizer
      self.lr = lr
      self.weight_decay = weight_decay
      self.betas = betas
      self.momentum = momentum
  
      # Check if the optimizer is currently supported
      if self.optimizer not in ["Adam", "SGD"]:
          error_msg = (
              self.optimizer
              + " is not implemented currently. Try Adam or SGD."
          )
          raise Exception(error_msg)
  
file_path: dowhy/dowhy/causal_prediction/algorithms/base_algorithm.py
imports: import pytorch_lightning
  import torch
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new PredictionAlgorithm object from inherited base classes: pl with example: obj = PredictionAlgorithm(model, optimizer, lr, weight_decay, betas, momentum)