class_docstr: Defines how to configure an optimizer.
  
  For each train step it returns a dictionary that contains the configuration for the optimizer.
  
  Args:
      lr (List[float], optional): a configuration space for the learning rate.
      momentum (List[float], optional): a configuration space for the momentum.
class_docstr_tok: ["Defines","how","to","configure","an","optimizer",".","For","each","train","step","it","returns","a","dictionary","that","contains","the","configuration","for","the","optimizer",".","Args",":","lr","(","List","[","float","]",",","optional",")",":","a","configuration","space","for","the","learning","rate",".","momentum","(","List","[","float","]",",","optional",")",":","a","configuration","space","for","the","momentum","."]
code: def __init__(
      self,
      *,
      lr: Optional[float] = None,
      momentum: Optional[float] = None,
  ):
      if lr is None and momentum is None:
          raise ValueError("You must specify lr and/or momentum.")
  
      self.configuration = OrderedDict()
      if lr is not None:
          self.configuration["lr"] = lr
      if momentum is not None:
          self.configuration["momentum"] = momentum
  
imports: import contextlib
  from collections import OrderedDict
  from itertools import chain, islice
  from math import cos, pi
  from typing import Dict, List, Optional, Tuple
  from poutyne.framework.callbacks.callbacks import Callback
label_desc: Use image node_id 1 to create a new Phase object  with example: obj = Phase()