Simulations of physical systems are often slow and need lots of compute, which makes them unpractical for real-world applications like digital twins, or when they have to run thousands of times for sensitivity analyses. The goal of AutoEmulate
is to make it easy to replace simulations with fast, accurate emulators. To do this, AutoEmulate
automatically fits and compares various emulators, ranging from simple models like Radial Basis Functions and Second Order Polynomials to more complex models like Support Vector Machines, Gaussian Processes and Conditional Neural Processes to find the best emulator for a simulation.
The project is in early development.
There's currently a lot of development, so we recommend installing the most current version from GitHub:
pip install git+https://github.com/alan-turing-institute/autoemulate.git
There's also a release available on PyPI (note: currently an older version and out of date with the documentation)
pip install autoemulate
For contributors using Poetry:
git clone https://github.com/alan-turing-institute/autoemulate.git
cd autoemulate
poetry install
import numpy as np
from autoemulate.compare import AutoEmulate
from autoemulate.experimental_design import LatinHypercube
from autoemulate.simulations.projectile import simulate_projectile
# sample from a simulation
lhd = LatinHypercube([(-5., 1.), (0., 1000.)])
X = lhd.sample(100)
y = np.array([simulate_projectile(x) for x in X])
# compare emulator models
ae = AutoEmulate()
ae.setup(X, y)
best_emulator = ae.compare()
# training set cross-validation results
ae.summarise_cv()
ae.plot_cv()
# test set results for the best model
ae.evaluate(best_emulator)
ae.plot_eval(best_emulator)
# refit on full data and emulate!
emulator = ae.refit(best_emulator)
emulator.predict(X)
# global sensitivity analysis
si = ae.sensitivity_analysis(emulator)
ae.plot_sensitivity_analysis(si)
You can find tutorials, FAQs and the API reference here. The documentation is still work in progress.
Kalle Westerling 📖 💻 🖋 |
Bryan M. Li 💻 |
martin 💻 🤔 📖 🚧 🔬 👀 |
Eric Daub 🤔 📆 👀 💻 |
steven niederer 🤔 🖋 📆 |
Maximilian Balmus 💻 🐛 |
Sophie Arana 🖋 📖 📆 |