Giter VIP home page Giter VIP logo

martenlienen / finite-element-networks Goto Github PK

View Code? Open in Web Editor NEW
64.0 2.0 6.0 1.3 MB

Reference implementation of Finite Element Networks as proposed in "Learning the Dynamics of Physical Systems from Sparse Observations with Finite Element Networks" at ICLR 2022

Home Page: https://www.daml.in.tum.de/finite-element-networks

License: MIT License

Python 7.60% Jupyter Notebook 92.40%
neural-ode spatio-temporal forecasting pde

finite-element-networks's Introduction

Finite Element Networks

This project provides a clean and extensible reference implementation of Finite Element Networks as proposed in our paper

Learning the Dynamics of Physical Systems from Sparse Observations with Finite Element Networks
Marten Lienen & Stephan Günnemann
Published at ICLR 2022


A learned flow field

Installation

First, install pytorch and torch-scatter according to your CPU/GPU setup. Then you can clone the repository and install the package locally.

# Clone the repository
git clone https://github.com/martenlienen/finite-element-networks

# Change into the repository
cd finite-element-networks

# Make sure that a recent version of pip is available that supports PEP 518 projects
# with a pyproject.toml
pip install --upgrade pip

# Install the code as a local package
pip install --editable .

After this you can import finite_element_networks in your own code, python shell, and notebooks, and easily integrate it into your existing code.

If you want to run our example training script, explore the notebooks or use our pytorch lightning data modules, you have to install the package with the lightning extra.

pip install --editable '.[lightning]'

If you are a weights & biases user, there is some additional code to log plots and animations there during training.

Extending & Exploring

To get you started quickly, we have published a preprocessed version of the Black Sea and ScalarFlow datasets as well as pre-trained checkpoints of both FEN and T-FEN. To get them, run the following commands in the root of the repository.

curl -o data.zip https://zenodo.org/record/6366269/files/fen.zip
unzip data.zip

Now you can train a new model with examples/train.py black-sea or examples/train.py scalar-flow. Note, that you can also train models or use the project in any other way without downloading the data and checkpoints. However, if you use the data modules without having downloaded the preprocessed datasets, the will download and prepare the data for you, which is almost 500G for ScalarFlow and 13G for Black Sea.

If you end up using these datasets in your own work, please note that the raw data of both datasets comes with their own license as we have described in the appendix of our paper.

Additionally, we provide some notebooks for you to recreate results and figures similar to what we present in the paper.

The simplest way for you to apply this model to your own data will be to create your own data module, which you can model directly after the ones that we provide.

Cite

If you build upon this work, please cite our paper as follows.

@inproceedings{lienen_fen2022,
  title = {Learning the Dynamics of Physical Systems from Sparse Observations with Finite Element Networks},
  author = {Lienen, Marten and G\"unnemann, Stephan},
  booktitle={International Conference on Learning Representations (ICLR)},
  year = {2022},
}

finite-element-networks's People

Contributors

martenlienen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

finite-element-networks's Issues

OSerror when experiment with cylinder-flow dataset

Hi there! When I was playing around with cylinder-flow dataset, there was an error:

Traceback (most recent call last):
  File "/home/liluo/anaconda3/lib/python3.9/multiprocessing/queues.py", line 244, in _feed
  File "/home/liluo/anaconda3/lib/python3.9/multiprocessing/reduction.py", line 51, in dumps
  File "/home/liluo/anaconda3/lib/python3.9/site-packages/torch/multiprocessing/reductions.py", line 359, in reduce_storage
  File "/home/liluo/anaconda3/lib/python3.9/multiprocessing/reduction.py", line 198, in DupFd
  File "/home/liluo/anaconda3/lib/python3.9/multiprocessing/resource_sharer.py", line 48, in __init__
OSError: [Errno 24] Too many open files

I notice that there are 100 pt files for these train/valid/test folders on cylinder-flow dataset. I'm wondering is the problem caused by reading so many files? I adjust my num_workers to 4.

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.