code: def from_spec(spec, kwargs=None):
          
          optimizer = util.get_object(
              obj=spec,
              predefined_objects=tensorforce.core.optimizers.optimizers,
              kwargs=kwargs
          )
          assert isinstance(optimizer, Optimizer)
          return optimizer
docs: Creates an optimizer from a specification dict.