So, in that case I have two questions I hope you could answer so I can work this out.
Could you explain the logic behind if (i > 0) and (i % 10) == 0 ?
I imagine i % 10 checks the it/sec every 10 seconds, but how does i > 0 check if the it/sec is too low?
Secondly, going over how advi (github) implements model stopping, and what needs to be accomplished in sample (github), it seems like advi does it like this:
- a user-defined
callbackraisesStopIterationif too little iterations occurring, -
StopIterationis followed by aprogress.close(lines: 83, 173, 177, 230, 250), which does not exist inpm.sample, -
pm.sample, however, hassampling.close,strace.close, andtrace.closein many places, which I also assume roughly shuts the model down (lines: 551, 643-652, 905-915, 977-995).
So is my analysis right so far?