This code is a auto-diff version of the VBozza's BinaryLensing.It is built on the JAX library which provides a NumPy-like interface with GPU support and automatic differentiation for high-performance machine learning research.
As this code is under development, it is not available on PyPI. You can install it from source by cloning the repository and running after installing Jax.For how to install Jax, please refer to Jax installation guide.
git clone https://github.com/CoastEgo/microlensing.git
There are examples in the examples
folder. You can run them directly can change the input parameters by yourself.
There are two versions of the code: numpy version and jax version. The difference is that numpy version can return the image curve while jax version can not. For the reason that Jax is hard to debug and its JIT compilation overhead, you can test it with VBBL to avoid VBBL's potential failures . It is better to do this when you use VBBL+MCMC to fit data.
The jax version can be used to calculate the gradient light curve for meachine learning or other optimization methods.For example, you can combine it with Numpyro to do MCMC or HMC sampling. The combination of NUTS in numpyro and Jax version is still testing.
- Optimal sampling and countour integral with error control
- JIT compilation to sppeed up and GPU support
- Automatic differentiation for high-performance machine learning and optimization
- Laguerre's method to find the root of the polynomial and liner sum assignment algorithm to match the images
- High order effects: parallax, orbital motion etc.
- Using NUTS in numpyro and Jax version to model real data
- More test and comparison with VBBL
under development and Paper is coming soon.