class_docstr: Base optimizer class for the fastai library, updating `params` with `cbs`
class_docstr_tok: ["Base","optimizer","class","for","the","fastai","library",",","updating","`","params","`","with","`","cbs","`"]
code: def __init__(
      self,
      params: Tensor | Iterable,  # Model parameters
      cbs: callable | MutableSequence,  # `Optimizer` step callbacks
      **defaults,  # Hyper parameters default values
  ):
      if "train_bn" in defaults.keys():
          _ = defaults.pop("train_bn")
          warn(
              "Setting `train_bn` in `Optimizer` has no effect. Set `train_bn` on `Learner` init instead"
          )
      params = L(params)
      self.cbs, self.state = L(cbs), defaultdict(dict)
      defaults = merge(*self.cbs.attrgot("defaults"), defaults)
      self.param_lists = (
          L(L(p) for p in params)
          if isinstance(params[0], (L, list))
          else L([params])
      )
      self.hypers = L({} for _ in range_of(self.param_lists))
      self.set_hypers(**defaults)
      self.frozen_idx = 0
  
imports: from __future__ import annotations
  from .torch_basics import *
label_desc: Use image node_id 1 to create a new Optimizer object from inherited base classes: _BaseOptimizer with example: obj = Optimizer(params, cbs)