docstr: Instantiates a RMSProp from a configuration.
  
  Args:
      config: A configuration for a RMSProp.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      A RMSProp instance.
docstr_tok: ["Instantiates","a","RMSProp","from","a","configuration",".","Args",":","config",":","A","configuration","for","a","RMSProp",".","See",":","func",":","`","__init__","`","for","parameters","expected","in","the","config",".","Returns",":","A","RMSProp","instance","."]
code: def from_config(cls, config: Dict[str, Any]) -> "RMSProp":
      """Instantiates a RMSProp from a configuration.
  
      Args:
          config: A configuration for a RMSProp.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          A RMSProp instance.
      """
      # Default params
      config.setdefault("lr", 0.1)
      config.setdefault("momentum", 0.0)
      config.setdefault("weight_decay", 0.0)
      config.setdefault("alpha", 0.99)
      config.setdefault("eps", 1e-8)
      config.setdefault("centered", False)
  
      for key in ["momentum", "alpha"]:
          assert (
              config[key] >= 0.0
              and config[key] < 1.0
              and type(config[key]) == float
          ), f"Config must contain a '{key}' in [0, 1) for RMSProp optimizer"
      assert is_pos_float(
          config["eps"]
      ), f"Config must contain a positive 'eps' for RMSProp optimizer"
      assert isinstance(
          config["centered"], bool
      ), "Config must contain a boolean 'centered' param for RMSProp optimizer"
  
      return cls(
          lr=config["lr"],
          momentum=config["momentum"],
          weight_decay=config["weight_decay"],
          alpha=config["alpha"],
          eps=config["eps"],
          centered=config["centered"],
      )
  
file_path: ClassyVision/classy_vision/optim/rmsprop.py
imports: from typing import Any, Dict
  import torch.optim
  from classy_vision.generic.util import is_pos_float
  from .None import ClassyOptimizer, register_optimizer
label_desc: Use image node_id 3 for calling the RMSProp obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls