Git Product home page Git Product logo

pressio4py's Introduction

Overview

Pressio is an open-source computational framework aimed at advancing the field of reduced-order models (ROMs) for dynamical systems in science and engineering.

Model reduction is a broad and very active field. Many methods exist, but there is no such thing as "one method to rule them all". We believe that evaluating the quality of a reduced model requires accounting for several factors, e.g., the reduction in degrees of freedom, training cost, evaluation cost, robustness, simplicity, predictive accuracy, etc. There is no single metric to rely on; it is always a tradeoff.

We believe that there is a lot to explore in this field both in terms of new research directions as well as assessing robustness of current state-of-the-art methods. There is no better way than an agile Python framework to incentivize and foster work to impact this field. Working towards this goal, pressio4py is our open source contribution to research novel fundamental ideas on model reduction as well as test state-of-the-art methods on problems of arbitrary complexity and from arbitrary disciplines. Python is the perfect language to do so because it benefits from a large community of developers and has become the de-facto choice for machine learning. This offers an ideal framework to explore and merge ideas from different fields.

This repo is currently out of sync with pressio until we have resources to update it!

Questions? Comments?

Open an issue on github, or find us on Slack: https://pressioteam.slack.com.

License and Citation

The full license is available here.

License

We are working on publishing this: you can find our arXiv preprint at: https://arxiv.org/abs/2003.07798.

pressio4py's People

Contributors

fnrizzi avatar kennychowdhary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pressio4py's Issues

masked MLP ROMs

Is it possible to create masked MLP based ROMs by replacing the linearDecoder in runMaskedLSPG from the unsteady_masked_galerkin_vs_lspg_advdiff1d_pod example with a decoder obtained from an autoencoder network? fomInitialState and romState will have to be set corrrectly; and finally romState will have to be decoded correctly and returned. Please let me know if I'm thinking in the correct direction.

proper build structure of tests

Right now we have to copy the python test files into the same directory as the .so file so we can easily import pressio4py into the python test files. We want to place the test files in the correct subfolders. One option is to add a temporary python path in the beginning of the .py test file so that the python file doesn’t have to be in the same directory as the python .so file. Alternatively, we need to look for a method to somehow temporarily add a path to the python file (similar to the addpath functionality) but using a cmake directive in case we might need to change the directory structure.

Right now, when you build you get this structure (subdirectories are marked with *):

*burgers1d_galerkin
*burgers1d_lspg
burgers1d_sparse_jacobian.py
cmake_install.cmake
CMakeCache.txt
*CMakeFiles
Makefile
pressio4py.cpython-36m-darwin.so
test_burgers1d_galerkin.py
test_burgers1d_lspg.py
test_decoder.py
test_wrapper_module.cpython-36m-darwin.so
test_wrapper.py
*tests

what I would like is to have all tests inside tests, which means tests should have the same structure that is has in the source as follows:

tests
  /regression
    /burgers1d_galerkin
    /burgers1d_lapg
  /unit
    test_decoder.py
    test_wrapper.py 
    test_wrapper_module.cpython-36m-darwin.so

and the top-level build then looks like this:

cmake_install.cmake
CMakeCache.txt
*CMakeFiles
Makefile
pressio4py.cpython-36m-darwin.so
*tests

logging level

Need to fix logic for logging levels.

  • when built in release mode, set min to info.
  • for debug mode, turn on auotmatically PRESSIO_DEBUG_PRINT and set min level to debug

miniapp with multiple fields

We need a miniapp, similar to the adv-diffusion, that has multiple fields.
For example we use the adv-diffusion to evolve multiple concentrations.
This is needed to test/show the tensor galerkin formulation.

CXX env var missing!

As the project mentioned, I defined the environment variable CXX referring to /usr/bin/g++, but the project raises the following runtime error at the installation process:

RuntimeError: CXX env var missing, needs to point to your target C++ compiler

The error is raised both in the pip install pressio4py and GitHub source code building commands.

export CXX=$(which g++) && sudo pip3 install pressio4py
export CXX=$(which g++) && sudo pip3 install ./pressio4py # build from souce

Finally, the problem has been solved by editing setup.py file, adding os.environ['CXX'] = '/usr/bin/g++' at line 110.

OS: Manjaro,
Python: 3.9,
pip: versions 20 and 21.

questions about hyper-reduction and masking

Hello,

  1. What is the difference between hyper-reduction and masking? Which one is more efficient? I think it is hyper-reduction.

  2. Is there a demo of hyper-reduction available? I'm interested in a demo corresponding to the following link

https://pressio.github.io/pressio4py/html/md_pages_components_rom_lspg_hypred.html

  1. Where can I browse the source? I can't find source corresponding to , let's say,
    pressio4py.rom.lspg.unsteady.HypredProblem

Thanks in advance,

Nachiket

fix CI using the new pip command

@kennychowdhary
Now that pressio4py can be installed using pip (see this: https://pypi.org/project/pressio4py/) we need to change the github action commands. To do so, the new action should be updated to include the following steps:

export CXX=path-to-c++-compiler
cd <the-current-branch-to-run-action-on>
cd pressio/; git pull; git checkout develop; cd -

# build pressio4py
python setup.py build
# run unit tests
cd build; pytest; cd -

python setup.py install 
# run regression tests
pytest 

(2) Also, we need to verify that the build works for several c++ compiler versions.

(3) python3 setup.py sdist bdist_wheel

setup.py: prepare for pip

@kennychowdhary
some specific things to figure out:

  • where to put the init.py?
  • what else to add to setup.py?
  • more checks to do inside setup.py: e.g. cmake version and if CXX is found in environemtn with maybe more detailed message as to what version to use ideally
  • what does install do? does it copy just the library? if so, what other "regular" files we need to tell setup.py to install?
    e.g. licence, etc
  • if I do python setup.py build I know the build directory is created inside the pressio4py repo. Is. there a way to put the build directory outside the source? I don't like to have builds inside source tree.
  • also, if I do pip install pressio4py, where is the build directory created?

cmake: automate creation of regression tests

Currently we have a non-scalable way to create regression tests, see the cmakelists inside the tests/regression.
Need to automate the creation so that we don't add each test individually.
But we need to come up with a convention to name them .

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.