diffrax
diffrax copied to clipboard
added new kalman-filter example
I wrote a little additional example that showcases diffrax
in a maybe not so obvious way. It also showcases equinox
and the ability to freeze parameters.
Let me know what you think (and what needs to be changed).
Greetings
This is quite nice.
A few high-level comments to begin with. Can you:
- tweak the introduction to follow the same style as the current examples? In particular a bit of discussion, some references etc? Atm terms like
LTISystem
show up without explanation. - add this to the list of examples in
mkdocs.yml
? - run the pre-commit hooks to autoformat this?
- Import
jax.random
asjr
? (This is what I've settled on going forward.) - Follow the Equinox style for docstrings?
- To tidy things up a bit: run the notebook afresh so that the cells increment 1-2-3-..., and delete the empty last cell?
Before i actually address these things.
-- tweak the introduction to follow the same style as the current examples? In particular a bit of discussion, some references etc? Atm terms like LTISystem show up without explanation.
Will try to do that. I just wanted to feel you out before i invest any more time if you consider it a good enough example.
-- add this to the list of examples in mkdocs.yml? Will do that.
-- run the pre-commit hooks to autoformat this? I am not sure what that means ^^
-- Import jax.random as jr? (This is what I've settled on going forward.) Sure.
-- Follow the Equinox style for docstrings? Will try to do that.
-- To tidy things up a bit: run the notebook afresh so that the cells increment 1-2-3-..., and delete the empty last cell? Hehe yes definitely needs a bit more detail love.
Yep, checking if there was interest before polishing this definitely makes a lot of sense.
Regarding the pre-commit hooks: see CONTRIBUTING.md. These are a set of scripts that run when you commit (and which the tests here will also check) that autoformat your code, check it for common errors, etc. Super useful for keeping things automatically tidy.
Sorry this took so long.
- pre-commit hooks pass (i.e. notebook is autoformatted)
- added some introductory words on Kalman-Filter and LTI systems
- add this to the list of examples in mkdocs.yml? done
Also, i could not run neither pytest
nor mkdocs
as they both throw some error.
For pytest
this is weird because i did not change any source files.
For mdocs
i would have ran it to see the notebook after nbconvert. However, it gives following error
ERROR - Error reading page 'examples/steady_state.ipynb': Additional properties are not allowed ('id' was unexpected)
For pytest
-- I think this is due to an upstream change in JAX. If you rebase/merge the current latest version of Diffrax, do you still get an error? (And if so what error?)
For mkdocs
: again I think this is due to an upstream change. Try installing the specifically pinned versions in docs/requirements.txt
.
pytest
Works now. Took about ~30 Minutes.
mkdocs
Works with pinned versions of nbformat / nbconvert.
Also fixed some typography in the notebook.
And merged! Thank you for contributing.