This is a template library for conducting research on DeepONet, a deep learning architecture for learning operators and solving partial differential equations. The library provides a modular and extensible framework for defining, training, and evaluating DeepONet models.
The template library has the following directory structure:
./
├── README.md
├── analyze.py
├── deeponet
│ ├── __init__.py
│ ├── data.py
│ ├── model.py
│ ├── train.py
│ └── utils.py
├── freeze.sh
├── kan.sh
├── requirements.txt
└── run.py
README.md: This file, providing an overview and documentation of the library.analyze.py: A script for analyzing trained models and generating visualizations.deeponet/: The main package containing the core components of the library.__init__.py: Package initialization file.data.py: Module for loading and preprocessing data.model.py: Module defining the DeepONet model architectures.train.py: Module for training DeepONet models.utils.py: Module containing utility functions and classes.
freeze.sh: A shell script for freezing the library's dependencies intorequirements.txt.kan.sh: A shell script for cloning and setting up the Kolmogorov-Arnold Network (KAN) repository.requirements.txt: A file listing the library's dependencies.run.py: The main script for running experiments and training models.
- Python 3.7 or higher
- Git
- uv
To install the library and its dependencies, follow these steps:
-
Clone the repository:
git clone https://github.com/Axect/DeepONet_Template -
Navigate to the library directory:
cd DeepONet_Template -
Set up a virtual environment via uv:
uv venv uv pip sync requirements.txt source .venv/bin/activate -
(Optional) Run the
kan.shscript to download efficient-kan (Kolmogorov-Arnold Network):sh kan.sh
To use the DeepONet template library, follow these steps:
-
Prepare your data:
- Organize your data into the appropriate format required by the library.
- Modify the
data.pymodule to load and preprocess your data.
-
Define your model:
- Choose the appropriate DeepONet model architecture from the
model.pymodule or create a new one. - Modify the model architecture and hyperparameters as needed.
- Choose the appropriate DeepONet model architecture from the
-
Train your model:
- Use the
run.pyscript to train your model. - Adjust the training parameters and hyperparameters in the
run.pyscript.
- Use the
-
Analyze and visualize results:
- Use the
analyze.pyscript to analyze the trained models and generate visualizations. - Customize the analysis and visualization code in
analyze.pybased on your requirements.
- Use the
-
(Optional) Freeze the dependencies:
- If you make changes to the library's dependencies, run the
freeze.shscript to update therequirements.txtfile.
- If you make changes to the library's dependencies, run the
Contributions to the DeepONet template library are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License.
This template library was inspired by various research papers and implementations of DeepONet. We would like to acknowledge the contributors and researchers who have made significant contributions to the field of DeepONet and related areas.