class_docstr: Usage::
      with Adam(num_steps=100, lr=0.05)) as optim:
          x = loss.reduce(ops.min)
  
      print("final loss", x)  # equivalent to loss(**optim.params)
      for name in loss.inputs:
          print(name, optim.params(name))
class_docstr_tok: ["Usage",":",":","with","Adam","(","num_steps=100",",","lr=0.05",")",")","as","optim",":","x","=","loss.reduce","(","ops.min",")","print","(","``","final","loss","''",",","x",")","#","equivalent","to","loss","(","*","*","optim.params",")","for","name","in","loss.inputs",":","print","(","name",",","optim.params","(","name",")",")"]
code: def param(self, name, domain=None):
      if name not in self.params:
          if domain is None:
              raise ValueError(f"Unknown param: {name}")
          self.params[name] = self._initialize(name, domain)
      return self.params[name]
  
file_path: funsor/funsor/adam.py
imports: import funsor.ops
  from funsor.domains import RealsType
  from funsor.interpretations import StatefulInterpretation
  from funsor.tensor import Tensor
  from funsor.terms import Funsor, Reduce
  from funsor.util import get_backend
label_desc: Use image node_id 2 for calling the Adam obj's underlying member method code with example usage: obj.param(name, domain) and returns: self