PyTorch training code for Flareformer.
- Python >= 3.8.10
- CUDA >= 11.1
- PyTorch >= 1.8.2
git clone git@github.com:keio-smilab22/Flareformer.git
cd Flareformer
pip install -r requirements.txt
- The required data files should be put under
data/
folder. - Visit http://wdc.nict.go.jp/IONO/wdc/solarflare/index.html and download the database of physical features.
$ cd ~/work/flare_transformer
$ mv ~/data.zip data/
$ unzip data/data.zip
- Visit https://sdo.gsfc.nasa.gov/data/ and download hourly magnetograms.
$ mv ~/magnetogram_images.tar.gz data/
$ tar -zxvf data/magnetogram_images.tar.gz
-
Preprocess the physical features and magnetogram images by the following procedure (parallel processing).
python preprocess/main.py --magnetogram --physical --label --window
-
The following data files should be created under
data/
.- data/data_20XX_magnetogram_256.npy
- data/data_20XX_feat.csv
- data/data_20XX_label.csv
- data/data_20XX_window_48.csv
-
To train Flareformer with warmup and cRT using
params/params_2014.json
:python main.py --params params/params_2014.json --warmup_epochs=5 --imbalance --wandb
Flareformer is released under the BSD-3-Clause-Clear license. Please see the LICENSE file for more information.
-
The figure below shows line-of-sight magnetograms from September 3th, 2017 23:00 UT to September 5th, 2017, 23:00 UT. An X-class solar flare occurred at 12:02 on September 6, 2017, and the model was able to predict the correct maximum solar flare class.
Hardware
- Ubuntu 20.04LTS
- GPU: GeForce RTX 3080 laptop
- GPU RAM: 16GB GDDR6
- CPU: Core i9 11980HK
- RAM: 64 GB Libraries
- CUDA 11.1