-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Description
🚀 The feature, motivation and pitch
If the dimension size is high, Python loop may be inefficient and maybe inplace computation graph (for efficiency) could confuse TorchScript.
In pandas
this exists as ewm()
function: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ewm.html
In NumPy various reimpl methods exist (recurrent; truncated based on convolution): https://stackoverflow.com/questions/42869495/numpy-version-of-exponential-weighted-moving-average-equivalent-to-pandas-ewm
Alternatives
Special APIs for returning convolution weights, e.g. https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.gaussian_filter1d.html, and the same for exponential weights. Then have a recipe/example in docs of using these weights to create an approximate exponential moving average via convolution.
Although maybe given that gaussian / ewm filtering is very popular, both APIs would be useful.
Additional context
No response