celerite2 icon indicating copy to clipboard operation
celerite2 copied to clipboard

Efficiency improvement in `rng_fn()`

Open vandalt opened this issue 1 year ago • 0 comments

A PyMC developer pointed out potential inefficiencies in rng_fn() for CeleriteNormalRV.

Here is the relevant text from the original comment:

Also there's some inefficiency in your rng_fn. If size is provided (size is not None), you shouldn't have to broadcast the params together, it's enough to have your call below where you broadcast each param to size (there you are also hardcoding implicitly the ndims_params when you do param.shape[-n:] btw).

Only when size is not provided do you need to broadcast the params, as size is implicitly the broadcasted batch shape of all the parameters.

I don't have time to look into this now, but wanted to point it out in case someone wanted to look into it.

Thank you!

vandalt avatar Jun 28 '24 19:06 vandalt