GithubHelp home page GithubHelp logo

arby's Introduction

Arby

logo

PyPI version Build Status Documentation Status codecov Python version https://github.com/leliel12/diseno_sci_sfw

Arby is a fully data-driven Python module to construct surrogate models, reduced bases and empirical interpolants from training data.

This package implements a type of Reduced Order Modeling technique for reducing the computational complexity of mathematical models in numerical simulations. This is done by building a surrogate model for the underlying model using only a training set of samples.

Install

From PyPI repo

pip install arby

For the latest version, clone this repo locally and from inside do

pip install -e .

or instead

pip install -e git+https://github.com/aaronuv/arby

Quick Usage

Suppose we have a set of real functions parametrized by a real number λ. This set, the training set, represents an underlying parametrized model fλ(x) with continuous dependency in λ. Without a complete knowledge about fλ(x), we'd like to produce an accurate approximation to the ground truth only through access to the training set.

With Arby we can do this by building a surrogate model. For simplicity, suppose a discretization of the parameter domain [par_min, par_max] with Ntrain samples indexing the training set

params = np.linspace(par_min, par_max, Ntrain)

and a discretization of the x domain [a,b] in Nsamples points

x_samples = np.linspace(a, b, Nsamples)

Next, we build a training set

training_set = [f(par, x_samples) for par in params]

that has shape (Ntrain,Nsamples).

Finally, we build the surrogate model by executing:

from arby import ReducedOrderModel as ROM
f_model = ROM(training_set=training_set,
              physical_points=x_samples,
              parameter_points=params)

With f_model we get function samples for any parameter par in the interval [par_min, par_max] simply by calling it:

f_model_at_par = f_model.surrogate(par)
plt.plot(x_samples, f_model_at_par)
plt.show()

Documentation

For more details and examples check the read the docs.

License

MIT

Contact Us

[email protected]


(c) 2020 Aarón Villanueva

arby's People

Contributors

aaronuv avatar leliel12 avatar martinberoiz avatar mchalela avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.