{"id":44419549,"url":"https://github.com/alasdairtran/fourierflow","last_synced_at":"2026-02-12T09:12:01.576Z","repository":{"id":51025625,"uuid":"328846095","full_name":"alasdairtran/fourierflow","owner":"alasdairtran","description":"[ICLR 2023] Factorized Fourier Neural Operators","archived":false,"fork":false,"pushed_at":"2023-10-13T00:34:49.000Z","size":5281,"stargazers_count":187,"open_issues_count":2,"forks_count":23,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-01-26T18:38:22.795Z","etag":null,"topics":["fourier-transform","navier-stokes","pytorch","simulation"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2111.13802","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/alasdairtran.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}},"created_at":"2021-01-12T02:11:26.000Z","updated_at":"2026-01-26T04:44:47.000Z","dependencies_parsed_at":"2023-01-23T13:45:19.740Z","dependency_job_id":null,"html_url":"https://github.com/alasdairtran/fourierflow","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alasdairtran/fourierflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alasdairtran%2Ffourierflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alasdairtran%2Ffourierflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alasdairtran%2Ffourierflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alasdairtran%2Ffourierflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alasdairtran","download_url":"https://codeload.github.com/alasdairtran/fourierflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alasdairtran%2Ffourierflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29362297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fourier-transform","navier-stokes","pytorch","simulation"],"created_at":"2026-02-12T09:12:00.359Z","updated_at":"2026-02-12T09:12:01.569Z","avatar_url":"https://github.com/alasdairtran.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Teaser](https://raw.githubusercontent.com/alasdairtran/fourierflow/main/figures/poster.png)\n\n# Factorized Fourier Neural Operators\n\nThis repository contains the code to reproduce the results in our [ICLR\n2023](https://iclr.cc/Conferences/2023) paper, [Factorized Fourier Neural\nOperators](https://arxiv.org/abs/2111.13802).\n\nWe propose the Factorized Fourier Neural Operator (F-FNO), a learning-based\napproach for simulating partial differential equations (PDEs). Starting from a\nrecently proposed Fourier representation of flow fields, the F-FNO bridges the\nperformance gap between pure machine learning approaches to that of the best\nnumerical or hybrid solvers. This is achieved with new representations –\nseparable spectral layers and improved residual connections – and a combination\nof training strategies such as the Markov assumption, Gaussian noise, and\ncosine learning rate decay. On several challenging benchmark PDEs on regular\ngrids, structured meshes, and point clouds, the F-FNO can scale to deeper\nnetworks and outperform both the FNO and the geo-FNO, reducing the error by 83%\non the Navier-Stokes problem, 31% on the elasticity problem, 57% on the airfoil\nflow problem, and 60% on the plastic forging problem. Compared to the\nstate-of-the-art pseudo-spectral method, the F-FNO can take a step size that is\nan order of magnitude larger in time and achieve an order of magnitude speedup\nto produce the same solution quality.\n\nPlease cite with the following BibTeX:\n\n```raw\n@inproceedings{tran2023factorized,\n  title     = {Factorized Fourier Neural Operators},\n  author    = {Alasdair Tran and Alexander Mathews and Lexing Xie and Cheng Soon Ong},\n  booktitle = {The Eleventh International Conference on Learning Representations},\n  year      = {2023},\n  url       = {https://openreview.net/forum?id=tmIiMPl4IPa}\n}\n```\n\n## Getting Started\n\n```sh\n# If you'd like to reproduce the exact numbers in our ML4PS workshop paper,\n# checkout v0.2.0 to use the same seeds and package versions.\ngit checkout v0.2.0\n\n# Otherwise we can use latest Python and Pytorch versions.\n# Set up pyenv and pin python version to 3.9.9\ncurl https://pyenv.run | bash\n# Configure our shell's environment for pyenv\npyenv install 3.10.7\npyenv local 3.10.7\ncurl -sSL https://install.python-poetry.org | python3 - --version 1.2.0b3\n\n# Install all python dependencies\npoetry install\nsource .venv/bin/activate # or: poetry shell\n# If we need to use Jupyter notebooks\npython -m ipykernel install --user --name fourierflow --display-name \"fourierflow\"\n\n# set default paths\ncp example.env .env\n# The environment variables in .env will be loaded automatically when running\n# fourierflow train, but we can also load them manually in our terminal\nexport $(cat .env | xargs)\n\n# Alternatively, you can pass the paths to the system using env vars, e.g.\nDATA_ROOT=/My/Data/Location fourierflow train ...\n```\n\n## Navier Stokes Experiments\n\nYou can download all of our datasets and pretrained model as follows:\n\n```sh\n# Datasets (209GB)\nwget --continue https://object-store.rc.nectar.org.au/v1/AUTH_c0e4d64401cf433fb0260d211c3f23f8/fourierflow/data-2021-12-24.tar.gz\ntar -zxvf data-2021-12-24.tar.gz\n\n# Pretrained models and results (30GB)\nwget --continue https://object-store.rc.nectar.org.au/v1/AUTH_c0e4d64401cf433fb0260d211c3f23f8/fourierflow/experiments-2021-12-24.tar.gz\ntar -zxvf experiments-2021-12-24.tar.gz\n```\n\nAlternatively, you can also generate the datasets from scratch:\n\n```sh\n# Download Navier Stokes datasets\nfourierflow download fno\n\n# Generate Navier Stokes on toruses with a different forcing function and\n# viscosity for each sample. Takes 14 hours.\nfourierflow generate navier-stokes --force random --cycles 2 --mu-min 1e-5 \\\n    --mu-max 1e-4 --steps 200 --delta 1e-4 \\\n    data/torus/torus_vis.h5\n\n# Generate Navier Stokes on toruses with a different time-varying forcing\n# function and a different viscosity for each sample. Takes 21 hours.\nfourierflow generate navier-stokes --force random --cycles 2 --mu-min 1e-5 \\\n    --mu-max 1e-4 --steps 200 --delta 1e-4 --varying-force \\\n    data/torus/torus_vis_force.h5\n\n# If we decrease delta from 1e-4 to 1e-5, generating the same dataset would now\n# take 10 times as long, while the difference between the solutions in step 20\n# is only 0.04%.\n\n# Generate initial conditions for 2D Kolmogorov flows (Kochkov et al, 2021).\nfourierflow generate kolmogorov data/kolmogorov/re_1000/initial_conditions/train.yaml # 22 GPU hours\nfourierflow generate kolmogorov data/kolmogorov/re_1000/initial_conditions/valid.yaml # 3 GPU hours\nfourierflow generate kolmogorov data/kolmogorov/re_1000/initial_conditions/test.yaml # 22 GPU hours\n\n# Run baseline simulations with the numerical solver (no ML).\nfourierflow generate kolmogorov data/kolmogorov/re_1000/baseline/32.yaml # 1 GPU min\nfourierflow generate kolmogorov data/kolmogorov/re_1000/baseline/64.yaml # 2 GPU mins\nfourierflow generate kolmogorov data/kolmogorov/re_1000/baseline/128.yaml # 3 GPU mins\nfourierflow generate kolmogorov data/kolmogorov/re_1000/baseline/256.yaml # 6 GPU mins\nfourierflow generate kolmogorov data/kolmogorov/re_1000/baseline/512.yaml # 20 GPU mins\nfourierflow generate kolmogorov data/kolmogorov/re_1000/baseline/1024.yaml # 2 GPU hours\n\n# Generating training data for ML models.\nfourierflow generate kolmogorov data/kolmogorov/re_1000/trajectories/train.yaml # 19 GPU hours\nfourierflow generate kolmogorov data/kolmogorov/re_1000/trajectories/valid.yaml # 2 GPU hours\nfourierflow generate kolmogorov data/kolmogorov/re_1000/trajectories/test.yaml # 19 GPU hours\n```\n\nTraining and test commands:\n\n```sh\n# Reproducing SOA model on Navier Stokes from Li et al (2021).\nfourierflow train --trial 0 experiments/torus_li/zongyi/4_layers/config.yaml\n\n# Train with our best model\nfourierflow train --trial 0 experiments/torus_li/markov/24_layers/config.yaml\n\n# Get inference time on test set\nfourierflow predict --trial 0 experiments/torus_li/markov/24_layers/config.yaml\n```\n\nVisualization commands:\n\n```sh\n# Some example commands to create plots and tables for paper\nfourierflow plot torus-li-performance\nfourierflow plot complexity\nfourierflow plot table-torus-li\nfourierflow plot table-airfoil\nfourierflow plot table-elasticity\nfourierflow plot table-plasticity\n\n# Create the flow animation for presentation\nfourierflow plot flow\n\n# Create plots for the poster\nfourierflow plot poster\n\n# Create plots related to comparison with 2D Kolmogorov flows (Kochkov et al, 2021).\nfourierflow plot correlation\n```\n\n## Experiments with JAX-CFD\n\n```sh\n# Download jax-cfd datasets\ngsutil -m cp -r gs://gresearch/jax-cfd data/\n```\n\n## Plots\n\n```sh\n# Plot effect of coordinates and velocity as input channels (Figure 5b)\nfourierflow plot coordinates-velocity-ablation\n```\n\n## Geo-FNO experiments\n\n```sh\n# Download the Geo-FNO datasets\nfourierflow download geo-fno\n\n# Reproducing SOA model from Li et al (2022).\nfourierflow train --trial 0 experiments/airfoil/geo-fno/4_layers/config.yaml\nfourierflow train --trial 0 experiments/plasticity/geo-fno/4_layers/config.yaml\nfourierflow train --trial 0 experiments/elasticity/geo-fno/4_layers/config.yaml\n\n# Train with our best model\nfourierflow train --trial 0 experiments/airfoil/ffno/24_layers/config.yaml\nfourierflow train --trial 0 experiments/plasticity/ffno/24_layers/config.yaml\nfourierflow train --trial 0 experiments/elasticity/ffno/24_layers/config.yaml\n\n# Plot samples\nfourierflow sample experiments/elasticity/geo-fno/4_layers/config.yaml\nfourierflow sample experiments/elasticity/ffno/24_layers/config.yaml\n\nfourierflow sample experiments/elasticity/ffno/24_layers/config.yaml\n```\n\n\u003c!-- ## Mesh Experiments\n\n```sh\n# DeepMind meshgraphnets simulation data\nfourierflow download meshgraphnets\n# Convert cylinder-flow data from TFRecords to HDF5 format.\nfourierflow convert cylinder-flow --data-dir data/meshgraphnets/cylinder_flow --out data/meshgraphnets/cylinder_flow/cylinder_flow.h5\n``` --\u003e\n\n## Acknowledgement\n\nOur model is based on the code of the original author of the Fourier Neural\nOperators paper:\n\n* https://github.com/zongyi-li/fourier_neural_operator\n* https://github.com/zongyi-li/Geo-FNO\n\nJAX-based models are adapted from JAX-CFD: https://github.com/google/jax-cfd\n\nMesh-based simulations are based on meshgraphnets: https://github.com/deepmind/deepmind-research/tree/master/meshgraphnets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falasdairtran%2Ffourierflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falasdairtran%2Ffourierflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falasdairtran%2Ffourierflow/lists"}