quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
157 stars 23 forks source link

Memoization #171

Closed OAGr closed 1 year ago

OAGr commented 2 years ago

This depends on: https://github.com/QURIresearch/squiggle/issues/172

umuro commented 2 years ago

@OAGr We need a way to control what is memoized. A flag in function definitions? Or all distribution functions only?

OAGr commented 2 years ago
image

Maybe we could have a mem function, similar to how it's done there? https://webppl.readthedocs.io/en/master/functions/other.html?highlight=memoize

If this is working smoothly, we could add an annotation (like, @cache or @memoize) later.