tensorflow / probability

Probabilistic reasoning and statistical analysis in TensorFlow
https://www.tensorflow.org/probability/
Apache License 2.0
4.26k stars 1.1k forks source link

Feature Request: Batched Update of RunningCentralMoments #1697

Open wcscr opened 1 year ago

wcscr commented 1 year ago

Adding new samples using RunningCentralMoments updates the exponentiated residuals and adjustment terms for each new individual sample, making it very slow to add a large number of new samples.

Pebay's formula(s) (see Proposition 2.1) allow for batched /partitioned updating of the central moments, similar to the current implementation of RunningMean and RunningVariance. Is there any reason that the batched version isn't implemented?

csuter commented 1 year ago

No good reason this wasn't included. The existing tools were an intern project, so basically just what we could get done in time. We'd welcome a PR supporting more general batching, if you have the chance to put one together.

wcscr commented 1 year ago

Ok, thanks -- I'll work on a PR.