class_docstr: Adds PyTorch specific functions.
class_docstr_tok: ["Adds","PyTorch","specific","functions","."]
docstr: Get an optimizer instance corresponding to the string name.
docstr_tok: ["Get","an","optimizer","instance","corresponding","to","the","string","name","."]
code: def get_optimizer(self, optim_param, model):
      """Get an optimizer instance corresponding to the string name."""
      optim = None
      if isinstance(optim_param, str):
          if optim_param.lower() == "adam":
              optim = torch.optim.Adam
          elif optim_param.lower() == "sgd":
              optim = torch.optim.SGD
      if optim is not None:
          return optim(model.parameters(), lr=self.base.learning_rate)
  
file_path: fairlearn/fairlearn/adversarial/_pytorch_engine.py
imports: from ._backend_engine import BackendEngine
  from ._constants import _MODEL_UNRECOGNIZED_STR, _MODEL_UNRECOGNIZED_ITEM
label_desc: Use image node_id 6 for calling the PytorchEngine obj's underlying member method code with example usage: obj.get_optimizer(optim_param, model) and returns: optim