/autoemulate

emulate simulations easily

Primary LanguagePythonMIT LicenseMIT

AutoEmulate

CI codecov Code style: black All Contributors Documentation

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 models, 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.

installation

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 (will not contain the most recent features and models)

pip install autoemulate

For contributors using Poetry:

git clone https://github.com/alan-turing-institute/autoemulate.git
cd autoemulate
poetry install

quick start

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_model = ae.compare() 
# training set cross-validation results
ae.print_results() 
# plot cv results
ae.plot_results()
# test set results for the best model
ae.evaluate_model(best_model) 
# refit on full data
best_emulator = ae.refit_model(best_model) 
# emulate
best_emulator.predict(X)

documentation

You can find tutorials, FAQs and the API reference here. The documentation is still work in progress.

Contributors

Kalle Westerling
Kalle Westerling

📖 💻 🖋
Bryan M. Li
Bryan M. Li

💻
martin
martin

💻 🤔 📖 🚧 🔬 👀
Eric Daub
Eric Daub

🤔 📆 👀 💻
steven niederer
steven niederer

🤔 🖋 📆
Maximilian Balmus
Maximilian Balmus

💻 🐛
Sophie Arana
Sophie Arana

🖋 📖 📆