mr2.utils.EMADict
- class mr2.utils.EMADict[source]
Bases:
objectExponential Moving Average (EMA) dictionary.
Maintains an EMA of values for each key. On update, existing keys are updated with EMA, and new keys are added directly.
Detaches the values from the autograd graph.
- __init__(decay: float)[source]
Initialize the EMA dictionary.
- Parameters:
decay (
float) – Decay rate for EMA (between 0 and 1).
- update(other: Mapping[Any, Any]) None[source]
Update the EMA dict with another dictionary.
For existing keys, performs EMA update. For new keys, adds them directly.
- values() ValuesView[Any][source]
Get the values of the EMA dict.
- __eq__(value, /)
Return self==value.
- __new__(**kwargs)