We present a novel deep operator network (DeepONet) architecture for operator learning, the ensemble DeepONet, that allows for enriching the trunk network of a single DeepONet with multiple distinct trunk networks. This trunk enrichment allows for greater expressivity and generalization capabilities over a range of operator learning problems. We also present a spatial mixture-of-experts (MoE) DeepONet trunk network architecture that utilizes a partition-of-unity (PoU) approximation to promote spatial locality and model sparsity in the operator learning problem. We first prove that both the ensemble and PoU-MoE DeepONets are universal approximators. We then demonstrate that ensemble DeepONets containing a trunk ensemble of a standard trunk, the PoU-MoE trunk, and/or a proper orthogonal decomposition (POD) trunk can achieve 2-4x lower relative
For running the code, the following Python libraries are required:
- numpy
- matplotlib
- json
- scipy
- torch
- jax
- haiku
We provide a requirements.txt file that can be used to install the libraries with pip:
>> pip install -r requirements.txtPlease refer to the paper for the datasets used.
We provide the Python code for the four problems (Darcy flow, lid-driven cavity flow, 2D reaction-diffusion, and 3D reaction-diffusion with variable coefficient diffusion) in this paper in the src/ folder. The code files are
These files run the vanilla, POD, modified-POD, and ensemble DeepONets, and also contain plotting code. All the DeepONet models are defined in the jax_networks.py file. The utils.py file contains helper functions for forming the POD basis and implements the Partition-of-Unity (PoU) method. The train_utils.py file contains a generic Jax training function for DeepONets.
Hyperparameters: One can change the learning rate, activation function, and other DeepONet hyperparameters within the code files. The code also automatically saves the results in a descriptive folder name for each problem separately.
This repository is part of the following paper. Please cite the following paper if you would like to cite this repository and find its contents useful:
@article{SharmaShankar2025ensembledeeponet,
title={Ensemble and Mixture-of-Experts DeepONets For Operator Learning},
author={Sharma, Ramansh and Shankar, Varun},
journal={Transactions on Machine Learning Research},
arxiv = {https://arxiv.org/abs/2405.11907},
url = {https://openreview.net/forum?id=MGdydNfWzQ},
year={2025}
}