CDCgov / Rt-without-renewal

https://cdcgov.github.io/Rt-without-renewal/
Apache License 2.0
14 stars 3 forks source link

Replace scan usage with accumulate_scan #384

Closed seabbs closed 1 week ago

seabbs commented 1 month ago

In #369 we added new functionality for the AR latent model that introduce an abstract approach to extending Base.accumulate via step functions. This can be used to replace our current usage of the scan function.

This is likely to be attracted as it uses a base function which will likely be a major target of Auto-diff optimisations. It also makes it easier for us to introduce composability to our scan functions (i.e #385).

SamuelBrand1 commented 1 month ago

Noted that #388 shifts to using accumlate_scan to cast expected observation forward in time.

SamuelBrand1 commented 1 week ago

A search of the code base suggests that we are down to only Renewal using scan rather than accumulate_scan. This is a fairly easy issue now.

seabbs commented 1 week ago

Agree. We could either keep this for a large refactor of renewal processes (i.e to use #408) or just do a straight swap with fewer changes asap?

SamuelBrand1 commented 1 week ago

Agree. We could either keep this for a large refactor of renewal processes (i.e to use #408) or just do a straight swap with fewer changes asap?

I'm inclined towards a quick swap before the refactor:

  1. Its lower hanging fruit than I thought before.
  2. I'm interested in the straight comparison in the benchmarking.