Skip to content

alan-turing-institute/autoemulate

Repository files navigation

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

Installation

There's lots of development at the moment, 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 on PyPI:

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 emulators
ae = AutoEmulate()
ae.setup(X, y)
best_emulator = ae.compare() 

# cross-validation results
ae.summarise_cv() 
ae.plot_cv()

# test set results for the best emulator
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)

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

🖋 📖 📆