Spatial-temporal Fourier Transformer
Project description
StFT
Spatio-temporal Fourier Transformer for Long-term Dynamics Prediction
Overview
StFT is a multi-scale spatiotemporal forecasting model for long-horizon dynamics prediction.
This repository provides training code for plasma MHD data and core model components.
Repository Structure
train.py— training entrypointStFT_3D.py— StFT model definitiondata_utils.py— dataset/loss/grid utilitiesmodel_utils.py— Transformer layers and positional embeddings
Installation
git clone https://github.com/BerkeleyLab/StFT.git
cd StFT
Install dependencies:
pip install -r requirements.txt
GPU note: On CUDA systems, install a CUDA-compatible PyTorch build first using the official PyTorch instructions.
Training StFT
To train StFT on the plasma MHD dataset:
python train.py
By default, the results will be saved to the ~/ray_results at home directory.
To customize the saved directory, you can change the save_path variable in the train.py file.
Example Results
Mean relative L2 error across autoregressive rollout timesteps.
Qualitative long-horizon error comparison across autoregressive baselines.
References
@article{stft2026,
title={St{FT}: Spatio-temporal Fourier Transformer for Long-term Dynamics Prediction},
author={Long, Da and Zhe, Shandian and Williams, Samuel and Oliker, Leonid and Bai, Zhe},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2026},
url={https://openreview.net/forum?id=o9Cb0ri2oW},
}
See the LICENSE file for copyright and licensing information.
- Copyright Notice -
Spatio-temporal Fourier Transformer for Long-term Dynamics Prediction (StFT) Copyright (c) 2025, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Intellectual Property Office at IPO@lbl.gov.
NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.
Questions? Contact Zhe Bai (zhebai@lbl.gov)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stft_transformer-0.1.8.tar.gz.
File metadata
- Download URL: stft_transformer-0.1.8.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
187d0ade836e6640b37026affaf385c0db657f83fb8b58370d280432014833d7
|
|
| MD5 |
3004d1f38a64ef1d9254d3658fe8b458
|
|
| BLAKE2b-256 |
9fb162134b1f552819bd1e750ed47e370fb05249f94ad07e8c311afde8edc143
|
Provenance
The following attestation bundles were made for stft_transformer-0.1.8.tar.gz:
Publisher:
publish.yml on BerkeleyLab/StFT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stft_transformer-0.1.8.tar.gz -
Subject digest:
187d0ade836e6640b37026affaf385c0db657f83fb8b58370d280432014833d7 - Sigstore transparency entry: 1806645723
- Sigstore integration time:
-
Permalink:
BerkeleyLab/StFT@017e9d6f981d088cea06d0752bd7d16e61bfcbe5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BerkeleyLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@017e9d6f981d088cea06d0752bd7d16e61bfcbe5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stft_transformer-0.1.8-py3-none-any.whl.
File metadata
- Download URL: stft_transformer-0.1.8-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a115db656c4f4149ed9204f4a98ec92ba6d086f67aa75d49ee150b3bc4b116c
|
|
| MD5 |
1978e49f473f4cca4c23fc506a454546
|
|
| BLAKE2b-256 |
83c86165d82845a483caa06589b80cda2769b60ab3f2c09272da5f965d68cc26
|
Provenance
The following attestation bundles were made for stft_transformer-0.1.8-py3-none-any.whl:
Publisher:
publish.yml on BerkeleyLab/StFT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stft_transformer-0.1.8-py3-none-any.whl -
Subject digest:
9a115db656c4f4149ed9204f4a98ec92ba6d086f67aa75d49ee150b3bc4b116c - Sigstore transparency entry: 1806645747
- Sigstore integration time:
-
Permalink:
BerkeleyLab/StFT@017e9d6f981d088cea06d0752bd7d16e61bfcbe5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BerkeleyLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@017e9d6f981d088cea06d0752bd7d16e61bfcbe5 -
Trigger Event:
workflow_dispatch
-
Statement type: