Closed maciekrt closed 4 years ago
There's a somewhat subtle issue here that later versions of the API will likely fix. The problem is that your Model
has no reference to serialInterval
anywhere and so serialInterval
does not participate in inference. The easy fix is something like this:
val obsModel = Model.observe(onset.drop(1), expectedToday)
val trackSerialInterval = Model.track(Set(serialInterval))
(obsModel.merge(trackSerialInterval), Rts)
Thanks Avi! Your suggestion fixed the problem. The crash in codegen with anonymous IR node hinted at Rainier's problem instead of a user error. I wonder if IR nodes could carry a name tag that would make diagnosing more obvious. Perhaps you could capture variable name automatically, the way (I think) @lihaoyi does in Mill?
On Wed, 29 Apr 2020 at 22:42, Avi Bryant notifications@github.com wrote:
Closed #499 https://github.com/stripe/rainier/issues/499.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stripe/rainier/issues/499#event-3286411507, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABA6JEPCBYUEPCIY5RR73RPCGKJANCNFSM4MTRUBRA .
-- gkk
@gkossakowski do you have any pointers to how that's done in Mill?
I believe with the sourcecode library. It comes with handy examples: https://github.com/lihaoyi/sourcecode#examples It's implemented as a macro but a very, very thin one over compiler's API. It's one of the best examples of using macros in Scala that I don't have any objections to.
When trying to execute the following model:
I got the stacktrace (included below) after sampling finished. If we change multiplication by a random variable by any simpler operation everything works fine. The notebook fully reproducing the issue is provided here: https://github.com/maciekrt/covid-19/blob/rainierError/Rainier.ipynb .
CC: @gkossakowski