Skip to content

For characterizing flares with convolutional neural networks

License

Notifications You must be signed in to change notification settings

benjaminpope/stella

 
 

Repository files navigation

PyPI - Downloads Docs Deploy GitHub Pages

stella is a Python package to create and train a neural network to identify stellar flares. Within stella, users can simulate flares as a training set, run a neural network, and feed in their own data to the neural network model. stella returns a probability at each data point that that data point is part of a flare or not. stella can also characterize the flares identified.

To install stella with pip:

pip install stella

Alternatively you can install the current development version of stella:

    git clone https://github.com/afeinstein20/stella
    cd stella
    python setup.py install

Backends and models

  • stella uses Keras Core and works with multiple backends: JAX or PyTorch. Choose one, install, and set it before importing keras:
# JAX
pip install -r requirements-jax.txt
export KERAS_BACKEND=jax

# or PyTorch
pip install -r requirements-torch.txt
export KERAS_BACKEND=torch

Models are saved/loaded in the native Keras format (.keras). If you have older .h5 or legacy SavedModel models, use the included converter:

# Convert .h5 or legacy SavedModel to .keras (TensorFlow backend only for conversion)
python scripts/convert_h5_to_keras.py /path/to/models -r --cadences 350 -o /path/to/out

Pipeline quickstart

Swap backends quickly

  • Inspect availability and devices:
import stella
stella.check_backend()
  • Prepare a swap (restart your interpreter after):
import stella
stella.swap_backend('torch', accelerator='mps')   # Apple Silicon
# or
stella.swap_backend('jax', accelerator='cpu')

<p>
If your work uses the stella software, please cite <a href="https://ui.adsabs.harvard.edu/abs/2020JOSS....5.2347F/abstract">Feinstein, Montet, & Ansdell (2020)</a>.
</p>
<p>
If your work discusses the flare rate of young stars in the TESS Southern Hemisphere or the details of the CNNs, please cite <a href="https://ui.adsabs.harvard.edu/abs/2020arXiv200507710F/abstract">Feinstein et al. (AJ, 2020)</a>.
</p>

<p>
<b><u>Bug Reports, Questions, & Contributions</u></b>
</p>
<p>
stella is an open source project under the MIT license. 
The source code is available on GitHub. In case of any questions or problems, please contact us via the Git Issues. 
Pull requests are also welcome through the GitHub page.
</p>

About

For characterizing flares with convolutional neural networks

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.4%
  • TeX 7.7%
  • Shell 0.9%