Skip to content

Implementation of automatic differentiation in VBozza's BinaryLensing

License

Notifications You must be signed in to change notification settings

CoastEgo/BinaryJax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BinaryJax

This code is a Jax-based package that is used to calculate the binary lensing light curve with the finite source effect using the contour integration method. We inherit the novel features in VBBinaryLensing including parabolic correction and optimal sampling to maximize the performance. This is built on the JAX library which provides a NumPy-like interface with GPU and automatic differentiation support for high-performance machine learning research. Through automatic differentiation and our package, we get access to the accurate gradient for exploring more advanced algorithms.

Installation

You can install this package from the source by cloning the repository and running it after installing Jax. For the installation of Jax, please refer to the Jax installation guide.

git clone https://github.com/CoastEgo/BinaryJax.git

cd BinaryJax

pip install -e .

Usage

The Jax version can calculate the gradient of the light curve using automatic differentiation. There are examples in the test folder which show the light curve and gradient calculation.

Applications

We can combine the Jax code with Numpyro for Hamiltonian Monte Carlo (HMC) sampling. There is a Jupyter notebook showing the application of HMC in modeling real microlensing events KMT-2019-BLG-0371 in the example folder.

Features

  • Optimal sampling and contour integration with error control to calculate the binary lens microlensing light curve with finite source effect.
  • Robust and accurate calculation: Widely test over the broad parameter space compared with VBBinaryLensing
  • Fast speed: Fully compatible with JIT compilation to speed up calculation.
  • Accurate gradient: Automatic differentiation with novel error estimator to ensure the convergence of gradient.
  • Aberth–Ehrlich method to find the roots of the polynomial and liner sum assignment algorithm to match the images
  • Application on real events modeling using NUTS in Numpyro

Future work

  • High-order effects: parallax, orbital motion etc.
  • Machine learning Applications.

Reference

under development and Paper is coming soon.

About

Implementation of automatic differentiation in VBozza's BinaryLensing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published