-
Notifications
You must be signed in to change notification settings - Fork 2
Add plot backup, full-JAX PCS planar + Gaussian quadrature integratio… #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
the planar_pcs_num.py file. Correct a description of function in the planar_pcs.py file.
callable from other files for comparison purposes with the users choice parameters : - option of saving or not the results, figures, videos - option of plotting/printing or not the results, figures - option on the type of derivation to use : symbolic, numeric - option on the type of integration and parameter of integration to use : gauss, trapezoid - option on the type of jacobian to use : explicit or autodifferentiation Added the ability to save simulation results in pickle files (.pkl) for later comparison Set up an explicit Jacobian in SE3 to compute B and G - SE(3) Lie algebra operators - convert SE(2) to SE(3) to use operators for the planar case
Implementation of a Gauss-Kronrad quadrature integration using the quadax library Function documentation
src/jsrm/utils/lie_operators.py
Outdated
|
||
# Triangular mask for partial sum: (N, N) | ||
# mask[i, j] = 1 if j >= i and j <= idx | ||
mask = (jnp.arange(N)[:, None] <= jnp.arange(N)[None, :]) & (jnp.arange(N)[None, :] <= idx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is the case, but when you use jnp.arange(N)
and N
changes (because you maybe call this function with matrices M
of different dimensionalities), then this will trigger a re-compile which can slow down things a lot.
Please use the jax.log_compiles
context manger (https://docs.jax.dev/en/latest/_autosummary/jax.log_compiles.html) or the JAX_LOG_COMPILES=1
(https://docs.jax.dev/en/latest/config_options.html) environment variable to check for recompiles during evaluation.
get rid of jnp.array when possible, benchmark and tests on eps.
Autodiff: for loop calculation corrected Explicit: implementation of explicit calculation using Lie algebra Various tests
kinetic energy depends only on B and does not need to calculate other dynamic matrices Correction of documentations
Corrected documentation Removal of unnecessary imports Ready to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost looks good and definitely going into the right direction! I will have a closer look towards the end of the week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please make it (also) compatible with an automated test execution (i.e., by the pytest
package)?
I think the GUI-based validation is very nice and you can keep it in a part that is isolated in a if __name__ == "__main__":
condition (i.e., it is only executed if the test file is called from the command line). The automated tests would live in separate functions that are directly called by pytest.
Add plot backup, full-JAX PCS planar + Gaussian quadrature integration scheme