pinnstf2


Namepinnstf2 JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/rezaakb/pinns-tf2
SummaryAn implementation of PINNs in TensorFlow v2.
upload_time2023-11-25 01:03:01
maintainer
docs_urlNone
authorReza Akbarian Bafghi
requires_python
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

<img src="http://drive.google.com/uc?export=view&id=18OEs1wMiVqpxRTEudW-FzXwJelsx5eHm" width="400">
</br>
</br>

<a href="https://hydra.cc/"><img alt="Config: Hydra" src="https://img.shields.io/badge/Config-Hydra-89b8cd"></a>
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rezaakb/pinns-tf2/blob/main/tutorials/0-Schrodinger.ipynb)

<a href="https://arxiv.org/abs/2311.03626">[Paper]</a> - <a href="https://github.com/rezaakb/pinns-torch">[PyTorch]</a> - <a href="https://github.com/maziarraissi/PINNs">[TensorFlow v1]</a>
</div>

## Description

PINNs-TF2 is a Python package built on the TensorFlow V2 framework. It not only accelerates PINNs implementation but also simplifies user interactions by abstracting complex PDE challenges. We underscore the pivotal role of compilers in PINNs, highlighting their ability to boost performance by up to 119x.

<div align="center">
<img src="http://drive.google.com/uc?export=view&id=1vGb-wuPI1bAEsD_5CKtUPUHq8cC1J32X" width="1000">
</br>
<em>Each subplot corresponds to a problem, with its iteration count displayed at the
top. The logarithmic x-axis shows the speed-up factor w.r.t the original code in TensorFlow v1, and the y-axis illustrates the mean relative error.</em>
</div>
</br>


For more information, please refer to our paper:

<a href="https://arxiv.org/abs/2311.03626">PINNs-TF2: Fast and User-Friendly Physics-Informed Neural Networks in TensorFlow V2.</a> Reza Akbarian Bafghi, and Maziar Raissi. ML4PS, NeurIPS, 2023.

## Installation

PINNs-TF2 requires following dependencies to be installed:

- [TensorFlow](https://www.tensorflow.org/install) >=2.0.0
- [Hydra](https://hydra.cc/docs/intro/) >= 1.3

Then, you can install PINNs-TF2 itself via \[pip\]:

```bash
pip install pinnstf2
```

If you intend to introduce new functionalities or make code modifications, we suggest duplicating the repository and setting up a local installation:

```bash
git clone https://github.com/rezaakb/pinns-tf2
cd pinns-tf2

# [OPTIONAL] create conda environment
conda create -n myenv python=3.9
conda activate myenv

# install package
pip install -e .
```

## Quick start

Explore a variety of implemented examples within the [examples](examples) folder. To run a specific code, such as the one for the Navier-Stokes PDE, you can use:

```bash
python examples/navier_stokes/train.py
```

You can train the model using a specified configuration, like the one found in [examples/navier_stokes/configs/config.yaml](examples/navier_stokes/configs/config.yaml). Parameters can be overridden directly from the command line. For instance:

```bash
python examples/navier_stokes/train.py trainer.max_epochs=20 n_train=3000
```

To utilize our package, there are two primary options:

- Implement your training structures using Hydra, as illustrated in our provided examples.
- Directly incorporate our package to solve your custom problem.

For a practical guide on directly using our package to solve the Schrödinger PDE in a continuous forward problem, refer to our tutorial here: [tutorials/0-Schrodinger.ipynb](tutorials/0-Schrodinger.ipynb).

## Data

The data located on the server and will be downloaded automatically upon running each example.

## Contributing

As this is the first version of our package, there might be scope for enhancements and bug fixes. We highly value community contributions. If you find any issues, missing features, or unusual behavior during your usage of this library, please feel free to open an issue or submit a pull request on GitHub. For any queries, suggestions, or feedback, please send them to [Reza Akbarian Bafghi](https://www.linkedin.com/in/rezaakbarian/) at [reza.akbarianbafghi@colorado.edu](mailto:reza.akbarianbafghi@colorado.edu).

## License

Distributed under the terms of the \[BSD-3\] license, "pinnstf2" is free and open source software.

## Resources

We employed [this template](https://github.com/ashleve/lightning-hydra-template) to develop the package, drawing from its structure and design principles. For a deeper understanding, we recommend visiting their GitHub repository.

## Citation

```
@inproceedings{Bafghi2023PINNsTF2FA,
  title={PINNs-TF2: Fast and User-Friendly Physics-Informed Neural Networks in TensorFlow V2},
  author={Reza Akbarian Bafghi and Maziar Raissi},
  year={2023},
  url={https://api.semanticscholar.org/CorpusID:265043331}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rezaakb/pinns-tf2",
    "name": "pinnstf2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Reza Akbarian Bafghi",
    "author_email": "reza.akbarianbafghi@coloardo.edu",
    "download_url": "https://files.pythonhosted.org/packages/de/af/def52f65da38398945f646e2db6477603dfadfe459b047d4ccf33ed85355/pinnstf2-0.1.3.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n<img src=\"http://drive.google.com/uc?export=view&id=18OEs1wMiVqpxRTEudW-FzXwJelsx5eHm\" width=\"400\">\n</br>\n</br>\n\n<a href=\"https://hydra.cc/\"><img alt=\"Config: Hydra\" src=\"https://img.shields.io/badge/Config-Hydra-89b8cd\"></a>\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rezaakb/pinns-tf2/blob/main/tutorials/0-Schrodinger.ipynb)\n\n<a href=\"https://arxiv.org/abs/2311.03626\">[Paper]</a> - <a href=\"https://github.com/rezaakb/pinns-torch\">[PyTorch]</a> - <a href=\"https://github.com/maziarraissi/PINNs\">[TensorFlow v1]</a>\n</div>\n\n## Description\n\nPINNs-TF2 is a Python package built on the TensorFlow V2 framework. It not only accelerates PINNs implementation but also simplifies user interactions by abstracting complex PDE challenges. We underscore the pivotal role of compilers in PINNs, highlighting their ability to boost performance by up to 119x.\n\n<div align=\"center\">\n<img src=\"http://drive.google.com/uc?export=view&id=1vGb-wuPI1bAEsD_5CKtUPUHq8cC1J32X\" width=\"1000\">\n</br>\n<em>Each subplot corresponds to a problem, with its iteration count displayed at the\ntop. The logarithmic x-axis shows the speed-up factor w.r.t the original code in TensorFlow v1, and the y-axis illustrates the mean relative error.</em>\n</div>\n</br>\n\n\nFor more information, please refer to our paper:\n\n<a href=\"https://arxiv.org/abs/2311.03626\">PINNs-TF2: Fast and User-Friendly Physics-Informed Neural Networks in TensorFlow V2.</a> Reza Akbarian Bafghi, and Maziar Raissi. ML4PS, NeurIPS, 2023.\n\n## Installation\n\nPINNs-TF2 requires following dependencies to be installed:\n\n- [TensorFlow](https://www.tensorflow.org/install) >=2.0.0\n- [Hydra](https://hydra.cc/docs/intro/) >= 1.3\n\nThen, you can install PINNs-TF2 itself via \\[pip\\]:\n\n```bash\npip install pinnstf2\n```\n\nIf you intend to introduce new functionalities or make code modifications, we suggest duplicating the repository and setting up a local installation:\n\n```bash\ngit clone https://github.com/rezaakb/pinns-tf2\ncd pinns-tf2\n\n# [OPTIONAL] create conda environment\nconda create -n myenv python=3.9\nconda activate myenv\n\n# install package\npip install -e .\n```\n\n## Quick start\n\nExplore a variety of implemented examples within the [examples](examples) folder. To run a specific code, such as the one for the Navier-Stokes PDE, you can use:\n\n```bash\npython examples/navier_stokes/train.py\n```\n\nYou can train the model using a specified configuration, like the one found in [examples/navier_stokes/configs/config.yaml](examples/navier_stokes/configs/config.yaml). Parameters can be overridden directly from the command line. For instance:\n\n```bash\npython examples/navier_stokes/train.py trainer.max_epochs=20 n_train=3000\n```\n\nTo utilize our package, there are two primary options:\n\n- Implement your training structures using Hydra, as illustrated in our provided examples.\n- Directly incorporate our package to solve your custom problem.\n\nFor a practical guide on directly using our package to solve the Schr\u00f6dinger PDE in a continuous forward problem, refer to our tutorial here: [tutorials/0-Schrodinger.ipynb](tutorials/0-Schrodinger.ipynb).\n\n## Data\n\nThe data located on the server and will be downloaded automatically upon running each example.\n\n## Contributing\n\nAs this is the first version of our package, there might be scope for enhancements and bug fixes. We highly value community contributions. If you find any issues, missing features, or unusual behavior during your usage of this library, please feel free to open an issue or submit a pull request on GitHub. For any queries, suggestions, or feedback, please send them to [Reza Akbarian Bafghi](https://www.linkedin.com/in/rezaakbarian/) at [reza.akbarianbafghi@colorado.edu](mailto:reza.akbarianbafghi@colorado.edu).\n\n## License\n\nDistributed under the terms of the \\[BSD-3\\] license, \"pinnstf2\" is free and open source software.\n\n## Resources\n\nWe employed [this template](https://github.com/ashleve/lightning-hydra-template) to develop the package, drawing from its structure and design principles. For a deeper understanding, we recommend visiting their GitHub repository.\n\n## Citation\n\n```\n@inproceedings{Bafghi2023PINNsTF2FA,\n  title={PINNs-TF2: Fast and User-Friendly Physics-Informed Neural Networks in TensorFlow V2},\n  author={Reza Akbarian Bafghi and Maziar Raissi},\n  year={2023},\n  url={https://api.semanticscholar.org/CorpusID:265043331}\n}\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "An implementation of PINNs in TensorFlow v2.",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/rezaakb/pinns-tf2"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "deafdef52f65da38398945f646e2db6477603dfadfe459b047d4ccf33ed85355",
                "md5": "e03b99a43fc5d747d78cc36de7e6ec9f",
                "sha256": "de0af94e554c4240fbc9e105b595b6b679c2ef44f08790e82ae055035307bc1f"
            },
            "downloads": -1,
            "filename": "pinnstf2-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e03b99a43fc5d747d78cc36de7e6ec9f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 35881,
            "upload_time": "2023-11-25T01:03:01",
            "upload_time_iso_8601": "2023-11-25T01:03:01.922112Z",
            "url": "https://files.pythonhosted.org/packages/de/af/def52f65da38398945f646e2db6477603dfadfe459b047d4ccf33ed85355/pinnstf2-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-25 01:03:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rezaakb",
    "github_project": "pinns-tf2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pinnstf2"
}
        
Elapsed time: 0.27674s