greta-dev / greta.dynamics

a greta extension for modelling dynamical systems
https://greta-dev.github.io/greta.dynamics/
Other
6 stars 2 forks source link

warm starts for iterate_matrix #13

Open goldingn opened 4 years ago

goldingn commented 4 years ago

As mentioned in #11, we now use a TF while loop and can stop iterations early if we meet a convergence tolerance. We could also speed up convergence (and therefore reduce computation time) by warmn-starting the initial values between iterations (if the user didn't specify any). That is, the next time the iteration algorithm is run we can set the initial state to the final state from the previous run. If doing MCMC sampling, subsequent parameter values (and therefore final states) should be similar, so this could speed up sampling quite a lot.

I think we could do this with a TF variable (or constant?) tensor, setting values of the initial state tensor at the end of each run of the algorithm. Not something I've done with greta before though, so will take some thinking.