diff --git a/pytorch_lightning/core/mixins/hparams_mixin.py b/pytorch_lightning/core/mixins/hparams_mixin.py index 72129f22f54bb..c864de23d3cf2 100644 --- a/pytorch_lightning/core/mixins/hparams_mixin.py +++ b/pytorch_lightning/core/mixins/hparams_mixin.py @@ -126,12 +126,26 @@ def _to_hparams_dict(hp: Union[MutableMapping, Namespace, str]): @property def hparams(self) -> Union[AttributeDict, dict, Namespace]: + """ + The collection of hyperparameters saved with :meth:`save_hyperparameters`. It is mutable by the user. + For the frozen set of initial hyperparameters, use :attr:`hparams_initial`. + + Returns: + Union[AttributeDict, dict, Namespace]: mutable hyperparameters dicionary + """ if not hasattr(self, "_hparams"): self._hparams = AttributeDict() return self._hparams @property def hparams_initial(self) -> AttributeDict: + """ + The collection of hyperparameters saved with :meth:`save_hyperparameters`. These contents are read-only. + Manual updates to the saved hyperparameters can instead be performed through :attr:`hparams`. + + Returns: + AttributeDict: immutable initial hyperparameters + """ if not hasattr(self, "_hparams_initial"): return AttributeDict() # prevent any change