Skip to content

Commit

Permalink
surrogates
Browse files Browse the repository at this point in the history
  • Loading branch information
mfouesneau committed Oct 15, 2024
1 parent a8f41cb commit df78a77
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ parts:
- caption: numpyro
chapters:
- file: chapters/numpyro/introduction
- file: chapters/numpyro/surrogates
31 changes: 31 additions & 0 deletions doc/chapters/numpyro/surrogates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Surrogate Models in Astronomy: Why and How with Python and JAX

Surrogate models, also known as metamodels or emulator models, are simplified representations of more complex models. They are used in various fields, including astronomy, to make predictions about a system without having to run a full simulation, which can be computationally expensive and time-consuming.

## Why Surrogate Models?

In astronomy, simulations of planets, stars, galaxies or the Universe and phenomena can involve complex physics and large datasets, making them computationally intensive. Surrogate models provide a way to approximate these simulations, offering several advantages:

1. **Efficiency**: Surrogate models are faster to run than full simulations, making them useful for tasks that require many iterations, such as parameter tuning or uncertainty quantification.
2. **Interpretability**: Surrogate models can be easier to interpret than the original models, helping to understand the underlying physics.
3. **Feasibility**: In some cases, running a full simulation may not be feasible due to resource constraints. Surrogate models provide a viable alternative.

## How to Create Surrogate Models with Python and JAX

Python, a high-level programming language, is widely used in astronomy for its readability and extensive scientific libraries. JAX, a Python library, extends the capabilities of NumPy and autograd to leverage hardware accelerators like GPUs or TPUs.

Here's a simplified process of creating a surrogate model:

1. **Data Preparation**: Gather data from the original model or simulation. This could be a set of input parameters and corresponding outputs.
2. **Model Training**: Use a machine learning algorithm to train a model on this data. JAX can be used for this step, as it provides automatic differentiation and XLA-compiled machine learning routines.
3. **Model Validation**: Validate the surrogate model against the original model or simulation. This could involve comparing the outputs of the surrogate model with those of the original model for a new set of inputs.

## Limitations of Surrogate Models

While surrogate models offer many advantages, they also have limitations:

1. **Accuracy**: Surrogate models are approximations, so they may not capture all the nuances of the original model or simulation.
2. **Overfitting**: If the surrogate model is too complex or the training data is too sparse, the model may overfit to the training data and perform poorly on new data.
3. **Extrapolation**: Surrogate models are based on the data they were trained on and may not perform well when extrapolating beyond this data.

Despite these limitations, surrogate models remain a powerful tool in astronomy, enabling researchers to make predictions and gain insights more efficiently.

0 comments on commit df78a77

Please sign in to comment.