Closed goldingn closed 5 years ago
Merging #11 into master will decrease coverage by
0.97%
. The diff coverage is93.57%
.
@@ Coverage Diff @@
## master #11 +/- ##
==========================================
- Coverage 93.42% 92.44% -0.98%
==========================================
Files 3 3
Lines 152 225 +73
==========================================
+ Hits 142 208 +66
- Misses 10 17 +7
Impacted Files | Coverage Δ | |
---|---|---|
R/iterate_matrix.R | 94.21% <93.57%> (-2.69%) |
:arrow_down: |
R/ode_solve.R | 95.74% <0%> (-0.26%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dfbb4aa...4708cc9. Read the comment docs.
@jdyen I just merged this, but should point out that it changes the behaviour somewhat. It will now stop early if a convergence tolerance is met. So all_states
will be padded with 0s after the convergence is reached.
Might this may break some of your code? To reimplement the old behaviour, you can set tol
to 0 or a negative value, and it then will never stop early.
It'll probably break some of it but I need to update it anyway. What's the main application of the while loop? Is this for finding equilibrium states?
Yes exactly. Stops early if a convergence criterion (all ratios between new and old states the same, to within a tolerance) is met. So just turn off the early stopping and it'll revert to previous behaviour.
Switch to doing
iterate_matrix()
in a TF while_loop construct. This also enables setting a numerical convergence tolerance (in addition to maximum number of iterations), and reports whether or not that convergence has been reached.Two planned additional features that are possible now we are using a while loop:
greta:::as_tf_function()
) to rebuild the matrix at each iteration, given the previous state, iteration number, and any additional greta arrays.