d3rlpy.optimizers.RMSpropFactory

class d3rlpy.optimizers.RMSpropFactory(clip_grad_norm=None, lr_scheduler_factory=None, alpha=0.95, eps=0.01, weight_decay=0.0, momentum=0.0, centered=True)[source]

An alias for RMSprop optimizer.

from d3rlpy.optimizers import RMSpropFactory

factory = RMSpropFactory(weight_decay=1e-4)
Parameters:
  • clip_grad_norm (Optional[float]) – Maximum norm value of gradients to clip.

  • lr_scheduler_factory (Optional[LRSchedulerFactory]) – LRSchedulerFactory.

  • alpha (float) – smoothing constant.

  • eps (float) – term added to the denominator to improve numerical stability.

  • weight_decay (float) – weight decay (L2 penalty).

  • momentum (float) – momentum factor.

  • centered (bool) – flag to compute the centered RMSProp, the gradient is normalized by an estimation of its variance.

Methods

create(named_modules, lr, compiled)

Returns an optimizer object.

Parameters:
  • named_modules (list) – List of tuples of module names and modules.

  • lr (float) – Learning rate.

  • compiled (bool) – Flag to be True if CudaGraph and torch.compile are applied.

Returns:

OptimizerWrapper object.

Return type:

OptimizerWrapper

create_optimizer(named_modules, lr)[source]
Parameters:
Return type:

RMSprop

classmethod deserialize(serialized_config)
Parameters:

serialized_config (str) –

Return type:

TConfig

classmethod deserialize_from_dict(dict_config)
Parameters:

dict_config (dict[str, Any]) –

Return type:

TConfig

classmethod deserialize_from_file(path)
Parameters:

path (str) –

Return type:

TConfig

classmethod from_dict(kvs, *, infer_missing=False)
Parameters:

kvs (Optional[Union[dict, list, str, int, float, bool]]) –

Return type:

A

classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)
Parameters:

s (Union[str, bytes, bytearray]) –

Return type:

A

static get_type()[source]
Return type:

str

classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
Parameters:
  • infer_missing (bool) –

  • many (bool) –

  • partial (bool) –

Return type:

SchemaF[A]

serialize()
Return type:

str

serialize_to_dict()
Return type:

dict[str, Any]

to_dict(encode_json=False)
Return type:

Dict[str, Optional[Union[dict, list, str, int, float, bool]]]

to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
Parameters:
Return type:

str

Attributes

alpha: float = 0.95
centered: bool = True
clip_grad_norm: Optional[float] = None
eps: float = 0.01
lr_scheduler_factory: Optional[LRSchedulerFactory] = None
momentum: float = 0.0
weight_decay: float = 0.0