docstr: Initialize the optimizer using params passed when initializing PredictionAlgorithm class.
docstr_tok: ["Initialize","the","optimizer","using","params","passed","when","initializing","PredictionAlgorithm","class","."]
code: def configure_optimizers(self):
      """
      Initialize the optimizer using params passed when initializing PredictionAlgorithm class.
  
      """
      if self.optimizer == "Adam":
          optimizer = torch.optim.Adam(
              self.parameters(),
              lr=self.lr,
              weight_decay=self.weight_decay,
              betas=self.betas,
          )
      elif self.optimizer == "SGD":
          optimizer = torch.optim.SGD(
              self.parameters(),
              lr=self.lr,
              weight_decay=self.weight_decay,
              momentum=self.momentum,
          )
  
      return optimizer
  
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 5 for calling the PredictionAlgorithm obj's underlying member method code with example usage: obj.configure_optimizers() and returns: optimizer