{"id":20054847,"url":"https://github.com/thu-ml/nuno","last_synced_at":"2025-05-05T13:31:42.526Z","repository":{"id":173290129,"uuid":"642357490","full_name":"thu-ml/NUNO","owner":"thu-ml","description":"[ICML 2023] Non-Uniform Neural Operator (NUNO)","archived":false,"fork":false,"pushed_at":"2023-07-03T11:14:03.000Z","size":5514,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-08T23:41:51.805Z","etag":null,"topics":["partial-differential-equations","physics","point-cloud","pytorch","simualtion"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2305.18694","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thu-ml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-18T11:44:12.000Z","updated_at":"2025-03-01T08:27:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdff2b75-f508-407b-ae15-ab8c8be43900","html_url":"https://github.com/thu-ml/NUNO","commit_stats":{"total_commits":86,"total_committers":2,"mean_commits":43.0,"dds":"0.023255813953488413","last_synced_commit":"ef1aeb67ddfffef498dc0d039a5f1500b8498aaf"},"previous_names":["thu-ml/nuno"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thu-ml%2FNUNO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thu-ml%2FNUNO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thu-ml%2FNUNO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thu-ml%2FNUNO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thu-ml","download_url":"https://codeload.github.com/thu-ml/NUNO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252506443,"owners_count":21759048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["partial-differential-equations","physics","point-cloud","pytorch","simualtion"],"created_at":"2024-11-13T12:44:03.295Z","updated_at":"2025-05-05T13:31:41.849Z","avatar_url":"https://github.com/thu-ml.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](assets/poster.png)\n\n# Non-Uniform Neural Operator (NUNO)\n\nThis repository is the official implementation of our [ICML 2023](https://icml.cc/Conferences/2023) paper: [NUNO: A General Framework for Learning Parametric PDEs with Non-Uniform Data](https://arxiv.org/abs/2305.18694). [Here](assets/slides.pdf) are the corresponding introductory slides.\n\nThe neural operator has emerged as a powerful tool in learning mappings between function spaces in PDEs. However, when faced with real-world physical data, which are often highly non-uniformly distributed, it is challenging to use mesh-based techniques such as the FFT. To address this, we introduce the Non-Uniform Neural Operator (NUNO), a comprehensive framework designed for efficient operator learning with non-uniform data. Leveraging a K-D tree-based domain decomposition, we transform non-uniform data into uniform grids while effectively controlling interpolation error, thereby paralleling the speed and accuracy of learning from non-uniform data. We conduct extensive experiments on 2D elasticity, (2+1)D channel flow, and a 3D multi-physics heatsink, which, to our knowledge, marks a novel exploration into **3D PDE problems** with **complex geometries**. Our framework has reduced error rates by up to **60%** and enhanced training speeds by **2x** to **30x**. The code is now available at [this https URL](https://github.com/thu-ml/NUNO).\n\nIf you find this work is helpful for your research, please **cite us** with the following BibTeX entry:\n\n```\n@article{liu2023nuno,\n  title={NUNO: A General Framework for Learning Parametric PDEs with Non-Uniform Data},\n  author={Liu, Songming and Hao, Zhongkai and Ying, Chengyang and Su, Hang and Cheng, Ze and Zhu, Jun},\n  journal={arXiv preprint arXiv:2305.18694},\n  year={2023}\n}\n```\n\n## Directory Structure\n\nThis repository is organized as below:\n\n- `data` (folder for training and testing data)\n  - `channel` ((2+1)D Channel Flow)\n  - `elasticity` (2D Elasticity)\n  - `heatsink` (3D Heatsink)\n- `src` (folder for scripts to run experiments)\n  - `channel` ((2+1)D Channel Flow)\n    Note: each Python file corresponds to a single baseline method.\n    - `deeponet.py` (to run DeepONet)\n    - ...\n    - `ours_nuunet.py` (to run one of our methods, NU-U-Net)\n  - `elasticity` (2D Elasticity)\n    - ...\n  - `heatsink` (3D Heatsink)\n    - ...\n  - `kd_tree` (module of K-D tree algorithm, imported by the above scripts)\n- `util` (folder for util functions)\n- `assets` (folder for figures and slides)\n- `README.md` (this readme)\n\n## Getting Started\n\n1. Install necessary dependencies\n\n    Python 3.10.8\n\n    ```\n    matplotlib==3.6.2\n    scikit-learn==1.2.0\n    torch==1.13.0\n    tqdm==4.64.1\n    ```\n\n    For most experiments, you only need to install the **above four** libraries. \n\n    Some (not all) baselines may also require the following libraries:\n\n    - `torch-geometric==2.2.0` (visit [this repo](https://github.com/pyg-team/pytorch_geometric) to install the library)\n      - It is required by GraphNO. If you do no run this baseline, you can ignore this library.\n    - `sympy==1.11.1`\n      - It is required by MWNO. If you do no run this baseline, you can ignore this library.\n\n2. Download datasets\n\n    For **2D Elasticity**, we refer to [this drive](https://drive.google.com/drive/folders/1cznHmQO-hB_VlWOfh7IFpjsPVOYyghGJ).\n\n    Download all the files in folders `Interp`, `Meshes`, `Omesh`, and `Rmesh`. Then put them into the folder `data/elasticity` in *this* repo (**directly move** **`.npy`** **files** but not persevering the original folder structure).\n\n    For **(2+1)D Channel Flow** and **3D Heatsink**, we refer to [this drive](https://1drv.ms/u/s!ApNDtoKtGVC6k6AK3AYprkxiZW0qWA?e=7De5vc).\n\n    Download all the files in `NUNO/ChannelFlow` and `NUNO/Heatsink`, then put them into `data/channel` and `data/heatsink` in *this* repo, respectively (again, **directly move `.npy` files** but not persevering the original folder structure).\n\n3. Run experiments\n    ```bash\n    # In the root directory of this repository\n    \n    # To run baselines for 2D Elasticity\n    python -m src.elasticity.ours_nufno\n    # or one of other baselines...\n    # The file name (in src/elasticity) should be able to represent the baseline method corresponding to the script.\n    python -m src.elasticity.geofno\n    \n    # To run scripts in (2+1)D Channel Flow\n    python -m src.channel.ours_nufno\n    # or one of other baselines...\n    \n    # To run scripts in 3D Heatsink\n    python -m src.heatsink.ours_nufno\n    # or one of other baselines...\n    ```\n\n## Experimental Results\n\n### 2D Elasticity\n\n![](assets/1.png)\n\n![](assets/2.png)\n\n### (2+1)D Channel Flow\n\n![](assets/3.png)\n\nNote: \"oversampling ratio\" is a measure for the mesh size.\n\n![](assets/4.png)\n\n\u003cimg src=\"assets/5.png\" style=\"zoom:70%;\" /\u003e\n\n### 3D Heatsink\n\n![](assets/6.png)\n\n\u003cimg src=\"assets/7.png\" style=\"zoom:75%;\" /\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthu-ml%2Fnuno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthu-ml%2Fnuno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthu-ml%2Fnuno/lists"}