Welcome to astroNN’s documentation!

astroNN is a python package to do various kinds of neural networks with targeted application in astronomy by using Keras as model and training prototyping, but at the same time take advantage of Tensorflow’s flexibility.

For non-astronomy applications, astroNN contains custom loss functions and layers which are compatible with Tensorflow or Keras with Tensorflow backend. The custom loss functions mostly designed to deal with incomplete labels. astroNN contains demo for implementing Bayesian Neural Net with Dropout Variational Inference in which you can get reasonable uncertainty estimation and other neural nets.

For astronomy applications, astroNN contains some tools to deal with APOGEE, Gaia and LAMOST data. astroNN is mainly designed to apply neural nets on APOGEE spectra analysis and predicting luminosity from spectra using data from Gaia parallax with reasonable uncertainty from Bayesian Neural Net. Generally, astroNN can handle 2D and 2D colored images too. Currently astroNN is a python package being developed by the main author to facilitate his research project on deep learning application in stellar and galactic astronomy using SDSS APOGEE, Gaia and LAMOST data.

For learning purpose, astroNN includes a deep learning toy dataset for astronomer - Galaxy10 Dataset.

Getting Started

astroNN is developed on GitHub. You can download astroNN from its Github.

But the easiest way to install is via pip: astroNN on Python PyPI

$ pip install astroNN

For latest version, you can clone the latest commit of astroNN from github

$ git clone --depth=1 https://github.com/henrysky/astroNN

and run the following command to install after you open a command line window in the package folder:

$ python setup.py install

Indices, tables and astroNN structure

├── apogee/
│   ├── apogee_shared.py [shared codes across apogee module]
│   ├── chips.py [functions to deal with apogee detectors and spectra]
│   ├── downloader.py [functions to downlaod apogee data]
│   └── plotting.py [functions to plot apogee data]
├── data/
│   └──  ... [multiple pre-compiled data in numpy format]
├── datasets/
│   ├──  apogee_distances.py
│   ├──  apogee_rc.py
│   ├──  apokasc.py
│   ├──  galaxy10.py [astroNN's galaxy10 related codes]
│   ├──  h5.py
│   └──  xmatch.py [coordinates cross matching]
├── gaia/
│   ├──  downloader.py [functions to downlaod gaia data]
│   └──  gaia_shared.py [function related to astrometry and magnitude]
├── lamost/
│   ├──  chips.py [functions to deal with lamost detectors and spectra]
│   └──  lamost_shared.py [shared codes across lamost module]
├── models/ [contains neural network models]
│   └──  ... [NN models codes and modules]
├── nn/
│   ├──  callbacks.py [Keras's callbacks]
│   ├──  layers.py [layers]
│   ├──  losses.py [losses]
│   ├──  metrics.py [metrics]
│   └──  numpy.py [handy numpy tools]
└── shared/ [shared codes across modules]

Basics of astroNN

Other Topics

Acknowledging astroNN

Please cite the following paper that describes astroNN if astroNN used in your research as well as consider linking it to https://github.com/henrysky/astroNN
Deep learning of multi-element abundances from high-resolution spectroscopic data [arXiv:1804.08622][ADS]


  • Henry Leung - Initial work and developer - henrysky
    Astronomy Student, University of Toronto
    Contact Henry: henrysky.leung [at] mail.utoronto.ca
  • Jo Bovy - Project Supervisor - jobovy
    Astronomy Professor, University of Toronto