f0uriest / quadax Goto Github PK
View Code? Open in Web Editor NEWNumerical quadrature with JAX
License: MIT License
Numerical quadrature with JAX
License: MIT License
Hi @f0uriest,
Thanks for creating this neat package! For the example on the Readme, the assert statement is failing for me. The fix was to make JAX work with 64 bit precession with the lines
from jax import config
config.update("jax_enable_x64", True)
An alternative would be to remove the first assert statement and note that by default JAX using 32bit for floats. The second check works just fine but checking the precision out to 1e-14 might be too strict for other examples.
If you think this might be a bug, I'd be happy to contribute a PR for either of these fixes if you're interested.
Hi, big fan of this repository! Are there any updates on n-dimensional quadrature? It would be very useful for me!
I use weighted quadrature in my research, and I was thinking of using quadax to replace scipy.integrate.quad in my work. I'd be interested in contributing a feature that handles weighted integration. Would you be open to a PR like that?
Seems low priority, but could be nice to add cumulative_simpson
integration. I think it should just involve copy-pasting https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.cumulative_simpson.html and changing numpy np
references to jax jnp
.
Hi ๐ ,
Very cool library! I'm interested in using it for some numerical approximations in genetics, and was curious if its possible for users to specify points where the integral may have difficulties. This is similar to passing in points=...
for scipy.integral.quad
.
Nice package! I am trying to implement some custom quadrature rules using quadax. I was trying to understand how you are computing the absolute error in NestedRule
:
abserr = jnp.where(
(integral_mmn != 0.0) & (abserr != 0.0),
integral_mmn * jnp.minimum(1.0, (200.0 * abserr / integral_mmn) ** 1.5),
abserr,
)
abserr = jnp.where(
(integral_abs > uflow / (50.0 * eps)),
jnp.maximum((eps * 50.0) * integral_abs, abserr),
abserr,
)
Where are you getting the numbers 200.0
, 1.5
, and 50.0
from?
Hi @f0uriest,
I've started using quadax
in some of my projects and noticed that poetry
complains about dependencies that could either be relaxed (numpy < 1.25.0
and, potentially, jax <= 0.4.14
) or dropped entirely (scipy
).
Thanks a lot for your work and help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.