Skip to content

Implementation of automatic differentiation in VBozza's BinaryLensing

Notifications You must be signed in to change notification settings

kmzzhang/microlensing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VBozza's BinaryLensing with auto-diff support

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.

Installation

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

Usage

There are examples in the examples folder. You can run them directly can change the input parameters by yourself.

Numpy version

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.

Jax version

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.

Features

  • 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

Future work

  • High order effects: parallax, orbital motion etc.
  • Using NUTS in numpyro and Jax version to model real data
  • More test and comparison with VBBL

Reference

under development and Paper is coming soon.

About

Implementation of automatic differentiation in VBozza's BinaryLensing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%