From dcbbefa42af823fc10fc57a06eab26c270616ef9 Mon Sep 17 00:00:00 2001 From: Qiao Zhongzheng Date: Thu, 14 Nov 2024 15:25:54 +0800 Subject: [PATCH] Add PF and multi-scale RoPE --- README.md | 8 +- .../lsf/eval/data/etth1_test.yaml | 0 .../lsf/eval/data/etth1_val.yaml | 0 .../lsf/eval/data/gluonts_test.yaml | 0 .../lsf/eval/data/gluonts_val.yaml | 0 .../lsf/eval/data/lsf_test.yaml | 0 .../lsf/eval/data/lsf_val.yaml | 0 .../{ => lsf-setup}/lsf/eval/data/monash.yaml | 0 .../{ => lsf-setup}/lsf/eval/default.yaml | 2 +- .../lsf/eval/model/moirai_1.0_R_base.yaml | 0 .../lsf/eval/model/moirai_1.0_R_large.yaml | 0 .../lsf/eval/model/moirai_1.0_R_small.yaml | 0 .../lsf/eval/model/moirai_1.1_R_base.yaml | 0 .../lsf/eval/model/moirai_1.1_R_large.yaml | 0 .../lsf/eval/model/moirai_1.1_R_small.yaml | 0 .../lsf/eval/model/moirai_lightning_ckpt.yaml | 0 .../lsf/finetune/data/electricity.yaml | 0 .../lsf/finetune/data/etth1.yaml | 0 .../lsf/finetune/data/etth2.yaml | 0 .../lsf/finetune/data/ettm1.yaml | 0 .../lsf/finetune/data/ettm2.yaml | 0 .../lsf/finetune/data/weather.yaml | 0 .../{ => lsf-setup}/lsf/finetune/default.yaml | 2 +- .../finetune/model/moirai_1.1_R_small.yaml | 0 .../lsf/finetune/val_data/electricity.yaml | 0 .../lsf/finetune/val_data/etth1.yaml | 0 .../lsf/finetune/val_data/etth2.yaml | 0 .../lsf/finetune/val_data/ettm1.yaml | 0 .../lsf/finetune/val_data/ettm2.yaml | 0 .../lsf/finetune/val_data/weather.yaml | 0 .../lsf_point/eval/data/etth1_test.yaml | 0 .../lsf_point/eval/data/etth1_val.yaml | 0 .../lsf_point/eval/data/gluonts_test.yaml | 0 .../lsf_point/eval/data/gluonts_val.yaml | 0 .../lsf_point/eval/data/lsf_test.yaml | 0 .../lsf_point/eval/data/lsf_val.yaml | 0 .../lsf_point/eval/data/monash.yaml | 0 .../lsf_point}/eval/default.yaml | 2 +- .../eval/model/moirai_1.0_R_base.yaml | 0 .../eval/model/moirai_1.0_R_large.yaml | 0 .../eval/model/moirai_1.0_R_small.yaml | 0 .../eval/model/moirai_1.1_R_base.yaml | 0 .../eval/model/moirai_1.1_R_large.yaml | 0 .../eval/model/moirai_1.1_R_small.yaml | 0 .../eval/model/moirai_lightning_ckpt.yaml | 0 .../lsf_point/finetune/data/electricity.yaml | 0 .../lsf_point/finetune/data/etth1.yaml | 0 .../lsf_point/finetune/data/etth2.yaml | 0 .../lsf_point/finetune/data/ettm1.yaml | 0 .../lsf_point/finetune/data/ettm2.yaml | 0 .../lsf_point/finetune/data/weather.yaml | 0 .../lsf_point/finetune/default.yaml | 2 +- .../finetune/model/moirai_1.1_R_small.yaml | 0 .../finetune/val_data/electricity.yaml | 0 .../lsf_point/finetune/val_data/etth1.yaml | 0 .../lsf_point/finetune/val_data/etth2.yaml | 0 .../lsf_point/finetune/val_data/ettm1.yaml | 0 .../lsf_point/finetune/val_data/ettm2.yaml | 0 .../lsf_point/finetune/val_data/weather.yaml | 0 .../multi_scale/eval/data/etth1_test.yaml | 0 .../multi_scale/eval/data/etth1_val.yaml | 0 .../multi_scale/eval/data/gluonts_test.yaml | 0 .../multi_scale/eval/data/gluonts_val.yaml | 0 .../multi_scale/eval/data/lsf_test.yaml | 0 .../multi_scale/eval/data/lsf_val.yaml | 0 .../multi_scale/eval/data/monash.yaml | 0 .../lsf-setup/multi_scale/eval/default.yaml | 24 + .../eval/model/moirai_1.1_R_small.yaml | 0 .../eval/model/moirai_lightning_ckpt.yaml | 0 .../finetune/data/electricity.yaml | 0 .../multi_scale/finetune/data/etth1.yaml | 0 .../multi_scale/finetune/data/etth2.yaml | 0 .../multi_scale/finetune/data/ettm1.yaml | 0 .../multi_scale/finetune/data/ettm2.yaml | 0 .../multi_scale/finetune/data/weather.yaml | 0 .../multi_scale/finetune/default.yaml | 2 +- .../finetune/model/moirai_1.1_R_small.yaml | 0 .../finetune/val_data/electricity.yaml | 0 .../multi_scale/finetune/val_data/etth1.yaml | 0 .../multi_scale/finetune/val_data/etth2.yaml | 0 .../multi_scale/finetune/val_data/ettm1.yaml | 0 .../multi_scale/finetune/val_data/ettm2.yaml | 0 .../finetune/val_data/weather.yaml | 0 .../origin/eval/data/etth1_test.yaml | 0 .../origin/eval/data/etth1_val.yaml | 0 .../origin/eval/data/gluonts_test.yaml | 0 .../origin/eval/data/gluonts_val.yaml | 0 .../origin/eval/data/lsf_test.yaml | 0 .../origin/eval/data/lsf_val.yaml | 0 .../origin/eval/data/monash.yaml | 0 .../origin}/eval/default.yaml | 2 +- .../origin/eval/model/moirai_1.0_R_base.yaml | 0 .../origin/eval/model/moirai_1.0_R_large.yaml | 0 .../origin/eval/model/moirai_1.0_R_small.yaml | 0 .../origin/eval/model/moirai_1.1_R_base.yaml | 0 .../origin/eval/model/moirai_1.1_R_large.yaml | 0 .../origin/eval/model/moirai_1.1_R_small.yaml | 0 .../eval/model/moirai_lightning_ckpt.yaml | 0 .../origin/finetune/data/electricity.yaml | 0 .../origin/finetune/data/etth1.yaml | 0 .../origin/finetune/data/etth2.yaml | 0 .../origin/finetune/data/ettm1.yaml | 0 .../origin/finetune/data/ettm2.yaml | 0 .../origin/finetune/data/weather.yaml | 0 .../lsf-setup/origin/finetune/default.yaml | 86 ++++ .../finetune/model/moirai_1.0_R_base.yaml | 0 .../finetune/model/moirai_1.0_R_large.yaml | 0 .../finetune/model/moirai_1.0_R_small.yaml | 0 .../finetune/model/moirai_1.1_R_base.yaml | 0 .../finetune/model/moirai_1.1_R_large.yaml | 0 .../finetune/model/moirai_1.1_R_small.yaml | 0 .../origin/finetune/model/moirai_base.yaml | 0 .../origin/finetune/model/moirai_large.yaml | 0 .../origin/finetune/model/moirai_small.yaml | 0 .../origin/finetune/val_data/electricity.yaml | 0 .../origin/finetune/val_data/etth1.yaml | 0 .../origin/finetune/val_data/etth2.yaml | 0 .../origin/finetune/val_data/ettm1.yaml | 0 .../origin/finetune/val_data/ettm2.yaml | 0 .../origin/finetune/val_data/weather.yaml | 0 .../seasonal_naive/eval/data/etth1_test.yaml | 0 .../seasonal_naive/eval/data/etth1_val.yaml | 0 .../eval/data/gluonts_test.yaml | 0 .../seasonal_naive/eval/data/gluonts_val.yaml | 0 .../seasonal_naive/eval/data/lsf_test.yaml | 0 .../seasonal_naive/eval/data/lsf_val.yaml | 0 .../seasonal_naive/eval/data/monash.yaml | 0 .../seasonal_naive/eval/default.yaml | 24 + .../eval/model/moirai_1.1_R_small.yaml | 0 .../eval/model/moirai_lightning_ckpt.yaml | 0 .../finetune/data/electricity.yaml | 0 .../seasonal_naive/finetune/data/etth1.yaml | 0 .../seasonal_naive/finetune/data/etth2.yaml | 0 .../seasonal_naive/finetune/data/ettm1.yaml | 0 .../seasonal_naive/finetune/data/ettm2.yaml | 0 .../seasonal_naive/finetune/data/weather.yaml | 0 .../seasonal_naive/finetune/default.yaml | 2 +- .../finetune/model/moirai_1.1_R_small.yaml | 0 .../finetune/val_data/electricity.yaml | 0 .../finetune/val_data/etth1.yaml | 0 .../finetune/val_data/etth1_multi.yaml | 0 .../finetune/val_data/etth2.yaml | 0 .../finetune/val_data/ettm1.yaml | 0 .../finetune/val_data/ettm2.yaml | 0 .../finetune/val_data/weather.yaml | 0 .../origin/eval/data/gluonts_test.yaml | 4 + .../origin/eval/data/gluonts_val.yaml | 4 + .../origin}/eval/default.yaml | 2 +- .../origin/eval/model/moirai_1.0_R_base.yaml | 7 + .../origin/eval/model/moirai_1.0_R_large.yaml | 7 + .../origin/eval/model/moirai_1.0_R_small.yaml | 7 + .../origin/eval/model/moirai_1.1_R_base.yaml | 7 + .../origin/eval/model/moirai_1.1_R_large.yaml | 7 + .../origin/eval/model/moirai_1.1_R_small.yaml | 7 + .../eval/model/moirai_lightning_ckpt.yaml | 6 + .../origin/finetune/data/electricity.yaml | 2 + .../pf-setup/origin/finetune/data/etth1.yaml | 2 + .../pf-setup/origin/finetune/data/etth2.yaml | 2 + .../pf-setup/origin/finetune/data/ettm1.yaml | 2 + .../pf-setup/origin/finetune/data/ettm2.yaml | 2 + .../origin/finetune/data/weather.yaml | 2 + .../origin/finetune/default.yaml | 0 .../finetune/model/moirai_1.0_R_base.yaml | 33 ++ .../finetune/model/moirai_1.0_R_large.yaml | 33 ++ .../finetune/model/moirai_1.0_R_small.yaml | 37 ++ .../finetune/model/moirai_1.1_R_base.yaml | 33 ++ .../finetune/model/moirai_1.1_R_large.yaml | 33 ++ .../finetune/model/moirai_1.1_R_small.yaml | 41 ++ .../origin/finetune/model/moirai_base.yaml | 31 ++ .../origin/finetune/model/moirai_large.yaml | 31 ++ .../origin/finetune/model/moirai_small.yaml | 35 ++ .../origin/finetune/val_data/electricity.yaml | 13 + .../origin/finetune/val_data/etth1.yaml | 9 + .../origin/finetune/val_data/etth2.yaml | 13 + .../origin/finetune/val_data/ettm1.yaml | 14 + .../origin/finetune/val_data/ettm2.yaml | 14 + .../origin/finetune/val_data/weather.yaml | 9 + .../pf-setup/pf/eval/data/gluonts_test.yaml | 4 + .../pf-setup/pf/eval/data/gluonts_val.yaml | 4 + .../pf}/eval/default.yaml | 4 +- .../pf/eval/model/moirai_1.0_R_base.yaml | 7 + .../pf/eval/model/moirai_1.0_R_large.yaml | 7 + .../pf/eval/model/moirai_1.0_R_small.yaml | 7 + .../pf/eval/model/moirai_1.1_R_base.yaml | 7 + .../pf/eval/model/moirai_1.1_R_large.yaml | 7 + .../pf/eval/model/moirai_1.1_R_small.yaml | 7 + .../pf/eval/model/moirai_lightning_ckpt.yaml | 6 + .../pf/finetune/data/bizitobs_l2c.yaml | 6 + .../pf/finetune/data/electricity.yaml | 6 + .../pf/finetune/data/istanbul_traffic.yaml | 6 + .../pf/finetune/data/jena_weather.yaml | 6 + .../pf/finetune/data/solar-energy.yaml | 6 + .../pf/finetune/data/turkey_power.yaml | 6 + cli/conf/pf-setup/pf/finetune/default.yaml | 77 +++ .../pf/finetune/model/moirai_1.1_R_small.yaml | 41 ++ .../pf/finetune/val_data/bizitobs_l2c.yaml | 7 + .../pf/finetune/val_data/electricity.yaml | 7 + .../finetune/val_data/istanbul_traffic.yaml | 7 + .../pf/finetune/val_data/jena_weather.yaml | 7 + .../pf/finetune/val_data/solar-energy.yaml | 7 + .../pf/finetune/val_data/turkey_power.yaml | 7 + cli/eval.py | 2 +- .../{ => lsf-setup}/build_lsf_ft_datasets.sh | 0 .../lsf/eval/small/electricity.sh | 6 +- .../{ => lsf-setup}/lsf/eval/small/etth1.sh | 6 +- .../{ => lsf-setup}/lsf/eval/small/etth2.sh | 6 +- .../{ => lsf-setup}/lsf/eval/small/ettm1.sh | 8 +- .../lsf}/eval/small/ettm2.sh | 14 +- .../lsf/eval/small/run_multi.sh | 0 .../{ => lsf-setup}/lsf/eval/small/weather.sh | 6 +- .../lsf}/finetune/small/electricity.sh | 2 +- .../lsf/finetune/small/etth1.sh | 2 +- .../lsf/finetune/small/etth2.sh | 2 +- .../lsf/finetune/small/ettm1.sh | 4 +- .../lsf/finetune/small/ettm2.sh | 4 +- .../lsf/finetune/small/run_multi.sh | 0 .../lsf/finetune/small/weather.sh | 2 +- .../lsf_point/eval/small/electricity.sh | 6 +- .../lsf_point/eval/small/etth1.sh | 6 +- .../lsf_point/eval/small/etth2.sh | 6 +- .../lsf-setup/lsf_point/eval/small/ettm1.sh | 45 ++ .../lsf-setup/lsf_point/eval/small/ettm2.sh | 45 ++ .../lsf_point/eval/small/run_multi.sh | 0 .../lsf_point/eval/small/weather.sh | 6 +- .../lsf_point/finetune/small/electricity.sh | 2 +- .../lsf_point/finetune/small/etth1.sh | 2 +- .../lsf_point/finetune/small/etth2.sh | 2 +- .../lsf_point/finetune/small/ettm1.sh | 4 +- .../lsf_point/finetune/small/ettm2.sh | 6 +- .../lsf_point/finetune/small/run_multi.sh | 0 .../lsf_point/finetune/small/weather.sh | 2 +- .../multi_scale/eval/small/electricity.sh | 6 +- .../multi_scale/eval/small/etth1.sh | 6 +- .../multi_scale/eval/small/etth2.sh | 6 +- .../multi_scale/eval/small/ettm1.sh | 14 +- .../multi_scale/eval/small/ettm2.sh | 14 +- .../multi_scale/eval/small/run_multi.sh | 0 .../multi_scale/eval/small/weather.sh | 6 +- .../finetune/small/electricity.sh | 2 +- .../multi_scale/finetune/small/etth1.sh | 2 +- .../multi_scale/finetune/small/etth2.sh | 2 +- .../multi_scale/finetune/small/ettm1.sh | 6 +- .../multi_scale/finetune/small/ettm2.sh | 4 +- .../multi_scale/finetune/small/run_multi.sh | 0 .../multi_scale/finetune/small/weather.sh | 2 +- .../multi_scale/zero_shot/lsf_small.sh | 2 +- .../origin/eval/small/electricity.sh | 6 +- .../origin/eval/small/etth1.sh | 6 +- .../origin/eval/small/etth2.sh | 6 +- .../origin/eval/small/ettm1.sh | 6 +- .../origin/eval/small/ettm2.sh | 6 +- .../origin/eval/small/run_multi.sh | 0 .../origin/eval/small/weather.sh | 6 +- .../origin/finetune/small/electricity.sh | 2 +- .../origin/finetune/small/etth1.sh | 2 +- .../origin/finetune/small/etth2.sh | 2 +- .../origin/finetune/small/ettm1.sh | 2 +- .../origin/finetune/small/ettm2.sh | 2 +- .../origin/finetune/small/run_multi.sh | 0 .../origin/finetune/small/weather.sh | 2 +- .../origin/obtain_moirai_ckpt.py | 0 .../origin/zero_shot/lsf_small.sh | 4 +- .../seasonal_naive/eval/small/electricity.sh | 6 +- .../seasonal_naive/eval/small/etth1.sh | 6 +- .../seasonal_naive/eval/small/etth2.sh | 6 +- .../seasonal_naive/eval/small/ettm1.sh | 6 +- .../seasonal_naive/eval/small/ettm2.sh | 6 +- .../seasonal_naive/eval/small/run_multi.sh | 0 .../seasonal_naive/eval/small/weather.sh | 6 +- .../finetune/small/electricity.sh | 2 +- .../seasonal_naive/finetune/small/etth1.sh | 2 +- .../seasonal_naive/finetune/small/etth2.sh | 2 +- .../seasonal_naive/finetune/small/ettm1.sh | 2 +- .../seasonal_naive/finetune/small/ettm2.sh | 2 +- .../finetune/small/run_multi.sh | 0 .../seasonal_naive/finetune/small/weather.sh | 2 +- project/lsf/eval/small/ettm2.sh | 45 -- project/lsf_point/eval/small/ettm1.sh | 45 -- project/pf-setup/build_pf_ft_datasets.sh | 49 ++ project/pf-setup/origin/zero_shot/pf_small.sh | 64 +++ project/pf-setup/pf/eval/small/electricity.sh | 29 ++ .../pf/eval/small/istanbul_traffic.sh | 29 ++ .../pf-setup/pf/eval/small/jena_weather.sh | 29 ++ .../pf-setup/pf/eval/small/solar-energy.sh | 29 ++ .../pf-setup/pf/eval/small/turkey_power.sh | 29 ++ .../pf-setup/pf/finetune/small/electricity.sh | 32 ++ .../pf/finetune/small/istanbul_traffic.sh | 31 ++ .../pf/finetune/small/jena_weather.sh | 31 ++ .../pf/finetune/small/solar-energy.sh | 31 ++ .../pf/finetune/small/turkey_power.sh | 33 ++ src/uni2ts/data/builder/pf_simple.py | 479 ++++++++++++++++++ src/uni2ts/data/builder/simple.py | 12 +- src/uni2ts/model/lsf_moirai/finetune.py | 244 ++++++++- src/uni2ts/model/lsf_moirai_point/finetune.py | 1 + src/uni2ts/model/lsf_moirai_point/module.py | 68 ++- .../model/multi_scale_moirai/finetune.py | 48 +- .../model/multi_scale_moirai/forecast.py | 51 +- src/uni2ts/model/multi_scale_moirai/module.py | 58 +-- src/uni2ts/module/multi_scale/attention.py | 32 +- src/uni2ts/module/multi_scale/transformer.py | 2 +- src/uni2ts/module/position/__init__.py | 2 + src/uni2ts/module/position/attn_bias.py | 18 +- src/uni2ts/module/position/attn_projection.py | 101 +++- src/uni2ts/transform/multi_scale.py | 2 +- 304 files changed, 2499 insertions(+), 354 deletions(-) rename cli/conf/{ => lsf-setup}/lsf/eval/data/etth1_test.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/data/etth1_val.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/data/gluonts_test.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/data/gluonts_val.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/data/lsf_test.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/data/lsf_val.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/data/monash.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/default.yaml (79%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_1.0_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_1.0_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_1.0_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_1.1_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_1.1_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/eval/model/moirai_lightning_ckpt.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/default.yaml (93%) rename cli/conf/{ => lsf-setup}/lsf/finetune/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/val_data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/val_data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/val_data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/val_data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/val_data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf/finetune/val_data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/etth1_test.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/etth1_val.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/gluonts_test.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/gluonts_val.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/lsf_test.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/lsf_val.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/data/monash.yaml (100%) rename cli/conf/{origin => lsf-setup/lsf_point}/eval/default.yaml (79%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_1.0_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_1.0_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_1.0_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_1.1_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_1.1_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/eval/model/moirai_lightning_ckpt.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/default.yaml (93%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/val_data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/val_data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/val_data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/val_data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/val_data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/lsf_point/finetune/val_data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/etth1_test.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/etth1_val.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/gluonts_test.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/gluonts_val.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/lsf_test.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/lsf_val.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/data/monash.yaml (100%) create mode 100644 cli/conf/lsf-setup/multi_scale/eval/default.yaml rename cli/conf/{ => lsf-setup}/multi_scale/eval/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/eval/model/moirai_lightning_ckpt.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/default.yaml (92%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/val_data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/val_data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/val_data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/val_data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/val_data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/multi_scale/finetune/val_data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/etth1_test.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/etth1_val.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/gluonts_test.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/gluonts_val.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/lsf_test.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/lsf_val.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/data/monash.yaml (100%) rename cli/conf/{lsf_point => lsf-setup/origin}/eval/default.yaml (79%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_1.0_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_1.0_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_1.0_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_1.1_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_1.1_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/eval/model/moirai_lightning_ckpt.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/data/weather.yaml (100%) create mode 100644 cli/conf/lsf-setup/origin/finetune/default.yaml rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_1.0_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_1.0_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_1.0_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_1.1_R_base.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_1.1_R_large.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_base.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_large.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/model/moirai_small.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/val_data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/val_data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/val_data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/val_data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/val_data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/origin/finetune/val_data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/etth1_test.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/etth1_val.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/gluonts_test.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/gluonts_val.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/lsf_test.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/lsf_val.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/data/monash.yaml (100%) create mode 100644 cli/conf/lsf-setup/seasonal_naive/eval/default.yaml rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/eval/model/moirai_lightning_ckpt.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/data/weather.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/default.yaml (92%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/model/moirai_1.1_R_small.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/electricity.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/etth1.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/etth1_multi.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/etth2.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/ettm1.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/ettm2.yaml (100%) rename cli/conf/{ => lsf-setup}/seasonal_naive/finetune/val_data/weather.yaml (100%) create mode 100644 cli/conf/pf-setup/origin/eval/data/gluonts_test.yaml create mode 100644 cli/conf/pf-setup/origin/eval/data/gluonts_val.yaml rename cli/conf/{seasonal_naive => pf-setup/origin}/eval/default.yaml (79%) create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_base.yaml create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_large.yaml create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_small.yaml create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_base.yaml create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_large.yaml create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_small.yaml create mode 100644 cli/conf/pf-setup/origin/eval/model/moirai_lightning_ckpt.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/data/electricity.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/data/etth1.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/data/etth2.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/data/ettm1.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/data/ettm2.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/data/weather.yaml rename cli/conf/{ => pf-setup}/origin/finetune/default.yaml (100%) create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_base.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_large.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_small.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_base.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_large.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_small.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_base.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_large.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/model/moirai_small.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/val_data/electricity.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/val_data/etth1.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/val_data/etth2.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/val_data/ettm1.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/val_data/ettm2.yaml create mode 100644 cli/conf/pf-setup/origin/finetune/val_data/weather.yaml create mode 100644 cli/conf/pf-setup/pf/eval/data/gluonts_test.yaml create mode 100644 cli/conf/pf-setup/pf/eval/data/gluonts_val.yaml rename cli/conf/{multi_scale => pf-setup/pf}/eval/default.yaml (89%) create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_base.yaml create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_large.yaml create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_small.yaml create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_base.yaml create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_large.yaml create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_small.yaml create mode 100644 cli/conf/pf-setup/pf/eval/model/moirai_lightning_ckpt.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/data/bizitobs_l2c.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/data/electricity.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/data/istanbul_traffic.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/data/jena_weather.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/data/solar-energy.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/data/turkey_power.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/default.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/model/moirai_1.1_R_small.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/val_data/bizitobs_l2c.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/val_data/electricity.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/val_data/istanbul_traffic.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/val_data/jena_weather.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/val_data/solar-energy.yaml create mode 100644 cli/conf/pf-setup/pf/finetune/val_data/turkey_power.yaml rename project/{ => lsf-setup}/build_lsf_ft_datasets.sh (100%) rename project/{ => lsf-setup}/lsf/eval/small/electricity.sh (85%) rename project/{ => lsf-setup}/lsf/eval/small/etth1.sh (90%) rename project/{ => lsf-setup}/lsf/eval/small/etth2.sh (90%) rename project/{ => lsf-setup}/lsf/eval/small/ettm1.sh (88%) rename project/{lsf_point => lsf-setup/lsf}/eval/small/ettm2.sh (51%) rename project/{ => lsf-setup}/lsf/eval/small/run_multi.sh (100%) rename project/{ => lsf-setup}/lsf/eval/small/weather.sh (90%) rename project/{multi_scale => lsf-setup/lsf}/finetune/small/electricity.sh (95%) rename project/{ => lsf-setup}/lsf/finetune/small/etth1.sh (95%) rename project/{ => lsf-setup}/lsf/finetune/small/etth2.sh (95%) rename project/{ => lsf-setup}/lsf/finetune/small/ettm1.sh (92%) rename project/{ => lsf-setup}/lsf/finetune/small/ettm2.sh (92%) rename project/{ => lsf-setup}/lsf/finetune/small/run_multi.sh (100%) rename project/{ => lsf-setup}/lsf/finetune/small/weather.sh (95%) rename project/{ => lsf-setup}/lsf_point/eval/small/electricity.sh (85%) rename project/{ => lsf-setup}/lsf_point/eval/small/etth1.sh (90%) rename project/{ => lsf-setup}/lsf_point/eval/small/etth2.sh (89%) create mode 100644 project/lsf-setup/lsf_point/eval/small/ettm1.sh create mode 100644 project/lsf-setup/lsf_point/eval/small/ettm2.sh rename project/{ => lsf-setup}/lsf_point/eval/small/run_multi.sh (100%) rename project/{ => lsf-setup}/lsf_point/eval/small/weather.sh (90%) rename project/{ => lsf-setup}/lsf_point/finetune/small/electricity.sh (94%) rename project/{ => lsf-setup}/lsf_point/finetune/small/etth1.sh (94%) rename project/{ => lsf-setup}/lsf_point/finetune/small/etth2.sh (94%) rename project/{ => lsf-setup}/lsf_point/finetune/small/ettm1.sh (91%) rename project/{ => lsf-setup}/lsf_point/finetune/small/ettm2.sh (82%) rename project/{ => lsf-setup}/lsf_point/finetune/small/run_multi.sh (100%) rename project/{ => lsf-setup}/lsf_point/finetune/small/weather.sh (94%) rename project/{ => lsf-setup}/multi_scale/eval/small/electricity.sh (89%) rename project/{ => lsf-setup}/multi_scale/eval/small/etth1.sh (89%) rename project/{ => lsf-setup}/multi_scale/eval/small/etth2.sh (89%) rename project/{ => lsf-setup}/multi_scale/eval/small/ettm1.sh (71%) rename project/{ => lsf-setup}/multi_scale/eval/small/ettm2.sh (71%) rename project/{ => lsf-setup}/multi_scale/eval/small/run_multi.sh (100%) rename project/{ => lsf-setup}/multi_scale/eval/small/weather.sh (89%) rename project/{seasonal_naive => lsf-setup/multi_scale}/finetune/small/electricity.sh (94%) rename project/{ => lsf-setup}/multi_scale/finetune/small/etth1.sh (94%) rename project/{ => lsf-setup}/multi_scale/finetune/small/etth2.sh (94%) rename project/{ => lsf-setup}/multi_scale/finetune/small/ettm1.sh (82%) rename project/{ => lsf-setup}/multi_scale/finetune/small/ettm2.sh (90%) rename project/{ => lsf-setup}/multi_scale/finetune/small/run_multi.sh (100%) rename project/{ => lsf-setup}/multi_scale/finetune/small/weather.sh (94%) rename project/{ => lsf-setup}/multi_scale/zero_shot/lsf_small.sh (98%) rename project/{ => lsf-setup}/origin/eval/small/electricity.sh (85%) rename project/{ => lsf-setup}/origin/eval/small/etth1.sh (90%) rename project/{ => lsf-setup}/origin/eval/small/etth2.sh (90%) rename project/{ => lsf-setup}/origin/eval/small/ettm1.sh (90%) rename project/{ => lsf-setup}/origin/eval/small/ettm2.sh (86%) rename project/{ => lsf-setup}/origin/eval/small/run_multi.sh (100%) rename project/{ => lsf-setup}/origin/eval/small/weather.sh (86%) rename project/{ => lsf-setup}/origin/finetune/small/electricity.sh (95%) rename project/{ => lsf-setup}/origin/finetune/small/etth1.sh (95%) rename project/{ => lsf-setup}/origin/finetune/small/etth2.sh (94%) rename project/{ => lsf-setup}/origin/finetune/small/ettm1.sh (94%) rename project/{ => lsf-setup}/origin/finetune/small/ettm2.sh (94%) rename project/{ => lsf-setup}/origin/finetune/small/run_multi.sh (100%) rename project/{ => lsf-setup}/origin/finetune/small/weather.sh (95%) rename project/{ => lsf-setup}/origin/obtain_moirai_ckpt.py (100%) rename project/{ => lsf-setup}/origin/zero_shot/lsf_small.sh (97%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/electricity.sh (89%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/etth1.sh (90%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/etth2.sh (95%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/ettm1.sh (90%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/ettm2.sh (90%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/run_multi.sh (100%) rename project/{ => lsf-setup}/seasonal_naive/eval/small/weather.sh (89%) rename project/{lsf => lsf-setup/seasonal_naive}/finetune/small/electricity.sh (93%) rename project/{ => lsf-setup}/seasonal_naive/finetune/small/etth1.sh (93%) rename project/{ => lsf-setup}/seasonal_naive/finetune/small/etth2.sh (93%) rename project/{ => lsf-setup}/seasonal_naive/finetune/small/ettm1.sh (93%) rename project/{ => lsf-setup}/seasonal_naive/finetune/small/ettm2.sh (93%) rename project/{ => lsf-setup}/seasonal_naive/finetune/small/run_multi.sh (100%) rename project/{ => lsf-setup}/seasonal_naive/finetune/small/weather.sh (93%) delete mode 100644 project/lsf/eval/small/ettm2.sh delete mode 100644 project/lsf_point/eval/small/ettm1.sh create mode 100644 project/pf-setup/build_pf_ft_datasets.sh create mode 100644 project/pf-setup/origin/zero_shot/pf_small.sh create mode 100644 project/pf-setup/pf/eval/small/electricity.sh create mode 100644 project/pf-setup/pf/eval/small/istanbul_traffic.sh create mode 100644 project/pf-setup/pf/eval/small/jena_weather.sh create mode 100644 project/pf-setup/pf/eval/small/solar-energy.sh create mode 100644 project/pf-setup/pf/eval/small/turkey_power.sh create mode 100644 project/pf-setup/pf/finetune/small/electricity.sh create mode 100644 project/pf-setup/pf/finetune/small/istanbul_traffic.sh create mode 100644 project/pf-setup/pf/finetune/small/jena_weather.sh create mode 100644 project/pf-setup/pf/finetune/small/solar-energy.sh create mode 100644 project/pf-setup/pf/finetune/small/turkey_power.sh create mode 100644 src/uni2ts/data/builder/pf_simple.py diff --git a/README.md b/README.md index 6b81085..f6c0040 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ The validation set will be saved as DATASET_NAME_eval. python -m uni2ts.data.builder.simple ETTh1 dataset/ETT-small/ETTh1.csv --date_offset '2017-10-23 23:00:00' ``` -3. Finally, we can simply run the fine-tuning script with the appropriate [training](cli/conf/origin/finetune/data/etth1.yaml) and [validation](cli/conf/origin/finetune/val_data/etth1.yaml) data configuration files. +3. Finally, we can simply run the fine-tuning script with the appropriate [training](cli/conf/lsf-setup/origin/finetune/data/etth1.yaml) and [validation](cli/conf/lsf-setup/origin/finetune/val_data/etth1.yaml) data configuration files. ```shell python -m cli.finetune \ -cp conf/lsf \ @@ -177,7 +177,7 @@ python -m cli.finetune \ ### Evaluation -The evaluation script can be used to calculate evaluation metrics such as MSE, MASE, CRPS, and so on (see the [configuration file](cli/conf/origin/eval/default.yaml)). +The evaluation script can be used to calculate evaluation metrics such as MSE, MASE, CRPS, and so on (see the [configuration file](cli/conf/lsf-setup/origin/eval/default.yaml)). Given a test split (see previous section on processing datasets), we can run the following command to evaluate it: ```shell @@ -189,7 +189,7 @@ python -m cli.eval \ data=etth1_test ``` -Alternatively, we provide access to popular datasets, and can be toggled via the [data configurations](cli/conf/origin/eval/data). +Alternatively, we provide access to popular datasets, and can be toggled via the [data configurations](cli/conf/lsf-setup/origin/eval/data). As an example, say we want to perform evaluation, again on the ETTh1 dataset from the popular [Long Sequence Forecasting benchmark](https://github.com/thuml/Time-Series-Library). We first need to download the pre-processed datasets and put them in the correct directory, by setting up the TSLib repository and following the instructions. Then, assign the dataset directory to the `LSF_PATH` environment variable: @@ -197,7 +197,7 @@ Then, assign the dataset directory to the `LSF_PATH` environment variable: echo "LSF_PATH=PATH_TO_TSLIB/dataset" >> .env ``` -Thereafter, simply run the following script with the predefined [Hydra config file](cli/conf/origin/eval/data/lsf_test.yaml): +Thereafter, simply run the following script with the predefined [Hydra config file](cli/conf/lsf-setup/origin/eval/data/lsf_test.yaml): ```shell python -m cli.eval \ run_name=example_eval_2 \ diff --git a/cli/conf/lsf/eval/data/etth1_test.yaml b/cli/conf/lsf-setup/lsf/eval/data/etth1_test.yaml similarity index 100% rename from cli/conf/lsf/eval/data/etth1_test.yaml rename to cli/conf/lsf-setup/lsf/eval/data/etth1_test.yaml diff --git a/cli/conf/lsf/eval/data/etth1_val.yaml b/cli/conf/lsf-setup/lsf/eval/data/etth1_val.yaml similarity index 100% rename from cli/conf/lsf/eval/data/etth1_val.yaml rename to cli/conf/lsf-setup/lsf/eval/data/etth1_val.yaml diff --git a/cli/conf/lsf/eval/data/gluonts_test.yaml b/cli/conf/lsf-setup/lsf/eval/data/gluonts_test.yaml similarity index 100% rename from cli/conf/lsf/eval/data/gluonts_test.yaml rename to cli/conf/lsf-setup/lsf/eval/data/gluonts_test.yaml diff --git a/cli/conf/lsf/eval/data/gluonts_val.yaml b/cli/conf/lsf-setup/lsf/eval/data/gluonts_val.yaml similarity index 100% rename from cli/conf/lsf/eval/data/gluonts_val.yaml rename to cli/conf/lsf-setup/lsf/eval/data/gluonts_val.yaml diff --git a/cli/conf/lsf/eval/data/lsf_test.yaml b/cli/conf/lsf-setup/lsf/eval/data/lsf_test.yaml similarity index 100% rename from cli/conf/lsf/eval/data/lsf_test.yaml rename to cli/conf/lsf-setup/lsf/eval/data/lsf_test.yaml diff --git a/cli/conf/lsf/eval/data/lsf_val.yaml b/cli/conf/lsf-setup/lsf/eval/data/lsf_val.yaml similarity index 100% rename from cli/conf/lsf/eval/data/lsf_val.yaml rename to cli/conf/lsf-setup/lsf/eval/data/lsf_val.yaml diff --git a/cli/conf/lsf/eval/data/monash.yaml b/cli/conf/lsf-setup/lsf/eval/data/monash.yaml similarity index 100% rename from cli/conf/lsf/eval/data/monash.yaml rename to cli/conf/lsf-setup/lsf/eval/data/monash.yaml diff --git a/cli/conf/lsf/eval/default.yaml b/cli/conf/lsf-setup/lsf/eval/default.yaml similarity index 79% rename from cli/conf/lsf/eval/default.yaml rename to cli/conf/lsf-setup/lsf/eval/default.yaml index d04fd6c..28825ea 100644 --- a/cli/conf/lsf/eval/default.yaml +++ b/cli/conf/lsf-setup/lsf/eval/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/lsf/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} + dir: outputs/lsf-setup/lsf/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} defaults: - model: ??? - data: ??? diff --git a/cli/conf/lsf/eval/model/moirai_1.0_R_base.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_1.0_R_base.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_1.0_R_base.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_1.0_R_base.yaml diff --git a/cli/conf/lsf/eval/model/moirai_1.0_R_large.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_1.0_R_large.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_1.0_R_large.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_1.0_R_large.yaml diff --git a/cli/conf/lsf/eval/model/moirai_1.0_R_small.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_1.0_R_small.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_1.0_R_small.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_1.0_R_small.yaml diff --git a/cli/conf/lsf/eval/model/moirai_1.1_R_base.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_1.1_R_base.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_1.1_R_base.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_1.1_R_base.yaml diff --git a/cli/conf/lsf/eval/model/moirai_1.1_R_large.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_1.1_R_large.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_1.1_R_large.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_1.1_R_large.yaml diff --git a/cli/conf/lsf/eval/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/lsf/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/lsf-setup/lsf/eval/model/moirai_lightning_ckpt.yaml similarity index 100% rename from cli/conf/lsf/eval/model/moirai_lightning_ckpt.yaml rename to cli/conf/lsf-setup/lsf/eval/model/moirai_lightning_ckpt.yaml diff --git a/cli/conf/lsf/finetune/data/electricity.yaml b/cli/conf/lsf-setup/lsf/finetune/data/electricity.yaml similarity index 100% rename from cli/conf/lsf/finetune/data/electricity.yaml rename to cli/conf/lsf-setup/lsf/finetune/data/electricity.yaml diff --git a/cli/conf/lsf/finetune/data/etth1.yaml b/cli/conf/lsf-setup/lsf/finetune/data/etth1.yaml similarity index 100% rename from cli/conf/lsf/finetune/data/etth1.yaml rename to cli/conf/lsf-setup/lsf/finetune/data/etth1.yaml diff --git a/cli/conf/lsf/finetune/data/etth2.yaml b/cli/conf/lsf-setup/lsf/finetune/data/etth2.yaml similarity index 100% rename from cli/conf/lsf/finetune/data/etth2.yaml rename to cli/conf/lsf-setup/lsf/finetune/data/etth2.yaml diff --git a/cli/conf/lsf/finetune/data/ettm1.yaml b/cli/conf/lsf-setup/lsf/finetune/data/ettm1.yaml similarity index 100% rename from cli/conf/lsf/finetune/data/ettm1.yaml rename to cli/conf/lsf-setup/lsf/finetune/data/ettm1.yaml diff --git a/cli/conf/lsf/finetune/data/ettm2.yaml b/cli/conf/lsf-setup/lsf/finetune/data/ettm2.yaml similarity index 100% rename from cli/conf/lsf/finetune/data/ettm2.yaml rename to cli/conf/lsf-setup/lsf/finetune/data/ettm2.yaml diff --git a/cli/conf/lsf/finetune/data/weather.yaml b/cli/conf/lsf-setup/lsf/finetune/data/weather.yaml similarity index 100% rename from cli/conf/lsf/finetune/data/weather.yaml rename to cli/conf/lsf-setup/lsf/finetune/data/weather.yaml diff --git a/cli/conf/lsf/finetune/default.yaml b/cli/conf/lsf-setup/lsf/finetune/default.yaml similarity index 93% rename from cli/conf/lsf/finetune/default.yaml rename to cli/conf/lsf-setup/lsf/finetune/default.yaml index 3342348..67ac76a 100644 --- a/cli/conf/lsf/finetune/default.yaml +++ b/cli/conf/lsf-setup/lsf/finetune/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/lsf/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} + dir: outputs/lsf-setup/lsf/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} defaults: - model: ??? - data: ??? diff --git a/cli/conf/lsf/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/lsf/finetune/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/lsf/finetune/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/lsf/finetune/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/lsf/finetune/val_data/electricity.yaml b/cli/conf/lsf-setup/lsf/finetune/val_data/electricity.yaml similarity index 100% rename from cli/conf/lsf/finetune/val_data/electricity.yaml rename to cli/conf/lsf-setup/lsf/finetune/val_data/electricity.yaml diff --git a/cli/conf/lsf/finetune/val_data/etth1.yaml b/cli/conf/lsf-setup/lsf/finetune/val_data/etth1.yaml similarity index 100% rename from cli/conf/lsf/finetune/val_data/etth1.yaml rename to cli/conf/lsf-setup/lsf/finetune/val_data/etth1.yaml diff --git a/cli/conf/lsf/finetune/val_data/etth2.yaml b/cli/conf/lsf-setup/lsf/finetune/val_data/etth2.yaml similarity index 100% rename from cli/conf/lsf/finetune/val_data/etth2.yaml rename to cli/conf/lsf-setup/lsf/finetune/val_data/etth2.yaml diff --git a/cli/conf/lsf/finetune/val_data/ettm1.yaml b/cli/conf/lsf-setup/lsf/finetune/val_data/ettm1.yaml similarity index 100% rename from cli/conf/lsf/finetune/val_data/ettm1.yaml rename to cli/conf/lsf-setup/lsf/finetune/val_data/ettm1.yaml diff --git a/cli/conf/lsf/finetune/val_data/ettm2.yaml b/cli/conf/lsf-setup/lsf/finetune/val_data/ettm2.yaml similarity index 100% rename from cli/conf/lsf/finetune/val_data/ettm2.yaml rename to cli/conf/lsf-setup/lsf/finetune/val_data/ettm2.yaml diff --git a/cli/conf/lsf/finetune/val_data/weather.yaml b/cli/conf/lsf-setup/lsf/finetune/val_data/weather.yaml similarity index 100% rename from cli/conf/lsf/finetune/val_data/weather.yaml rename to cli/conf/lsf-setup/lsf/finetune/val_data/weather.yaml diff --git a/cli/conf/lsf_point/eval/data/etth1_test.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/etth1_test.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/etth1_test.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/etth1_test.yaml diff --git a/cli/conf/lsf_point/eval/data/etth1_val.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/etth1_val.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/etth1_val.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/etth1_val.yaml diff --git a/cli/conf/lsf_point/eval/data/gluonts_test.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/gluonts_test.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/gluonts_test.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/gluonts_test.yaml diff --git a/cli/conf/lsf_point/eval/data/gluonts_val.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/gluonts_val.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/gluonts_val.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/gluonts_val.yaml diff --git a/cli/conf/lsf_point/eval/data/lsf_test.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/lsf_test.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/lsf_test.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/lsf_test.yaml diff --git a/cli/conf/lsf_point/eval/data/lsf_val.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/lsf_val.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/lsf_val.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/lsf_val.yaml diff --git a/cli/conf/lsf_point/eval/data/monash.yaml b/cli/conf/lsf-setup/lsf_point/eval/data/monash.yaml similarity index 100% rename from cli/conf/lsf_point/eval/data/monash.yaml rename to cli/conf/lsf-setup/lsf_point/eval/data/monash.yaml diff --git a/cli/conf/origin/eval/default.yaml b/cli/conf/lsf-setup/lsf_point/eval/default.yaml similarity index 79% rename from cli/conf/origin/eval/default.yaml rename to cli/conf/lsf-setup/lsf_point/eval/default.yaml index aeeed0a..91ca64c 100644 --- a/cli/conf/origin/eval/default.yaml +++ b/cli/conf/lsf-setup/lsf_point/eval/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/origin/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} + dir: outputs/lsf-setup/lsf_point/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} defaults: - model: ??? - data: ??? diff --git a/cli/conf/lsf_point/eval/model/moirai_1.0_R_base.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.0_R_base.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_1.0_R_base.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.0_R_base.yaml diff --git a/cli/conf/lsf_point/eval/model/moirai_1.0_R_large.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.0_R_large.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_1.0_R_large.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.0_R_large.yaml diff --git a/cli/conf/lsf_point/eval/model/moirai_1.0_R_small.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.0_R_small.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_1.0_R_small.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.0_R_small.yaml diff --git a/cli/conf/lsf_point/eval/model/moirai_1.1_R_base.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.1_R_base.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_1.1_R_base.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.1_R_base.yaml diff --git a/cli/conf/lsf_point/eval/model/moirai_1.1_R_large.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.1_R_large.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_1.1_R_large.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.1_R_large.yaml diff --git a/cli/conf/lsf_point/eval/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/lsf_point/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/lsf-setup/lsf_point/eval/model/moirai_lightning_ckpt.yaml similarity index 100% rename from cli/conf/lsf_point/eval/model/moirai_lightning_ckpt.yaml rename to cli/conf/lsf-setup/lsf_point/eval/model/moirai_lightning_ckpt.yaml diff --git a/cli/conf/lsf_point/finetune/data/electricity.yaml b/cli/conf/lsf-setup/lsf_point/finetune/data/electricity.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/data/electricity.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/data/electricity.yaml diff --git a/cli/conf/lsf_point/finetune/data/etth1.yaml b/cli/conf/lsf-setup/lsf_point/finetune/data/etth1.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/data/etth1.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/data/etth1.yaml diff --git a/cli/conf/lsf_point/finetune/data/etth2.yaml b/cli/conf/lsf-setup/lsf_point/finetune/data/etth2.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/data/etth2.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/data/etth2.yaml diff --git a/cli/conf/lsf_point/finetune/data/ettm1.yaml b/cli/conf/lsf-setup/lsf_point/finetune/data/ettm1.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/data/ettm1.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/data/ettm1.yaml diff --git a/cli/conf/lsf_point/finetune/data/ettm2.yaml b/cli/conf/lsf-setup/lsf_point/finetune/data/ettm2.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/data/ettm2.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/data/ettm2.yaml diff --git a/cli/conf/lsf_point/finetune/data/weather.yaml b/cli/conf/lsf-setup/lsf_point/finetune/data/weather.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/data/weather.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/data/weather.yaml diff --git a/cli/conf/lsf_point/finetune/default.yaml b/cli/conf/lsf-setup/lsf_point/finetune/default.yaml similarity index 93% rename from cli/conf/lsf_point/finetune/default.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/default.yaml index 52614ef..b7279a4 100644 --- a/cli/conf/lsf_point/finetune/default.yaml +++ b/cli/conf/lsf-setup/lsf_point/finetune/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/lsf_point/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} + dir: outputs/lsf-setup/lsf_point/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} defaults: - model: ??? - data: ??? diff --git a/cli/conf/lsf_point/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/lsf_point/finetune/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/lsf_point/finetune/val_data/electricity.yaml b/cli/conf/lsf-setup/lsf_point/finetune/val_data/electricity.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/val_data/electricity.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/val_data/electricity.yaml diff --git a/cli/conf/lsf_point/finetune/val_data/etth1.yaml b/cli/conf/lsf-setup/lsf_point/finetune/val_data/etth1.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/val_data/etth1.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/val_data/etth1.yaml diff --git a/cli/conf/lsf_point/finetune/val_data/etth2.yaml b/cli/conf/lsf-setup/lsf_point/finetune/val_data/etth2.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/val_data/etth2.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/val_data/etth2.yaml diff --git a/cli/conf/lsf_point/finetune/val_data/ettm1.yaml b/cli/conf/lsf-setup/lsf_point/finetune/val_data/ettm1.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/val_data/ettm1.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/val_data/ettm1.yaml diff --git a/cli/conf/lsf_point/finetune/val_data/ettm2.yaml b/cli/conf/lsf-setup/lsf_point/finetune/val_data/ettm2.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/val_data/ettm2.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/val_data/ettm2.yaml diff --git a/cli/conf/lsf_point/finetune/val_data/weather.yaml b/cli/conf/lsf-setup/lsf_point/finetune/val_data/weather.yaml similarity index 100% rename from cli/conf/lsf_point/finetune/val_data/weather.yaml rename to cli/conf/lsf-setup/lsf_point/finetune/val_data/weather.yaml diff --git a/cli/conf/multi_scale/eval/data/etth1_test.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/etth1_test.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/etth1_test.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/etth1_test.yaml diff --git a/cli/conf/multi_scale/eval/data/etth1_val.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/etth1_val.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/etth1_val.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/etth1_val.yaml diff --git a/cli/conf/multi_scale/eval/data/gluonts_test.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/gluonts_test.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/gluonts_test.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/gluonts_test.yaml diff --git a/cli/conf/multi_scale/eval/data/gluonts_val.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/gluonts_val.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/gluonts_val.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/gluonts_val.yaml diff --git a/cli/conf/multi_scale/eval/data/lsf_test.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/lsf_test.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/lsf_test.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/lsf_test.yaml diff --git a/cli/conf/multi_scale/eval/data/lsf_val.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/lsf_val.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/lsf_val.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/lsf_val.yaml diff --git a/cli/conf/multi_scale/eval/data/monash.yaml b/cli/conf/lsf-setup/multi_scale/eval/data/monash.yaml similarity index 100% rename from cli/conf/multi_scale/eval/data/monash.yaml rename to cli/conf/lsf-setup/multi_scale/eval/data/monash.yaml diff --git a/cli/conf/lsf-setup/multi_scale/eval/default.yaml b/cli/conf/lsf-setup/multi_scale/eval/default.yaml new file mode 100644 index 0000000..b3288e3 --- /dev/null +++ b/cli/conf/lsf-setup/multi_scale/eval/default.yaml @@ -0,0 +1,24 @@ +hydra: + run: + dir: outputs/lsf-setup/multi_scale/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} +defaults: + - model: ??? + - data: ??? + - _self_ +exp_name: ??? +metrics: + - _target_: gluonts.ev.metrics.MSE + - _target_: uni2ts.eval_util.metrics.MedianMSE + - _target_: gluonts.ev.metrics.MAE + - _target_: gluonts.ev.metrics.MASE + - _target_: gluonts.ev.metrics.MAPE + - _target_: gluonts.ev.metrics.SMAPE + - _target_: gluonts.ev.metrics.MSIS + - _target_: gluonts.ev.metrics.RMSE + - _target_: gluonts.ev.metrics.NRMSE + - _target_: gluonts.ev.metrics.ND + - _target_: gluonts.ev.metrics.MeanWeightedSumQuantileLoss + quantile_levels: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] +batch_size: 512 # 16 +min_batch_size: 16 +device: auto \ No newline at end of file diff --git a/cli/conf/multi_scale/eval/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/multi_scale/eval/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/multi_scale/eval/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/multi_scale/eval/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/multi_scale/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/lsf-setup/multi_scale/eval/model/moirai_lightning_ckpt.yaml similarity index 100% rename from cli/conf/multi_scale/eval/model/moirai_lightning_ckpt.yaml rename to cli/conf/lsf-setup/multi_scale/eval/model/moirai_lightning_ckpt.yaml diff --git a/cli/conf/multi_scale/finetune/data/electricity.yaml b/cli/conf/lsf-setup/multi_scale/finetune/data/electricity.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/data/electricity.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/data/electricity.yaml diff --git a/cli/conf/multi_scale/finetune/data/etth1.yaml b/cli/conf/lsf-setup/multi_scale/finetune/data/etth1.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/data/etth1.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/data/etth1.yaml diff --git a/cli/conf/multi_scale/finetune/data/etth2.yaml b/cli/conf/lsf-setup/multi_scale/finetune/data/etth2.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/data/etth2.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/data/etth2.yaml diff --git a/cli/conf/multi_scale/finetune/data/ettm1.yaml b/cli/conf/lsf-setup/multi_scale/finetune/data/ettm1.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/data/ettm1.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/data/ettm1.yaml diff --git a/cli/conf/multi_scale/finetune/data/ettm2.yaml b/cli/conf/lsf-setup/multi_scale/finetune/data/ettm2.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/data/ettm2.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/data/ettm2.yaml diff --git a/cli/conf/multi_scale/finetune/data/weather.yaml b/cli/conf/lsf-setup/multi_scale/finetune/data/weather.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/data/weather.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/data/weather.yaml diff --git a/cli/conf/multi_scale/finetune/default.yaml b/cli/conf/lsf-setup/multi_scale/finetune/default.yaml similarity index 92% rename from cli/conf/multi_scale/finetune/default.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/default.yaml index 1a36ff8..7239871 100644 --- a/cli/conf/multi_scale/finetune/default.yaml +++ b/cli/conf/lsf-setup/multi_scale/finetune/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/multi_scale/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} + dir: outputs/lsf-setup/multi_scale/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} defaults: - model: ??? - data: ??? diff --git a/cli/conf/multi_scale/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/multi_scale/finetune/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/multi_scale/finetune/val_data/electricity.yaml b/cli/conf/lsf-setup/multi_scale/finetune/val_data/electricity.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/val_data/electricity.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/val_data/electricity.yaml diff --git a/cli/conf/multi_scale/finetune/val_data/etth1.yaml b/cli/conf/lsf-setup/multi_scale/finetune/val_data/etth1.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/val_data/etth1.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/val_data/etth1.yaml diff --git a/cli/conf/multi_scale/finetune/val_data/etth2.yaml b/cli/conf/lsf-setup/multi_scale/finetune/val_data/etth2.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/val_data/etth2.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/val_data/etth2.yaml diff --git a/cli/conf/multi_scale/finetune/val_data/ettm1.yaml b/cli/conf/lsf-setup/multi_scale/finetune/val_data/ettm1.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/val_data/ettm1.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/val_data/ettm1.yaml diff --git a/cli/conf/multi_scale/finetune/val_data/ettm2.yaml b/cli/conf/lsf-setup/multi_scale/finetune/val_data/ettm2.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/val_data/ettm2.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/val_data/ettm2.yaml diff --git a/cli/conf/multi_scale/finetune/val_data/weather.yaml b/cli/conf/lsf-setup/multi_scale/finetune/val_data/weather.yaml similarity index 100% rename from cli/conf/multi_scale/finetune/val_data/weather.yaml rename to cli/conf/lsf-setup/multi_scale/finetune/val_data/weather.yaml diff --git a/cli/conf/origin/eval/data/etth1_test.yaml b/cli/conf/lsf-setup/origin/eval/data/etth1_test.yaml similarity index 100% rename from cli/conf/origin/eval/data/etth1_test.yaml rename to cli/conf/lsf-setup/origin/eval/data/etth1_test.yaml diff --git a/cli/conf/origin/eval/data/etth1_val.yaml b/cli/conf/lsf-setup/origin/eval/data/etth1_val.yaml similarity index 100% rename from cli/conf/origin/eval/data/etth1_val.yaml rename to cli/conf/lsf-setup/origin/eval/data/etth1_val.yaml diff --git a/cli/conf/origin/eval/data/gluonts_test.yaml b/cli/conf/lsf-setup/origin/eval/data/gluonts_test.yaml similarity index 100% rename from cli/conf/origin/eval/data/gluonts_test.yaml rename to cli/conf/lsf-setup/origin/eval/data/gluonts_test.yaml diff --git a/cli/conf/origin/eval/data/gluonts_val.yaml b/cli/conf/lsf-setup/origin/eval/data/gluonts_val.yaml similarity index 100% rename from cli/conf/origin/eval/data/gluonts_val.yaml rename to cli/conf/lsf-setup/origin/eval/data/gluonts_val.yaml diff --git a/cli/conf/origin/eval/data/lsf_test.yaml b/cli/conf/lsf-setup/origin/eval/data/lsf_test.yaml similarity index 100% rename from cli/conf/origin/eval/data/lsf_test.yaml rename to cli/conf/lsf-setup/origin/eval/data/lsf_test.yaml diff --git a/cli/conf/origin/eval/data/lsf_val.yaml b/cli/conf/lsf-setup/origin/eval/data/lsf_val.yaml similarity index 100% rename from cli/conf/origin/eval/data/lsf_val.yaml rename to cli/conf/lsf-setup/origin/eval/data/lsf_val.yaml diff --git a/cli/conf/origin/eval/data/monash.yaml b/cli/conf/lsf-setup/origin/eval/data/monash.yaml similarity index 100% rename from cli/conf/origin/eval/data/monash.yaml rename to cli/conf/lsf-setup/origin/eval/data/monash.yaml diff --git a/cli/conf/lsf_point/eval/default.yaml b/cli/conf/lsf-setup/origin/eval/default.yaml similarity index 79% rename from cli/conf/lsf_point/eval/default.yaml rename to cli/conf/lsf-setup/origin/eval/default.yaml index 19115d4..858f262 100644 --- a/cli/conf/lsf_point/eval/default.yaml +++ b/cli/conf/lsf-setup/origin/eval/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/lsf_point/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} + dir: outputs/lsf-setup/origin/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} defaults: - model: ??? - data: ??? diff --git a/cli/conf/origin/eval/model/moirai_1.0_R_base.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_1.0_R_base.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_1.0_R_base.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_1.0_R_base.yaml diff --git a/cli/conf/origin/eval/model/moirai_1.0_R_large.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_1.0_R_large.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_1.0_R_large.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_1.0_R_large.yaml diff --git a/cli/conf/origin/eval/model/moirai_1.0_R_small.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_1.0_R_small.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_1.0_R_small.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_1.0_R_small.yaml diff --git a/cli/conf/origin/eval/model/moirai_1.1_R_base.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_1.1_R_base.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_1.1_R_base.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_1.1_R_base.yaml diff --git a/cli/conf/origin/eval/model/moirai_1.1_R_large.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_1.1_R_large.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_1.1_R_large.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_1.1_R_large.yaml diff --git a/cli/conf/origin/eval/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/origin/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/lsf-setup/origin/eval/model/moirai_lightning_ckpt.yaml similarity index 100% rename from cli/conf/origin/eval/model/moirai_lightning_ckpt.yaml rename to cli/conf/lsf-setup/origin/eval/model/moirai_lightning_ckpt.yaml diff --git a/cli/conf/origin/finetune/data/electricity.yaml b/cli/conf/lsf-setup/origin/finetune/data/electricity.yaml similarity index 100% rename from cli/conf/origin/finetune/data/electricity.yaml rename to cli/conf/lsf-setup/origin/finetune/data/electricity.yaml diff --git a/cli/conf/origin/finetune/data/etth1.yaml b/cli/conf/lsf-setup/origin/finetune/data/etth1.yaml similarity index 100% rename from cli/conf/origin/finetune/data/etth1.yaml rename to cli/conf/lsf-setup/origin/finetune/data/etth1.yaml diff --git a/cli/conf/origin/finetune/data/etth2.yaml b/cli/conf/lsf-setup/origin/finetune/data/etth2.yaml similarity index 100% rename from cli/conf/origin/finetune/data/etth2.yaml rename to cli/conf/lsf-setup/origin/finetune/data/etth2.yaml diff --git a/cli/conf/origin/finetune/data/ettm1.yaml b/cli/conf/lsf-setup/origin/finetune/data/ettm1.yaml similarity index 100% rename from cli/conf/origin/finetune/data/ettm1.yaml rename to cli/conf/lsf-setup/origin/finetune/data/ettm1.yaml diff --git a/cli/conf/origin/finetune/data/ettm2.yaml b/cli/conf/lsf-setup/origin/finetune/data/ettm2.yaml similarity index 100% rename from cli/conf/origin/finetune/data/ettm2.yaml rename to cli/conf/lsf-setup/origin/finetune/data/ettm2.yaml diff --git a/cli/conf/origin/finetune/data/weather.yaml b/cli/conf/lsf-setup/origin/finetune/data/weather.yaml similarity index 100% rename from cli/conf/origin/finetune/data/weather.yaml rename to cli/conf/lsf-setup/origin/finetune/data/weather.yaml diff --git a/cli/conf/lsf-setup/origin/finetune/default.yaml b/cli/conf/lsf-setup/origin/finetune/default.yaml new file mode 100644 index 0000000..cee0ae8 --- /dev/null +++ b/cli/conf/lsf-setup/origin/finetune/default.yaml @@ -0,0 +1,86 @@ +hydra: + run: + dir: outputs/lsf-setup/origin/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} +defaults: + - model: ??? + - data: ??? + - val_data: null + - _self_ +exp_name: ??? +run_name: ??? +seed: 0 +tf32: true +compile: false # set to mode: default, reduce-overhead, max-autotune +ckpt_path: null +trainer: + _target_: lightning.Trainer + accelerator: auto + strategy: auto + devices: auto + num_nodes: 1 + precision: 32 + logger: + _target_: lightning.pytorch.loggers.TensorBoardLogger + save_dir: ${hydra:runtime.output_dir} + name: logs + callbacks: + - _target_: lightning.pytorch.callbacks.LearningRateMonitor + logging_interval: epoch + - _target_: lightning.pytorch.callbacks.ModelCheckpoint + dirpath: ${hydra:runtime.output_dir}/checkpoints + monitor: val/PackedNLLLoss + save_weights_only: true + mode: min + save_top_k: 2 # Qz: Sometimes the 1st validation gets anomalous results. Discard that ckpt, and use the 2nd one. + every_n_epochs: 1 + - _target_: uni2ts.callbacks.earlystop.WarmupEarlyStopping # lightning.pytorch.callbacks.EarlyStopping + monitor: val/PackedNLLLoss + min_delta: 0.0 + patience: 30 + mode: min + strict: false + verbose: true + warmup_steps: 1 + max_epochs: 1000 + enable_progress_bar: true + accumulate_grad_batches: 1 + gradient_clip_val: 1.0 + gradient_clip_algorithm: norm +train_dataloader: + _target_: uni2ts.data.loader.DataLoader + batch_size: 32 + batch_size_factor: 2.0 + cycle: true + num_batches_per_epoch: 10 + shuffle: true + num_workers: 11 + collate_fn: + _target_: uni2ts.data.loader.PackCollate + max_length: ${model.module_kwargs.max_seq_len} + seq_fields: ${cls_getattr:${model._target_},seq_fields} + pad_func_map: ${cls_getattr:${model._target_},pad_func_map} + pin_memory: true + drop_last: false + fill_last: false + worker_init_fn: null + prefetch_factor: 2 + persistent_workers: true +val_dataloader: + _target_: uni2ts.data.loader.DataLoader + batch_size: 32 + batch_size_factor: 2.0 + cycle: false + num_batches_per_epoch: null + shuffle: false + num_workers: 11 + collate_fn: + _target_: uni2ts.data.loader.PackCollate + max_length: ${model.module_kwargs.max_seq_len} + seq_fields: ${cls_getattr:${model._target_},seq_fields} + pad_func_map: ${cls_getattr:${model._target_},pad_func_map} + pin_memory: false + drop_last: false + fill_last: true + worker_init_fn: null + prefetch_factor: 2 + persistent_workers: true \ No newline at end of file diff --git a/cli/conf/origin/finetune/model/moirai_1.0_R_base.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_1.0_R_base.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_1.0_R_base.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_1.0_R_base.yaml diff --git a/cli/conf/origin/finetune/model/moirai_1.0_R_large.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_1.0_R_large.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_1.0_R_large.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_1.0_R_large.yaml diff --git a/cli/conf/origin/finetune/model/moirai_1.0_R_small.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_1.0_R_small.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_1.0_R_small.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_1.0_R_small.yaml diff --git a/cli/conf/origin/finetune/model/moirai_1.1_R_base.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_1.1_R_base.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_1.1_R_base.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_1.1_R_base.yaml diff --git a/cli/conf/origin/finetune/model/moirai_1.1_R_large.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_1.1_R_large.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_1.1_R_large.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_1.1_R_large.yaml diff --git a/cli/conf/origin/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/origin/finetune/model/moirai_base.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_base.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_base.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_base.yaml diff --git a/cli/conf/origin/finetune/model/moirai_large.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_large.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_large.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_large.yaml diff --git a/cli/conf/origin/finetune/model/moirai_small.yaml b/cli/conf/lsf-setup/origin/finetune/model/moirai_small.yaml similarity index 100% rename from cli/conf/origin/finetune/model/moirai_small.yaml rename to cli/conf/lsf-setup/origin/finetune/model/moirai_small.yaml diff --git a/cli/conf/origin/finetune/val_data/electricity.yaml b/cli/conf/lsf-setup/origin/finetune/val_data/electricity.yaml similarity index 100% rename from cli/conf/origin/finetune/val_data/electricity.yaml rename to cli/conf/lsf-setup/origin/finetune/val_data/electricity.yaml diff --git a/cli/conf/origin/finetune/val_data/etth1.yaml b/cli/conf/lsf-setup/origin/finetune/val_data/etth1.yaml similarity index 100% rename from cli/conf/origin/finetune/val_data/etth1.yaml rename to cli/conf/lsf-setup/origin/finetune/val_data/etth1.yaml diff --git a/cli/conf/origin/finetune/val_data/etth2.yaml b/cli/conf/lsf-setup/origin/finetune/val_data/etth2.yaml similarity index 100% rename from cli/conf/origin/finetune/val_data/etth2.yaml rename to cli/conf/lsf-setup/origin/finetune/val_data/etth2.yaml diff --git a/cli/conf/origin/finetune/val_data/ettm1.yaml b/cli/conf/lsf-setup/origin/finetune/val_data/ettm1.yaml similarity index 100% rename from cli/conf/origin/finetune/val_data/ettm1.yaml rename to cli/conf/lsf-setup/origin/finetune/val_data/ettm1.yaml diff --git a/cli/conf/origin/finetune/val_data/ettm2.yaml b/cli/conf/lsf-setup/origin/finetune/val_data/ettm2.yaml similarity index 100% rename from cli/conf/origin/finetune/val_data/ettm2.yaml rename to cli/conf/lsf-setup/origin/finetune/val_data/ettm2.yaml diff --git a/cli/conf/origin/finetune/val_data/weather.yaml b/cli/conf/lsf-setup/origin/finetune/val_data/weather.yaml similarity index 100% rename from cli/conf/origin/finetune/val_data/weather.yaml rename to cli/conf/lsf-setup/origin/finetune/val_data/weather.yaml diff --git a/cli/conf/seasonal_naive/eval/data/etth1_test.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/etth1_test.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/etth1_test.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/etth1_test.yaml diff --git a/cli/conf/seasonal_naive/eval/data/etth1_val.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/etth1_val.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/etth1_val.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/etth1_val.yaml diff --git a/cli/conf/seasonal_naive/eval/data/gluonts_test.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/gluonts_test.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/gluonts_test.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/gluonts_test.yaml diff --git a/cli/conf/seasonal_naive/eval/data/gluonts_val.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/gluonts_val.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/gluonts_val.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/gluonts_val.yaml diff --git a/cli/conf/seasonal_naive/eval/data/lsf_test.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/lsf_test.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/lsf_test.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/lsf_test.yaml diff --git a/cli/conf/seasonal_naive/eval/data/lsf_val.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/lsf_val.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/lsf_val.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/lsf_val.yaml diff --git a/cli/conf/seasonal_naive/eval/data/monash.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/data/monash.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/data/monash.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/data/monash.yaml diff --git a/cli/conf/lsf-setup/seasonal_naive/eval/default.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/default.yaml new file mode 100644 index 0000000..7228141 --- /dev/null +++ b/cli/conf/lsf-setup/seasonal_naive/eval/default.yaml @@ -0,0 +1,24 @@ +hydra: + run: + dir: outputs/lsf-setup/seasonal_naive/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} +defaults: + - model: ??? + - data: ??? + - _self_ +exp_name: ??? +metrics: + - _target_: gluonts.ev.metrics.MSE + - _target_: uni2ts.eval_util.metrics.MedianMSE + - _target_: gluonts.ev.metrics.MAE + - _target_: gluonts.ev.metrics.MASE + - _target_: gluonts.ev.metrics.MAPE + - _target_: gluonts.ev.metrics.SMAPE + - _target_: gluonts.ev.metrics.MSIS + - _target_: gluonts.ev.metrics.RMSE + - _target_: gluonts.ev.metrics.NRMSE + - _target_: gluonts.ev.metrics.ND + - _target_: gluonts.ev.metrics.MeanWeightedSumQuantileLoss + quantile_levels: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] +batch_size: 512 +min_batch_size: 16 +device: auto \ No newline at end of file diff --git a/cli/conf/seasonal_naive/eval/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/seasonal_naive/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/lsf-setup/seasonal_naive/eval/model/moirai_lightning_ckpt.yaml similarity index 100% rename from cli/conf/seasonal_naive/eval/model/moirai_lightning_ckpt.yaml rename to cli/conf/lsf-setup/seasonal_naive/eval/model/moirai_lightning_ckpt.yaml diff --git a/cli/conf/seasonal_naive/finetune/data/electricity.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/data/electricity.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/data/electricity.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/data/electricity.yaml diff --git a/cli/conf/seasonal_naive/finetune/data/etth1.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/data/etth1.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/data/etth1.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/data/etth1.yaml diff --git a/cli/conf/seasonal_naive/finetune/data/etth2.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/data/etth2.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/data/etth2.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/data/etth2.yaml diff --git a/cli/conf/seasonal_naive/finetune/data/ettm1.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/data/ettm1.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/data/ettm1.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/data/ettm1.yaml diff --git a/cli/conf/seasonal_naive/finetune/data/ettm2.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/data/ettm2.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/data/ettm2.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/data/ettm2.yaml diff --git a/cli/conf/seasonal_naive/finetune/data/weather.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/data/weather.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/data/weather.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/data/weather.yaml diff --git a/cli/conf/seasonal_naive/finetune/default.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/default.yaml similarity index 92% rename from cli/conf/seasonal_naive/finetune/default.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/default.yaml index a4df29f..cb969c2 100644 --- a/cli/conf/seasonal_naive/finetune/default.yaml +++ b/cli/conf/lsf-setup/seasonal_naive/finetune/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/seasonal_naive/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} + dir: outputs/lsf-setup/seasonal_naive/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} defaults: - model: ??? - data: ??? diff --git a/cli/conf/seasonal_naive/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/model/moirai_1.1_R_small.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/model/moirai_1.1_R_small.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/model/moirai_1.1_R_small.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/electricity.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/electricity.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/electricity.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/electricity.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/etth1.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/etth1.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/etth1.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/etth1.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/etth1_multi.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/etth1_multi.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/etth1_multi.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/etth1_multi.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/etth2.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/etth2.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/etth2.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/etth2.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/ettm1.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/ettm1.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/ettm1.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/ettm1.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/ettm2.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/ettm2.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/ettm2.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/ettm2.yaml diff --git a/cli/conf/seasonal_naive/finetune/val_data/weather.yaml b/cli/conf/lsf-setup/seasonal_naive/finetune/val_data/weather.yaml similarity index 100% rename from cli/conf/seasonal_naive/finetune/val_data/weather.yaml rename to cli/conf/lsf-setup/seasonal_naive/finetune/val_data/weather.yaml diff --git a/cli/conf/pf-setup/origin/eval/data/gluonts_test.yaml b/cli/conf/pf-setup/origin/eval/data/gluonts_test.yaml new file mode 100644 index 0000000..4e713bf --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/data/gluonts_test.yaml @@ -0,0 +1,4 @@ +_target_: uni2ts.eval_util.data.get_gluonts_test_dataset +dataset_name: ??? +prediction_length: null +mode: S \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/data/gluonts_val.yaml b/cli/conf/pf-setup/origin/eval/data/gluonts_val.yaml new file mode 100644 index 0000000..d2079ce --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/data/gluonts_val.yaml @@ -0,0 +1,4 @@ +_target_: uni2ts.eval_util.data.get_gluonts_val_dataset +dataset_name: ??? +prediction_length: null +mode: S \ No newline at end of file diff --git a/cli/conf/seasonal_naive/eval/default.yaml b/cli/conf/pf-setup/origin/eval/default.yaml similarity index 79% rename from cli/conf/seasonal_naive/eval/default.yaml rename to cli/conf/pf-setup/origin/eval/default.yaml index 79ee9c2..3b7d532 100644 --- a/cli/conf/seasonal_naive/eval/default.yaml +++ b/cli/conf/pf-setup/origin/eval/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/seasonal_naive/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} + dir: outputs/pf-setup/origin/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} defaults: - model: ??? - data: ??? diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_base.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_base.yaml new file mode 100644 index 0000000..37ba483 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_base.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-base +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_large.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_large.yaml new file mode 100644 index 0000000..8d899d2 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_large.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-large +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_small.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_small.yaml new file mode 100644 index 0000000..302dce8 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_1.0_R_small.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-small +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_base.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_base.yaml new file mode 100644 index 0000000..52885b6 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_base.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-base +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_large.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_large.yaml new file mode 100644 index 0000000..5bbc9f3 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_large.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-large +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_small.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_small.yaml new file mode 100644 index 0000000..9fb5f26 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_1.1_R_small.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-small +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/pf-setup/origin/eval/model/moirai_lightning_ckpt.yaml new file mode 100644 index 0000000..33fa213 --- /dev/null +++ b/cli/conf/pf-setup/origin/eval/model/moirai_lightning_ckpt.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.model.moirai.MoiraiForecast.load_from_checkpoint +checkpoint_path: ... +pretrained_checkpoint_path: null +num_samples: 100 +patch_size: ??? +context_length: ??? diff --git a/cli/conf/pf-setup/origin/finetune/data/electricity.yaml b/cli/conf/pf-setup/origin/finetune/data/electricity.yaml new file mode 100644 index 0000000..4fb675b --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/data/electricity.yaml @@ -0,0 +1,2 @@ +_target_: uni2ts.data.builder.simple.SimpleDatasetBuilder +dataset: electricity diff --git a/cli/conf/pf-setup/origin/finetune/data/etth1.yaml b/cli/conf/pf-setup/origin/finetune/data/etth1.yaml new file mode 100644 index 0000000..48c2bac --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/data/etth1.yaml @@ -0,0 +1,2 @@ +_target_: uni2ts.data.builder.simple.SimpleDatasetBuilder +dataset: ETTh1 \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/data/etth2.yaml b/cli/conf/pf-setup/origin/finetune/data/etth2.yaml new file mode 100644 index 0000000..13d29d6 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/data/etth2.yaml @@ -0,0 +1,2 @@ +_target_: uni2ts.data.builder.simple.SimpleDatasetBuilder +dataset: ETTh2 diff --git a/cli/conf/pf-setup/origin/finetune/data/ettm1.yaml b/cli/conf/pf-setup/origin/finetune/data/ettm1.yaml new file mode 100644 index 0000000..df066af --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/data/ettm1.yaml @@ -0,0 +1,2 @@ +_target_: uni2ts.data.builder.simple.SimpleDatasetBuilder +dataset: ETTm1 diff --git a/cli/conf/pf-setup/origin/finetune/data/ettm2.yaml b/cli/conf/pf-setup/origin/finetune/data/ettm2.yaml new file mode 100644 index 0000000..5ffbcc5 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/data/ettm2.yaml @@ -0,0 +1,2 @@ +_target_: uni2ts.data.builder.simple.SimpleDatasetBuilder +dataset: ETTm2 diff --git a/cli/conf/pf-setup/origin/finetune/data/weather.yaml b/cli/conf/pf-setup/origin/finetune/data/weather.yaml new file mode 100644 index 0000000..41d5b06 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/data/weather.yaml @@ -0,0 +1,2 @@ +_target_: uni2ts.data.builder.simple.SimpleDatasetBuilder +dataset: weather diff --git a/cli/conf/origin/finetune/default.yaml b/cli/conf/pf-setup/origin/finetune/default.yaml similarity index 100% rename from cli/conf/origin/finetune/default.yaml rename to cli/conf/pf-setup/origin/finetune/default.yaml diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_base.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_base.yaml new file mode 100644 index 0000000..96e5c4e --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_base.yaml @@ -0,0 +1,33 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.moirai.MoiraiFinetune +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-base +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 768 + num_layers: 12 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_large.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_large.yaml new file mode 100644 index 0000000..991ba8d --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_large.yaml @@ -0,0 +1,33 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.moirai.MoiraiFinetune +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-large +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 1024 + num_layers: 24 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_small.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_small.yaml new file mode 100644 index 0000000..9f799d7 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_1.0_R_small.yaml @@ -0,0 +1,37 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.moirai.MoiraiFinetune +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-small +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 384 + num_layers: 6 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +val_metric: + - _target_: uni2ts.loss.packed.PackedMSELoss + - _target_: uni2ts.loss.packed.PackedNRMSELoss + normalize: absolute_target_squared +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_base.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_base.yaml new file mode 100644 index 0000000..b9fb771 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_base.yaml @@ -0,0 +1,33 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.moirai.MoiraiFinetune +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-base +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 768 + num_layers: 12 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_large.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_large.yaml new file mode 100644 index 0000000..586b772 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_large.yaml @@ -0,0 +1,33 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.moirai.MoiraiFinetune +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-large +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 1024 + num_layers: 24 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_small.yaml new file mode 100644 index 0000000..8ded8b2 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_1.1_R_small.yaml @@ -0,0 +1,41 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.moirai.MoiraiFinetune +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-small +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 384 + num_layers: 6 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +val_metric: + - _target_: uni2ts.loss.packed.PackedMSELoss + - _target_: uni2ts.loss.packed.PackedNRMSELoss + normalize: absolute_target_squared +lr: 1e-5 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 +patch_size: null +context_length: null +prediction_length: null +finetune_pattern: full \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_base.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_base.yaml new file mode 100644 index 0000000..8962bb3 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_base.yaml @@ -0,0 +1,31 @@ +# load a pytorch lightning checkpoint +_target_: uni2ts.model.moirai.MoiraiFinetune.load_from_checkpoint +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 768 + num_layers: 12 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 +checkpoint_path: ... \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_large.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_large.yaml new file mode 100644 index 0000000..d52f67f --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_large.yaml @@ -0,0 +1,31 @@ +# load a pytorch lightning checkpoint +_target_: uni2ts.model.moirai.MoiraiFinetune.load_from_checkpoint +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 1024 + num_layers: 24 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 +checkpoint_path: ... \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/model/moirai_small.yaml b/cli/conf/pf-setup/origin/finetune/model/moirai_small.yaml new file mode 100644 index 0000000..741e08f --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/model/moirai_small.yaml @@ -0,0 +1,35 @@ +# load a pytorch lightning checkpoint +_target_: uni2ts.model.moirai.MoiraiFinetune.load_from_checkpoint +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 384 + num_layers: 6 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +val_metric: + - _target_: uni2ts.loss.packed.PackedMSELoss + - _target_: uni2ts.loss.packed.PackedNRMSELoss + normalize: absolute_target_squared +lr: 1e-3 +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: ${mul:${trainer.max_epochs},${train_dataloader.num_batches_per_epoch}} +num_warmup_steps: 0 +checkpoint_path: ... \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/val_data/electricity.yaml b/cli/conf/pf-setup/origin/finetune/val_data/electricity.yaml new file mode 100644 index 0000000..61e8c7e --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/val_data/electricity.yaml @@ -0,0 +1,13 @@ +_target_: uni2ts.data.builder.ConcatDatasetBuilder +_args_: + _target_: uni2ts.data.builder.simple.generate_eval_builders + dataset: electricity_eval + offset: 18412 # Same as _lsf_dataset.py + eval_length: 2630 # Same as _lsf_dataset.py, test_length=5260 + prediction_lengths: ??? + context_lengths: ??? + patch_sizes: ??? + +# prediction_lengths: [96, 192, 336, 720] +# context_lengths: [3000] +# patch_sizes: [32, 64] # freq='h' \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/val_data/etth1.yaml b/cli/conf/pf-setup/origin/finetune/val_data/etth1.yaml new file mode 100644 index 0000000..752129a --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/val_data/etth1.yaml @@ -0,0 +1,9 @@ +_target_: uni2ts.data.builder.ConcatDatasetBuilder +_args_: + _target_: uni2ts.data.builder.simple.generate_eval_builders + dataset: ETTh1_eval + offset: 8640 + eval_length: 2880 + prediction_lengths: [96, 192, 336, 720] + context_lengths: [1000, 2000, 3000, 4000, 5000] + patch_sizes: [32, 64] \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/val_data/etth2.yaml b/cli/conf/pf-setup/origin/finetune/val_data/etth2.yaml new file mode 100644 index 0000000..5fc653c --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/val_data/etth2.yaml @@ -0,0 +1,13 @@ +_target_: uni2ts.data.builder.ConcatDatasetBuilder +_args_: + _target_: uni2ts.data.builder.simple.generate_eval_builders + dataset: ETTh2_eval + offset: 8640 # Same as _lsf_dataset.py + eval_length: 2880 # Same as _lsf_dataset.py + prediction_lengths: ??? + context_lengths: ??? + patch_sizes: ??? + +# prediction_lengths: [ 96, 192, 336, 720 ] +# context_lengths: [ 3000 ] +# patch_sizes: [ 32, 64 ] diff --git a/cli/conf/pf-setup/origin/finetune/val_data/ettm1.yaml b/cli/conf/pf-setup/origin/finetune/val_data/ettm1.yaml new file mode 100644 index 0000000..e6a15b4 --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/val_data/ettm1.yaml @@ -0,0 +1,14 @@ +_target_: uni2ts.data.builder.ConcatDatasetBuilder +_args_: + _target_: uni2ts.data.builder.simple.generate_eval_builders + dataset: ETTm1_eval + offset: 34560 # Same as _lsf_dataset.py + eval_length: 11520 # Same as _lsf_dataset.py + prediction_lengths: ??? + context_lengths: ??? + patch_sizes: ??? + + +# prediction_lengths: [96, 192, 336, 720] +# context_lengths: [ 3000 ] +# patch_sizes: [ 32, 64, 128 ] # freq="15T" \ No newline at end of file diff --git a/cli/conf/pf-setup/origin/finetune/val_data/ettm2.yaml b/cli/conf/pf-setup/origin/finetune/val_data/ettm2.yaml new file mode 100644 index 0000000..cb070fd --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/val_data/ettm2.yaml @@ -0,0 +1,14 @@ +_target_: uni2ts.data.builder.ConcatDatasetBuilder +_args_: + _target_: uni2ts.data.builder.simple.generate_eval_builders + dataset: ETTm2_eval + offset: 34560 # Same as _lsf_dataset.py + eval_length: 11520 # Same as _lsf_dataset.py + prediction_lengths: ??? + context_lengths: ??? + patch_sizes: ??? + + +# prediction_lengths: [96, 192, 336, 720] +# context_lengths: [3000] +# patch_sizes: [32, 64, 128] # "freq=15T" diff --git a/cli/conf/pf-setup/origin/finetune/val_data/weather.yaml b/cli/conf/pf-setup/origin/finetune/val_data/weather.yaml new file mode 100644 index 0000000..8f1973e --- /dev/null +++ b/cli/conf/pf-setup/origin/finetune/val_data/weather.yaml @@ -0,0 +1,9 @@ +_target_: uni2ts.data.builder.ConcatDatasetBuilder +_args_: + _target_: uni2ts.data.builder.simple.generate_eval_builders + dataset: weather_eval + offset: 36887 # Same as _lsf_dataset.py + eval_length: 5269 # Same as _lsf_dataset.py; test_length=10539 + prediction_lengths: ??? + context_lengths: ??? + patch_sizes: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/data/gluonts_test.yaml b/cli/conf/pf-setup/pf/eval/data/gluonts_test.yaml new file mode 100644 index 0000000..4e713bf --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/data/gluonts_test.yaml @@ -0,0 +1,4 @@ +_target_: uni2ts.eval_util.data.get_gluonts_test_dataset +dataset_name: ??? +prediction_length: null +mode: S \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/data/gluonts_val.yaml b/cli/conf/pf-setup/pf/eval/data/gluonts_val.yaml new file mode 100644 index 0000000..d2079ce --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/data/gluonts_val.yaml @@ -0,0 +1,4 @@ +_target_: uni2ts.eval_util.data.get_gluonts_val_dataset +dataset_name: ??? +prediction_length: null +mode: S \ No newline at end of file diff --git a/cli/conf/multi_scale/eval/default.yaml b/cli/conf/pf-setup/pf/eval/default.yaml similarity index 89% rename from cli/conf/multi_scale/eval/default.yaml rename to cli/conf/pf-setup/pf/eval/default.yaml index d3ff473..d15b5e1 100644 --- a/cli/conf/multi_scale/eval/default.yaml +++ b/cli/conf/pf-setup/pf/eval/default.yaml @@ -1,6 +1,6 @@ hydra: run: - dir: outputs/multi_scale/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} + dir: outputs/pf-setup/pf/eval/${hydra:runtime.choices.model}/${exp_name}/${data.dataset_name}/${data.mode}/cl${model.context_length}_pl${data.prediction_length} defaults: - model: ??? - data: ??? @@ -19,6 +19,6 @@ metrics: - _target_: gluonts.ev.metrics.ND - _target_: gluonts.ev.metrics.MeanWeightedSumQuantileLoss quantile_levels: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] -batch_size: 512 # 16 +batch_size: 512 min_batch_size: 16 device: auto \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_base.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_base.yaml new file mode 100644 index 0000000..37ba483 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_base.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-base +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_large.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_large.yaml new file mode 100644 index 0000000..8d899d2 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_large.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-large +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_small.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_small.yaml new file mode 100644 index 0000000..302dce8 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_1.0_R_small.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.0-R-small +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_base.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_base.yaml new file mode 100644 index 0000000..52885b6 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_base.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-base +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_large.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_large.yaml new file mode 100644 index 0000000..5bbc9f3 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_large.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-large +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_small.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_small.yaml new file mode 100644 index 0000000..9fb5f26 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_1.1_R_small.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.model.moirai.MoiraiForecast +module: + _target_: uni2ts.model.moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-small +num_samples: 100 +patch_size: ??? +context_length: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/eval/model/moirai_lightning_ckpt.yaml b/cli/conf/pf-setup/pf/eval/model/moirai_lightning_ckpt.yaml new file mode 100644 index 0000000..5242214 --- /dev/null +++ b/cli/conf/pf-setup/pf/eval/model/moirai_lightning_ckpt.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.model.lsf_moirai.MoiraiForecast.load_from_checkpoint +checkpoint_path: ... +pretrained_checkpoint_path: null +num_samples: 100 +patch_size: ??? +context_length: ??? diff --git a/cli/conf/pf-setup/pf/finetune/data/bizitobs_l2c.yaml b/cli/conf/pf-setup/pf/finetune/data/bizitobs_l2c.yaml new file mode 100644 index 0000000..a2dbabd --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/data/bizitobs_l2c.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.data.builder.pf_simple.generate_finetune_builder +dataset: bizitobs_l2c +train_length: 30960 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/data/electricity.yaml b/cli/conf/pf-setup/pf/finetune/data/electricity.yaml new file mode 100644 index 0000000..77b629e --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/data/electricity.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.data.builder.pf_simple.generate_finetune_builder +dataset: electricity +train_length: 26112 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/data/istanbul_traffic.yaml b/cli/conf/pf-setup/pf/finetune/data/istanbul_traffic.yaml new file mode 100644 index 0000000..63bb62f --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/data/istanbul_traffic.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.data.builder.pf_simple.generate_finetune_builder +dataset: istanbul_traffic +train_length: 14052 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/data/jena_weather.yaml b/cli/conf/pf-setup/pf/finetune/data/jena_weather.yaml new file mode 100644 index 0000000..ab698ad --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/data/jena_weather.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.data.builder.pf_simple.generate_finetune_builder +dataset: jena_weather +train_length: 51544 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/data/solar-energy.yaml b/cli/conf/pf-setup/pf/finetune/data/solar-energy.yaml new file mode 100644 index 0000000..93d26f3 --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/data/solar-energy.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.data.builder.pf_simple.generate_finetune_builder +dataset: solar-energy +train_length: 8568 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/data/turkey_power.yaml b/cli/conf/pf-setup/pf/finetune/data/turkey_power.yaml new file mode 100644 index 0000000..c39a05e --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/data/turkey_power.yaml @@ -0,0 +1,6 @@ +_target_: uni2ts.data.builder.pf_simple.generate_finetune_builder +dataset: turkey_power +train_length: 26112 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/default.yaml b/cli/conf/pf-setup/pf/finetune/default.yaml new file mode 100644 index 0000000..4c3642e --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/default.yaml @@ -0,0 +1,77 @@ +hydra: + run: + dir: outputs/pf-setup/pf/finetune/${hydra:runtime.choices.model}/${exp_name}/${model.finetune_pattern}/${hydra:runtime.choices.data}/${run_name} +defaults: + - model: ??? + - data: ??? + - val_data: null + - _self_ +exp_name: ??? +run_name: ??? +seed: 0 +tf32: true +compile: false # set to mode: default, reduce-overhead, max-autotune +ckpt_path: null +trainer: + _target_: lightning.Trainer + accelerator: auto + strategy: auto + devices: auto + num_nodes: 1 + precision: 32 + logger: + _target_: lightning.pytorch.loggers.TensorBoardLogger + save_dir: ${hydra:runtime.output_dir} + name: logs + callbacks: + - _target_: lightning.pytorch.callbacks.LearningRateMonitor + logging_interval: epoch + - _target_: lightning.pytorch.callbacks.ModelCheckpoint + dirpath: ${hydra:runtime.output_dir}/checkpoints + monitor: val/PackedNLLLoss + save_weights_only: true + mode: min + save_top_k: 1 + every_n_epochs: 1 + - _target_: lightning.pytorch.callbacks.EarlyStopping # uni2ts.callbacks.earlystop.WarmupEarlyStopping + monitor: val/PackedNLLLoss + min_delta: 0.0 + patience: 3 + mode: min + strict: false + verbose: true +# warmup_steps: 1 + + max_epochs: 1000 + enable_progress_bar: true + accumulate_grad_batches: 1 + gradient_clip_val: 1.0 + gradient_clip_algorithm: norm +train_dataloader: + _target_: uni2ts.data.loader.DataLoader + batch_size: 512 + batch_size_factor: 2.0 + cycle: false + num_batches_per_epoch: null + shuffle: true + num_workers: 11 + pin_memory: true + drop_last: false + fill_last: false + worker_init_fn: null + prefetch_factor: 2 + persistent_workers: true +val_dataloader: + _target_: uni2ts.data.loader.DataLoader + batch_size: 32 + batch_size_factor: 2.0 + cycle: false + num_batches_per_epoch: null + shuffle: false + num_workers: 11 + pin_memory: false + drop_last: false + fill_last: false + worker_init_fn: null + prefetch_factor: 2 + persistent_workers: true \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/finetune/model/moirai_1.1_R_small.yaml b/cli/conf/pf-setup/pf/finetune/model/moirai_1.1_R_small.yaml new file mode 100644 index 0000000..a8800a2 --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/model/moirai_1.1_R_small.yaml @@ -0,0 +1,41 @@ +# load a pretrained checkpoint from huggingface hub +_target_: uni2ts.model.lsf_moirai.MoiraiFinetune +module: + _target_: uni2ts.model.lsf_moirai.MoiraiModule.from_pretrained + pretrained_model_name_or_path: Salesforce/moirai-1.1-R-small +module_kwargs: + _target_: builtins.dict + distr_output: + _target_: uni2ts.distribution.MixtureOutput + components: + - _target_: uni2ts.distribution.StudentTOutput + - _target_: uni2ts.distribution.NormalFixedScaleOutput + - _target_: uni2ts.distribution.NegativeBinomialOutput + - _target_: uni2ts.distribution.LogNormalOutput + d_model: 384 + num_layers: 6 + patch_sizes: ${as_tuple:[8, 16, 32, 64, 128]} + max_seq_len: 512 + attn_dropout_p: 0.0 + dropout_p: 0.0 + scaling: true +min_patches: 2 +min_mask_ratio: 0.15 +max_mask_ratio: 0.5 +max_dim: 128 +loss_func: + _target_: uni2ts.loss.packed.PackedNLLLoss +val_metric: + - _target_: uni2ts.loss.packed.PackedMSELoss + - _target_: uni2ts.loss.packed.PackedNRMSELoss + normalize: absolute_target_squared +lr: 5e-7 # On ETT dataset, using 1e-6/5e-7 converge within 1-2 epochs. 1e-7 converge in tens of epochs +weight_decay: 1e-1 +beta1: 0.9 +beta2: 0.98 +num_training_steps: null +num_warmup_steps: 0 +patch_size: null +context_length: null +prediction_length: null +finetune_pattern: full \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/finetune/val_data/bizitobs_l2c.yaml b/cli/conf/pf-setup/pf/finetune/val_data/bizitobs_l2c.yaml new file mode 100644 index 0000000..e832bea --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/val_data/bizitobs_l2c.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.data.builder.pf_simple.generate_eval_builder +dataset: bizitobs_l2c_eval +offset: 30960 +eval_length: 48 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/val_data/electricity.yaml b/cli/conf/pf-setup/pf/finetune/val_data/electricity.yaml new file mode 100644 index 0000000..d8c8e7a --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/val_data/electricity.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.data.builder.pf_simple.generate_eval_builder +dataset: electricity_eval +offset: 26112 +eval_length: 24 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/val_data/istanbul_traffic.yaml b/cli/conf/pf-setup/pf/finetune/val_data/istanbul_traffic.yaml new file mode 100644 index 0000000..483c1b9 --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/val_data/istanbul_traffic.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.data.builder.pf_simple.generate_eval_builder +dataset: istanbul_traffic_eval +offset: 14052 +eval_length: 24 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/val_data/jena_weather.yaml b/cli/conf/pf-setup/pf/finetune/val_data/jena_weather.yaml new file mode 100644 index 0000000..63ca811 --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/val_data/jena_weather.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.data.builder.pf_simple.generate_eval_builder +dataset: jena_weather_eval +offset: 51544 +eval_length: 144 +prediction_length: ??? +context_length: ??? +patch_size: ??? \ No newline at end of file diff --git a/cli/conf/pf-setup/pf/finetune/val_data/solar-energy.yaml b/cli/conf/pf-setup/pf/finetune/val_data/solar-energy.yaml new file mode 100644 index 0000000..5ec7cad --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/val_data/solar-energy.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.data.builder.pf_simple.generate_eval_builder +dataset: solar-energy_eval +offset: 8568 +eval_length: 24 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/conf/pf-setup/pf/finetune/val_data/turkey_power.yaml b/cli/conf/pf-setup/pf/finetune/val_data/turkey_power.yaml new file mode 100644 index 0000000..0013492 --- /dev/null +++ b/cli/conf/pf-setup/pf/finetune/val_data/turkey_power.yaml @@ -0,0 +1,7 @@ +_target_: uni2ts.data.builder.pf_simple.generate_eval_builder +dataset: turkey_power_eval +offset: 26112 +eval_length: 24 +prediction_length: ??? +context_length: ??? +patch_size: ??? diff --git a/cli/eval.py b/cli/eval.py index 2958192..92225dc 100644 --- a/cli/eval.py +++ b/cli/eval.py @@ -26,7 +26,7 @@ from uni2ts.eval_util.evaluation import evaluate_model -@hydra.main(version_base="1.3", config_path="conf/origin/eval", config_name="default") +@hydra.main(version_base="1.3", config_path="conf/lsf-setup/origin/eval", config_name="default") def main(cfg: DictConfig): # Set display options pd.set_option("display.max_columns", None) diff --git a/project/build_lsf_ft_datasets.sh b/project/lsf-setup/build_lsf_ft_datasets.sh similarity index 100% rename from project/build_lsf_ft_datasets.sh rename to project/lsf-setup/build_lsf_ft_datasets.sh diff --git a/project/lsf/eval/small/electricity.sh b/project/lsf-setup/lsf/eval/small/electricity.sh similarity index 85% rename from project/lsf/eval/small/electricity.sh rename to project/lsf-setup/lsf/eval/small/electricity.sh index 7230f98..bcc98db 100644 --- a/project/lsf/eval/small/electricity.sh +++ b/project/lsf-setup/lsf/eval/small/electricity.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf/eval +cp=conf/lsf-setup/lsf/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf/eval/small/etth1.sh b/project/lsf-setup/lsf/eval/small/etth1.sh similarity index 90% rename from project/lsf/eval/small/etth1.sh rename to project/lsf-setup/lsf/eval/small/etth1.sh index 55a0fd1..f120a40 100644 --- a/project/lsf/eval/small/etth1.sh +++ b/project/lsf-setup/lsf/eval/small/etth1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf/eval +cp=conf/lsf-setup/lsf/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf/eval/small/etth2.sh b/project/lsf-setup/lsf/eval/small/etth2.sh similarity index 90% rename from project/lsf/eval/small/etth2.sh rename to project/lsf-setup/lsf/eval/small/etth2.sh index f610854..2bdcd6d 100644 --- a/project/lsf/eval/small/etth2.sh +++ b/project/lsf-setup/lsf/eval/small/etth2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf/eval +cp=conf/lsf-setup/lsf/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf/eval/small/ettm1.sh b/project/lsf-setup/lsf/eval/small/ettm1.sh similarity index 88% rename from project/lsf/eval/small/ettm1.sh rename to project/lsf-setup/lsf/eval/small/ettm1.sh index 8988338..4e6424f 100644 --- a/project/lsf/eval/small/ettm1.sh +++ b/project/lsf-setup/lsf/eval/small/ettm1.sh @@ -1,10 +1,10 @@ #!/bin/bash export HYDRA_FULL_ERROR=1 -export CUDA_VISIBLE_DEVICES=0 +export CUDA_VISIBLE_DEVICES=1 mode=S -cp=conf/lsf/eval +cp=conf/lsf-setup/lsf/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf_point/eval/small/ettm2.sh b/project/lsf-setup/lsf/eval/small/ettm2.sh similarity index 51% rename from project/lsf_point/eval/small/ettm2.sh rename to project/lsf-setup/lsf/eval/small/ettm2.sh index c0d2332..7cd9597 100644 --- a/project/lsf_point/eval/small/ettm2.sh +++ b/project/lsf-setup/lsf/eval/small/ettm2.sh @@ -4,16 +4,16 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=1 mode=S -cp=conf/lsf_point/eval +cp=conf/lsf-setup/lsf/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt -cpp1='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm2/cl3000_pl96/checkpoints/epoch_13-step_3024.ckpt' -cpp2='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm2/cl3000_pl192/checkpoints/epoch_6-step_1505.ckpt' -cpp3='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm2/cl3000_pl336/checkpoints/epoch_5-step_1284.ckpt' -cpp4='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm2/cl3000_pl720/checkpoints/epoch_5-step_1266.ckpt' +cpp1='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/2_fc_head_ctx_dp0/ettm2/cl3000_pl96/checkpoints/epoch_11-step_2592.ckpt' +cpp2='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/2_fc_head_ctx_dp0/ettm2/cl3000_pl192/checkpoints/epoch_6-step_1505.ckpt' +cpp3='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/2_fc_head_ctx_dp0/ettm2/cl3000_pl336/checkpoints/epoch_4-step_1070.ckpt' +cpp4='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/2_fc_head_ctx_dp0/ettm2/cl3000_pl720/checkpoints/epoch_3-step_844.ckpt' index=1 @@ -25,8 +25,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf/eval/small/run_multi.sh b/project/lsf-setup/lsf/eval/small/run_multi.sh similarity index 100% rename from project/lsf/eval/small/run_multi.sh rename to project/lsf-setup/lsf/eval/small/run_multi.sh diff --git a/project/lsf/eval/small/weather.sh b/project/lsf-setup/lsf/eval/small/weather.sh similarity index 90% rename from project/lsf/eval/small/weather.sh rename to project/lsf-setup/lsf/eval/small/weather.sh index d868379..601b448 100644 --- a/project/lsf/eval/small/weather.sh +++ b/project/lsf-setup/lsf/eval/small/weather.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=1 mode=S -cp=conf/lsf/eval +cp=conf/lsf-setup/lsf/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 ; do # 720 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/multi_scale/finetune/small/electricity.sh b/project/lsf-setup/lsf/finetune/small/electricity.sh similarity index 95% rename from project/multi_scale/finetune/small/electricity.sh rename to project/lsf-setup/lsf/finetune/small/electricity.sh index a8be605..24856d8 100644 --- a/project/multi_scale/finetune/small/electricity.sh +++ b/project/lsf-setup/lsf/finetune/small/electricity.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/multi_scale/finetune +cp=conf/lsf-setup/lsf/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf/finetune/small/etth1.sh b/project/lsf-setup/lsf/finetune/small/etth1.sh similarity index 95% rename from project/lsf/finetune/small/etth1.sh rename to project/lsf-setup/lsf/finetune/small/etth1.sh index 767b593..fe8ded4 100644 --- a/project/lsf/finetune/small/etth1.sh +++ b/project/lsf-setup/lsf/finetune/small/etth1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf/finetune +cp=conf/lsf-setup/lsf/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf/finetune/small/etth2.sh b/project/lsf-setup/lsf/finetune/small/etth2.sh similarity index 95% rename from project/lsf/finetune/small/etth2.sh rename to project/lsf-setup/lsf/finetune/small/etth2.sh index 4526393..ece92fd 100644 --- a/project/lsf/finetune/small/etth2.sh +++ b/project/lsf-setup/lsf/finetune/small/etth2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf/finetune +cp=conf/lsf-setup/lsf/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf/finetune/small/ettm1.sh b/project/lsf-setup/lsf/finetune/small/ettm1.sh similarity index 92% rename from project/lsf/finetune/small/ettm1.sh rename to project/lsf-setup/lsf/finetune/small/ettm1.sh index 8fc619e..05cc654 100644 --- a/project/lsf/finetune/small/ettm1.sh +++ b/project/lsf-setup/lsf/finetune/small/ettm1.sh @@ -3,10 +3,10 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; model=moirai_1.1_R_small -cp=conf/lsf/finetune +cp=conf/lsf-setup/lsf/finetune exp_name=lsf cl=3000 -ft_pattern=full +ft_pattern=param_proj data=ettm1 ps=128 diff --git a/project/lsf/finetune/small/ettm2.sh b/project/lsf-setup/lsf/finetune/small/ettm2.sh similarity index 92% rename from project/lsf/finetune/small/ettm2.sh rename to project/lsf-setup/lsf/finetune/small/ettm2.sh index 2bf3957..85023d5 100644 --- a/project/lsf/finetune/small/ettm2.sh +++ b/project/lsf-setup/lsf/finetune/small/ettm2.sh @@ -3,10 +3,10 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; model=moirai_1.1_R_small -cp=conf/lsf/finetune +cp=conf/lsf-setup/lsf/finetune exp_name=lsf cl=3000 -ft_pattern=full +ft_pattern=param_proj data=ettm2 ps=64 diff --git a/project/lsf/finetune/small/run_multi.sh b/project/lsf-setup/lsf/finetune/small/run_multi.sh similarity index 100% rename from project/lsf/finetune/small/run_multi.sh rename to project/lsf-setup/lsf/finetune/small/run_multi.sh diff --git a/project/lsf/finetune/small/weather.sh b/project/lsf-setup/lsf/finetune/small/weather.sh similarity index 95% rename from project/lsf/finetune/small/weather.sh rename to project/lsf-setup/lsf/finetune/small/weather.sh index fd73cc2..1433305 100644 --- a/project/lsf/finetune/small/weather.sh +++ b/project/lsf-setup/lsf/finetune/small/weather.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf/finetune +cp=conf/lsf-setup/lsf/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf_point/eval/small/electricity.sh b/project/lsf-setup/lsf_point/eval/small/electricity.sh similarity index 85% rename from project/lsf_point/eval/small/electricity.sh rename to project/lsf-setup/lsf_point/eval/small/electricity.sh index 1ddde72..fd0909d 100644 --- a/project/lsf_point/eval/small/electricity.sh +++ b/project/lsf-setup/lsf_point/eval/small/electricity.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf_point/eval +cp=conf/lsf-setup/lsf_point/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf_point/eval/small/etth1.sh b/project/lsf-setup/lsf_point/eval/small/etth1.sh similarity index 90% rename from project/lsf_point/eval/small/etth1.sh rename to project/lsf-setup/lsf_point/eval/small/etth1.sh index 74b2307..d3ee7ec 100644 --- a/project/lsf_point/eval/small/etth1.sh +++ b/project/lsf-setup/lsf_point/eval/small/etth1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf_point/eval +cp=conf/lsf-setup/lsf_point/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf_point/eval/small/etth2.sh b/project/lsf-setup/lsf_point/eval/small/etth2.sh similarity index 89% rename from project/lsf_point/eval/small/etth2.sh rename to project/lsf-setup/lsf_point/eval/small/etth2.sh index e008f2c..2ea2f48 100644 --- a/project/lsf_point/eval/small/etth2.sh +++ b/project/lsf-setup/lsf_point/eval/small/etth2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf_point/eval +cp=conf/lsf-setup/lsf_point/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf-setup/lsf_point/eval/small/ettm1.sh b/project/lsf-setup/lsf_point/eval/small/ettm1.sh new file mode 100644 index 0000000..7f20f82 --- /dev/null +++ b/project/lsf-setup/lsf_point/eval/small/ettm1.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=3 + +mode=S +cp=conf/lsf-setup/lsf_point/eval +exp_name=lsf +cl=3000 +model=moirai_lightning_ckpt + + +cpp1='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm1/cl3000_pl96/checkpoints/epoch_32-step_7128.ckpt' +cpp2='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm1/cl3000_pl192/checkpoints/epoch_16-step_3655.ckpt' +cpp3='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm1/cl3000_pl336/checkpoints/epoch_11-step_2568.ckpt' +cpp4='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm1/cl3000_pl720/checkpoints/epoch_6-step_1477.ckpt' + + +index=1 +for pl in 96 192 336 720; do + case $index in + 1) cpp=$cpp1 ;; + 2) cpp=$cpp2 ;; + 3) cpp=$cpp3 ;; + 4) cpp=$cpp4 ;; + esac + + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) + + python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=128 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=lsf_test \ + data.dataset_name=ETTm1 \ + data.mode=$mode \ + data.prediction_length=$pl + + index=$((index+1)) +done diff --git a/project/lsf-setup/lsf_point/eval/small/ettm2.sh b/project/lsf-setup/lsf_point/eval/small/ettm2.sh new file mode 100644 index 0000000..b332a74 --- /dev/null +++ b/project/lsf-setup/lsf_point/eval/small/ettm2.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=2 + +mode=S +cp=conf/lsf-setup/lsf_point/eval +exp_name=lsf +cl=3000 +model=moirai_lightning_ckpt + + +cpp1='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm2/cl3000_pl96/checkpoints/epoch_22-step_4968.ckpt' +cpp2='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm2/cl3000_pl192/checkpoints/epoch_13-step_3010.ckpt' +cpp3='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm2/cl3000_pl336/checkpoints/epoch_10-step_2354.ckpt' +cpp4='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/cnn_head_flat/ettm2/cl3000_pl720/checkpoints/epoch_8-step_1899.ckpt' + + +index=1 +for pl in 96 192 336 720; do + case $index in + 1) cpp=$cpp1 ;; + 2) cpp=$cpp2 ;; + 3) cpp=$cpp3 ;; + 4) cpp=$cpp4 ;; + esac + + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) + + python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=64 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=lsf_test \ + data.dataset_name=ETTm2 \ + data.mode=$mode \ + data.prediction_length=$pl + + index=$((index+1)) +done diff --git a/project/lsf_point/eval/small/run_multi.sh b/project/lsf-setup/lsf_point/eval/small/run_multi.sh similarity index 100% rename from project/lsf_point/eval/small/run_multi.sh rename to project/lsf-setup/lsf_point/eval/small/run_multi.sh diff --git a/project/lsf_point/eval/small/weather.sh b/project/lsf-setup/lsf_point/eval/small/weather.sh similarity index 90% rename from project/lsf_point/eval/small/weather.sh rename to project/lsf-setup/lsf_point/eval/small/weather.sh index d1922cf..32dcc74 100644 --- a/project/lsf_point/eval/small/weather.sh +++ b/project/lsf-setup/lsf_point/eval/small/weather.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/lsf_point/eval +cp=conf/lsf-setup/lsf_point/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf_point/finetune/small/electricity.sh b/project/lsf-setup/lsf_point/finetune/small/electricity.sh similarity index 94% rename from project/lsf_point/finetune/small/electricity.sh rename to project/lsf-setup/lsf_point/finetune/small/electricity.sh index 11b7902..64c1379 100644 --- a/project/lsf_point/finetune/small/electricity.sh +++ b/project/lsf-setup/lsf_point/finetune/small/electricity.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf_point/finetune +cp=conf/lsf-setup/lsf_point/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf_point/finetune/small/etth1.sh b/project/lsf-setup/lsf_point/finetune/small/etth1.sh similarity index 94% rename from project/lsf_point/finetune/small/etth1.sh rename to project/lsf-setup/lsf_point/finetune/small/etth1.sh index 8b0b6cc..1d2ab8e 100644 --- a/project/lsf_point/finetune/small/etth1.sh +++ b/project/lsf-setup/lsf_point/finetune/small/etth1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf_point/finetune +cp=conf/lsf-setup/lsf_point/finetune exp_name=lsf cl=3000 ft_pattern=head diff --git a/project/lsf_point/finetune/small/etth2.sh b/project/lsf-setup/lsf_point/finetune/small/etth2.sh similarity index 94% rename from project/lsf_point/finetune/small/etth2.sh rename to project/lsf-setup/lsf_point/finetune/small/etth2.sh index 8541d42..4ffadca 100644 --- a/project/lsf_point/finetune/small/etth2.sh +++ b/project/lsf-setup/lsf_point/finetune/small/etth2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf_point/finetune +cp=conf/lsf-setup/lsf_point/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf_point/finetune/small/ettm1.sh b/project/lsf-setup/lsf_point/finetune/small/ettm1.sh similarity index 91% rename from project/lsf_point/finetune/small/ettm1.sh rename to project/lsf-setup/lsf_point/finetune/small/ettm1.sh index a4d7df9..cf2e06b 100644 --- a/project/lsf_point/finetune/small/ettm1.sh +++ b/project/lsf-setup/lsf_point/finetune/small/ettm1.sh @@ -3,10 +3,10 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf_point/finetune +cp=conf/lsf-setup/lsf_point/finetune exp_name=lsf cl=3000 -ft_pattern=head_dp07 +ft_pattern=cnn_head_flat data=ettm1 ps=128 diff --git a/project/lsf_point/finetune/small/ettm2.sh b/project/lsf-setup/lsf_point/finetune/small/ettm2.sh similarity index 82% rename from project/lsf_point/finetune/small/ettm2.sh rename to project/lsf-setup/lsf_point/finetune/small/ettm2.sh index 55b6dea..340ace2 100644 --- a/project/lsf_point/finetune/small/ettm2.sh +++ b/project/lsf-setup/lsf_point/finetune/small/ettm2.sh @@ -1,12 +1,12 @@ #!/bin/bash -export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=2; model=moirai_1.1_R_small -cp=conf/lsf_point/finetune +cp=conf/lsf-setup/lsf_point/finetune exp_name=lsf cl=3000 -ft_pattern=head_dp07 +ft_pattern=cnn_head_flat data=ettm2 ps=64 diff --git a/project/lsf_point/finetune/small/run_multi.sh b/project/lsf-setup/lsf_point/finetune/small/run_multi.sh similarity index 100% rename from project/lsf_point/finetune/small/run_multi.sh rename to project/lsf-setup/lsf_point/finetune/small/run_multi.sh diff --git a/project/lsf_point/finetune/small/weather.sh b/project/lsf-setup/lsf_point/finetune/small/weather.sh similarity index 94% rename from project/lsf_point/finetune/small/weather.sh rename to project/lsf-setup/lsf_point/finetune/small/weather.sh index 3cf6b0e..91e7006 100644 --- a/project/lsf_point/finetune/small/weather.sh +++ b/project/lsf-setup/lsf_point/finetune/small/weather.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf_point/finetune +cp=conf/lsf-setup/lsf_point/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/multi_scale/eval/small/electricity.sh b/project/lsf-setup/multi_scale/eval/small/electricity.sh similarity index 89% rename from project/multi_scale/eval/small/electricity.sh rename to project/lsf-setup/multi_scale/eval/small/electricity.sh index 994bee5..7147559 100644 --- a/project/multi_scale/eval/small/electricity.sh +++ b/project/lsf-setup/multi_scale/eval/small/electricity.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/multi_scale/eval/small/etth1.sh b/project/lsf-setup/multi_scale/eval/small/etth1.sh similarity index 89% rename from project/multi_scale/eval/small/etth1.sh rename to project/lsf-setup/multi_scale/eval/small/etth1.sh index c6a0b56..debdae0 100644 --- a/project/multi_scale/eval/small/etth1.sh +++ b/project/lsf-setup/multi_scale/eval/small/etth1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/multi_scale/eval/small/etth2.sh b/project/lsf-setup/multi_scale/eval/small/etth2.sh similarity index 89% rename from project/multi_scale/eval/small/etth2.sh rename to project/lsf-setup/multi_scale/eval/small/etth2.sh index ae71323..87ffe2e 100644 --- a/project/multi_scale/eval/small/etth2.sh +++ b/project/lsf-setup/multi_scale/eval/small/etth2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/multi_scale/eval/small/ettm1.sh b/project/lsf-setup/multi_scale/eval/small/ettm1.sh similarity index 71% rename from project/multi_scale/eval/small/ettm1.sh rename to project/lsf-setup/multi_scale/eval/small/ettm1.sh index 7bde78e..135bb25 100644 --- a/project/multi_scale/eval/small/ettm1.sh +++ b/project/lsf-setup/multi_scale/eval/small/ettm1.sh @@ -4,15 +4,15 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt -cpp1='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm1/cl3000_pl96/checkpoints/epoch_2-step_1293.ckpt' -cpp2='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm1/cl3000_pl192/checkpoints/epoch_0-step_429.ckpt' -cpp3='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm1/cl3000_pl336/checkpoints/epoch_0-step_427.ckpt' -cpp4='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm1/cl3000_pl720/checkpoints/epoch_0-step_422.ckpt' +cpp1='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm1/cl3000_pl96/checkpoints/epoch_2-step_1293.ckpt' +cpp2='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm1/cl3000_pl192/checkpoints/epoch_1-step_858.ckpt' +cpp3='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm1/cl3000_pl336/checkpoints/epoch_0-step_427.ckpt' +cpp4='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm1/cl3000_pl720/checkpoints/epoch_0-step_422.ckpt' index=1 for pl in 96 192 336 720; do @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/multi_scale/eval/small/ettm2.sh b/project/lsf-setup/multi_scale/eval/small/ettm2.sh similarity index 71% rename from project/multi_scale/eval/small/ettm2.sh rename to project/lsf-setup/multi_scale/eval/small/ettm2.sh index 9a557c1..d39c4e7 100644 --- a/project/multi_scale/eval/small/ettm2.sh +++ b/project/lsf-setup/multi_scale/eval/small/ettm2.sh @@ -4,15 +4,15 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt -cpp1='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm2/cl3000_pl96/checkpoints/epoch_4-step_2155.ckpt' -cpp2='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm2/cl3000_pl192/checkpoints/epoch_1-step_858.ckpt' -cpp3='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm2/cl3000_pl336/checkpoints/epoch_0-step_427.ckpt' -cpp4='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_film_dim/ettm2/cl3000_pl720/checkpoints/epoch_0-step_422.ckpt' +cpp1='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm2/cl3000_pl96/checkpoints/epoch_5-step_2586.ckpt' +cpp2='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm2/cl3000_pl192/checkpoints/epoch_2-step_1287.ckpt' +cpp3='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm2/cl3000_pl336/checkpoints/epoch_0-step_427.ckpt' +cpp4='./outputs/multi_scale/finetune/moirai_1.1_R_small/lsf/full_ms_rope/ettm2/cl3000_pl720/checkpoints/epoch_0-step_422.ckpt' index=1 for pl in 96 192 336 720; do @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/multi_scale/eval/small/run_multi.sh b/project/lsf-setup/multi_scale/eval/small/run_multi.sh similarity index 100% rename from project/multi_scale/eval/small/run_multi.sh rename to project/lsf-setup/multi_scale/eval/small/run_multi.sh diff --git a/project/multi_scale/eval/small/weather.sh b/project/lsf-setup/multi_scale/eval/small/weather.sh similarity index 89% rename from project/multi_scale/eval/small/weather.sh rename to project/lsf-setup/multi_scale/eval/small/weather.sh index d10cf7e..73ac538 100644 --- a/project/multi_scale/eval/small/weather.sh +++ b/project/lsf-setup/multi_scale/eval/small/weather.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/seasonal_naive/finetune/small/electricity.sh b/project/lsf-setup/multi_scale/finetune/small/electricity.sh similarity index 94% rename from project/seasonal_naive/finetune/small/electricity.sh rename to project/lsf-setup/multi_scale/finetune/small/electricity.sh index 4e999a4..a1a454e 100644 --- a/project/seasonal_naive/finetune/small/electricity.sh +++ b/project/lsf-setup/multi_scale/finetune/small/electricity.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/seasonal_naive/finetune +cp=conf/lsf-setup/multi_scale/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/multi_scale/finetune/small/etth1.sh b/project/lsf-setup/multi_scale/finetune/small/etth1.sh similarity index 94% rename from project/multi_scale/finetune/small/etth1.sh rename to project/lsf-setup/multi_scale/finetune/small/etth1.sh index 1180cce..3947420 100644 --- a/project/multi_scale/finetune/small/etth1.sh +++ b/project/lsf-setup/multi_scale/finetune/small/etth1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; model=moirai_1.1_R_small -cp=conf/multi_scale/finetune +cp=conf/lsf-setup/multi_scale/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/multi_scale/finetune/small/etth2.sh b/project/lsf-setup/multi_scale/finetune/small/etth2.sh similarity index 94% rename from project/multi_scale/finetune/small/etth2.sh rename to project/lsf-setup/multi_scale/finetune/small/etth2.sh index 69db85c..9146135 100644 --- a/project/multi_scale/finetune/small/etth2.sh +++ b/project/lsf-setup/multi_scale/finetune/small/etth2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; model=moirai_1.1_R_small -cp=conf/multi_scale/finetune +cp=conf/lsf-setup/multi_scale/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/multi_scale/finetune/small/ettm1.sh b/project/lsf-setup/multi_scale/finetune/small/ettm1.sh similarity index 82% rename from project/multi_scale/finetune/small/ettm1.sh rename to project/lsf-setup/multi_scale/finetune/small/ettm1.sh index cefde43..277ef1a 100644 --- a/project/multi_scale/finetune/small/ettm1.sh +++ b/project/lsf-setup/multi_scale/finetune/small/ettm1.sh @@ -1,12 +1,12 @@ #!/bin/bash -export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=2; model=moirai_1.1_R_small -cp=conf/multi_scale/finetune +cp=conf/lsf-setup/multi_scale/finetune exp_name=lsf cl=3000 -ft_pattern=full_film_dim +ft_pattern=full_ms_rope data=ettm1 ps=128 diff --git a/project/multi_scale/finetune/small/ettm2.sh b/project/lsf-setup/multi_scale/finetune/small/ettm2.sh similarity index 90% rename from project/multi_scale/finetune/small/ettm2.sh rename to project/lsf-setup/multi_scale/finetune/small/ettm2.sh index 7af0203..4fc57f6 100644 --- a/project/multi_scale/finetune/small/ettm2.sh +++ b/project/lsf-setup/multi_scale/finetune/small/ettm2.sh @@ -3,10 +3,10 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; model=moirai_1.1_R_small -cp=conf/multi_scale/finetune +cp=conf/lsf-setup/multi_scale/finetune exp_name=lsf cl=3000 -ft_pattern=full_film_dim +ft_pattern=full_ms_rope data=ettm2 ps=64 diff --git a/project/multi_scale/finetune/small/run_multi.sh b/project/lsf-setup/multi_scale/finetune/small/run_multi.sh similarity index 100% rename from project/multi_scale/finetune/small/run_multi.sh rename to project/lsf-setup/multi_scale/finetune/small/run_multi.sh diff --git a/project/multi_scale/finetune/small/weather.sh b/project/lsf-setup/multi_scale/finetune/small/weather.sh similarity index 94% rename from project/multi_scale/finetune/small/weather.sh rename to project/lsf-setup/multi_scale/finetune/small/weather.sh index bf2c080..03cf621 100644 --- a/project/multi_scale/finetune/small/weather.sh +++ b/project/lsf-setup/multi_scale/finetune/small/weather.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/multi_scale/finetune +cp=conf/lsf-setup/multi_scale/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/multi_scale/zero_shot/lsf_small.sh b/project/lsf-setup/multi_scale/zero_shot/lsf_small.sh similarity index 98% rename from project/multi_scale/zero_shot/lsf_small.sh rename to project/lsf-setup/multi_scale/zero_shot/lsf_small.sh index 198a23d..10f09d5 100644 --- a/project/multi_scale/zero_shot/lsf_small.sh +++ b/project/lsf-setup/multi_scale/zero_shot/lsf_small.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=3; mode=S -cp=conf/multi_scale/eval +cp=conf/lsf-setup/multi_scale/eval exp_name=lsf_zero_shot context_length=3000 model=moirai_1.1_R_small diff --git a/project/origin/eval/small/electricity.sh b/project/lsf-setup/origin/eval/small/electricity.sh similarity index 85% rename from project/origin/eval/small/electricity.sh rename to project/lsf-setup/origin/eval/small/electricity.sh index e1cea37..885ffbd 100644 --- a/project/origin/eval/small/electricity.sh +++ b/project/lsf-setup/origin/eval/small/electricity.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -22,8 +22,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/origin/eval/small/etth1.sh b/project/lsf-setup/origin/eval/small/etth1.sh similarity index 90% rename from project/origin/eval/small/etth1.sh rename to project/lsf-setup/origin/eval/small/etth1.sh index b2130d1..59bc7d7 100644 --- a/project/origin/eval/small/etth1.sh +++ b/project/lsf-setup/origin/eval/small/etth1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/origin/eval/small/etth2.sh b/project/lsf-setup/origin/eval/small/etth2.sh similarity index 90% rename from project/origin/eval/small/etth2.sh rename to project/lsf-setup/origin/eval/small/etth2.sh index c5eb71f..72f940c 100644 --- a/project/origin/eval/small/etth2.sh +++ b/project/lsf-setup/origin/eval/small/etth2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/origin/eval/small/ettm1.sh b/project/lsf-setup/origin/eval/small/ettm1.sh similarity index 90% rename from project/origin/eval/small/ettm1.sh rename to project/lsf-setup/origin/eval/small/ettm1.sh index 44400d8..a3f6691 100644 --- a/project/origin/eval/small/ettm1.sh +++ b/project/lsf-setup/origin/eval/small/ettm1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=2 mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/origin/eval/small/ettm2.sh b/project/lsf-setup/origin/eval/small/ettm2.sh similarity index 86% rename from project/origin/eval/small/ettm2.sh rename to project/lsf-setup/origin/eval/small/ettm2.sh index 572f464..457df06 100644 --- a/project/origin/eval/small/ettm2.sh +++ b/project/lsf-setup/origin/eval/small/ettm2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/origin/eval/small/run_multi.sh b/project/lsf-setup/origin/eval/small/run_multi.sh similarity index 100% rename from project/origin/eval/small/run_multi.sh rename to project/lsf-setup/origin/eval/small/run_multi.sh diff --git a/project/origin/eval/small/weather.sh b/project/lsf-setup/origin/eval/small/weather.sh similarity index 86% rename from project/origin/eval/small/weather.sh rename to project/lsf-setup/origin/eval/small/weather.sh index ae78367..3e26b7b 100644 --- a/project/origin/eval/small/weather.sh +++ b/project/lsf-setup/origin/eval/small/weather.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/origin/finetune/small/electricity.sh b/project/lsf-setup/origin/finetune/small/electricity.sh similarity index 95% rename from project/origin/finetune/small/electricity.sh rename to project/lsf-setup/origin/finetune/small/electricity.sh index b806bd6..c84bae4 100644 --- a/project/origin/finetune/small/electricity.sh +++ b/project/lsf-setup/origin/finetune/small/electricity.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/origin/finetune +cp=conf/lsf-setup/origin/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/origin/finetune/small/etth1.sh b/project/lsf-setup/origin/finetune/small/etth1.sh similarity index 95% rename from project/origin/finetune/small/etth1.sh rename to project/lsf-setup/origin/finetune/small/etth1.sh index ab7a20b..bb23a70 100644 --- a/project/origin/finetune/small/etth1.sh +++ b/project/lsf-setup/origin/finetune/small/etth1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=3; model=moirai_1.1_R_small -cp=conf/origin/finetune +cp=conf/lsf-setup/origin/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/origin/finetune/small/etth2.sh b/project/lsf-setup/origin/finetune/small/etth2.sh similarity index 94% rename from project/origin/finetune/small/etth2.sh rename to project/lsf-setup/origin/finetune/small/etth2.sh index 84501f0..0d24912 100644 --- a/project/origin/finetune/small/etth2.sh +++ b/project/lsf-setup/origin/finetune/small/etth2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/origin/finetune +cp=conf/lsf-setup/origin/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/origin/finetune/small/ettm1.sh b/project/lsf-setup/origin/finetune/small/ettm1.sh similarity index 94% rename from project/origin/finetune/small/ettm1.sh rename to project/lsf-setup/origin/finetune/small/ettm1.sh index 68c726b..20f74de 100644 --- a/project/origin/finetune/small/ettm1.sh +++ b/project/lsf-setup/origin/finetune/small/ettm1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/origin/finetune +cp=conf/lsf-setup/origin/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/origin/finetune/small/ettm2.sh b/project/lsf-setup/origin/finetune/small/ettm2.sh similarity index 94% rename from project/origin/finetune/small/ettm2.sh rename to project/lsf-setup/origin/finetune/small/ettm2.sh index 88483d5..c3db3d4 100644 --- a/project/origin/finetune/small/ettm2.sh +++ b/project/lsf-setup/origin/finetune/small/ettm2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; model=moirai_1.1_R_small -cp=conf/origin/finetune +cp=conf/lsf-setup/origin/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/origin/finetune/small/run_multi.sh b/project/lsf-setup/origin/finetune/small/run_multi.sh similarity index 100% rename from project/origin/finetune/small/run_multi.sh rename to project/lsf-setup/origin/finetune/small/run_multi.sh diff --git a/project/origin/finetune/small/weather.sh b/project/lsf-setup/origin/finetune/small/weather.sh similarity index 95% rename from project/origin/finetune/small/weather.sh rename to project/lsf-setup/origin/finetune/small/weather.sh index c20b8b4..9146445 100644 --- a/project/origin/finetune/small/weather.sh +++ b/project/lsf-setup/origin/finetune/small/weather.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/origin/finetune +cp=conf/lsf-setup/origin/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/origin/obtain_moirai_ckpt.py b/project/lsf-setup/origin/obtain_moirai_ckpt.py similarity index 100% rename from project/origin/obtain_moirai_ckpt.py rename to project/lsf-setup/origin/obtain_moirai_ckpt.py diff --git a/project/origin/zero_shot/lsf_small.sh b/project/lsf-setup/origin/zero_shot/lsf_small.sh similarity index 97% rename from project/origin/zero_shot/lsf_small.sh rename to project/lsf-setup/origin/zero_shot/lsf_small.sh index 34e0b95..2486641 100644 --- a/project/origin/zero_shot/lsf_small.sh +++ b/project/lsf-setup/origin/zero_shot/lsf_small.sh @@ -3,9 +3,9 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=1; mode=S -cp=conf/origin/eval +cp=conf/lsf-setup/origin/eval exp_name=lsf_zero_shot -context_length=512 +context_length=3000 model=moirai_1.1_R_small diff --git a/project/seasonal_naive/eval/small/electricity.sh b/project/lsf-setup/seasonal_naive/eval/small/electricity.sh similarity index 89% rename from project/seasonal_naive/eval/small/electricity.sh rename to project/lsf-setup/seasonal_naive/eval/small/electricity.sh index eb6b410..1275d10 100644 --- a/project/seasonal_naive/eval/small/electricity.sh +++ b/project/lsf-setup/seasonal_naive/eval/small/electricity.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/seasonal_naive/eval +cp=conf/lsf-setup/seasonal_naive/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/seasonal_naive/eval/small/etth1.sh b/project/lsf-setup/seasonal_naive/eval/small/etth1.sh similarity index 90% rename from project/seasonal_naive/eval/small/etth1.sh rename to project/lsf-setup/seasonal_naive/eval/small/etth1.sh index a0bbfb7..c94aeec 100644 --- a/project/seasonal_naive/eval/small/etth1.sh +++ b/project/lsf-setup/seasonal_naive/eval/small/etth1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=3 mode=S -cp=conf/seasonal_naive/eval +cp=conf/lsf-setup/seasonal_naive/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -23,8 +23,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/seasonal_naive/eval/small/etth2.sh b/project/lsf-setup/seasonal_naive/eval/small/etth2.sh similarity index 95% rename from project/seasonal_naive/eval/small/etth2.sh rename to project/lsf-setup/seasonal_naive/eval/small/etth2.sh index d282486..faa3459 100644 --- a/project/seasonal_naive/eval/small/etth2.sh +++ b/project/lsf-setup/seasonal_naive/eval/small/etth2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/seasonal_naive/eval +cp=conf/lsf-setup/seasonal_naive/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -45,8 +45,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/seasonal_naive/eval/small/ettm1.sh b/project/lsf-setup/seasonal_naive/eval/small/ettm1.sh similarity index 90% rename from project/seasonal_naive/eval/small/ettm1.sh rename to project/lsf-setup/seasonal_naive/eval/small/ettm1.sh index 247f826..3e2d2cb 100644 --- a/project/seasonal_naive/eval/small/ettm1.sh +++ b/project/lsf-setup/seasonal_naive/eval/small/ettm1.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/seasonal_naive/eval +cp=conf/lsf-setup/seasonal_naive/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/seasonal_naive/eval/small/ettm2.sh b/project/lsf-setup/seasonal_naive/eval/small/ettm2.sh similarity index 90% rename from project/seasonal_naive/eval/small/ettm2.sh rename to project/lsf-setup/seasonal_naive/eval/small/ettm2.sh index 7e23b83..0f39d45 100644 --- a/project/seasonal_naive/eval/small/ettm2.sh +++ b/project/lsf-setup/seasonal_naive/eval/small/ettm2.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/seasonal_naive/eval +cp=conf/lsf-setup/seasonal_naive/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/seasonal_naive/eval/small/run_multi.sh b/project/lsf-setup/seasonal_naive/eval/small/run_multi.sh similarity index 100% rename from project/seasonal_naive/eval/small/run_multi.sh rename to project/lsf-setup/seasonal_naive/eval/small/run_multi.sh diff --git a/project/seasonal_naive/eval/small/weather.sh b/project/lsf-setup/seasonal_naive/eval/small/weather.sh similarity index 89% rename from project/seasonal_naive/eval/small/weather.sh rename to project/lsf-setup/seasonal_naive/eval/small/weather.sh index 0a3a2e5..f97bb1e 100644 --- a/project/seasonal_naive/eval/small/weather.sh +++ b/project/lsf-setup/seasonal_naive/eval/small/weather.sh @@ -4,7 +4,7 @@ export HYDRA_FULL_ERROR=1 export CUDA_VISIBLE_DEVICES=0 mode=S -cp=conf/seasonal_naive/eval +cp=conf/lsf-setup/seasonal_naive/eval exp_name=lsf cl=3000 model=moirai_lightning_ckpt @@ -24,8 +24,8 @@ for pl in 96 192 336 720; do 4) cpp=$cpp4 ;; esac - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) + pretrained_model=$(echo $cpp | cut -d'/' -f6) + ft_pattern=$(echo $cpp | cut -d'/' -f8) python -m cli.eval \ -cp $cp \ diff --git a/project/lsf/finetune/small/electricity.sh b/project/lsf-setup/seasonal_naive/finetune/small/electricity.sh similarity index 93% rename from project/lsf/finetune/small/electricity.sh rename to project/lsf-setup/seasonal_naive/finetune/small/electricity.sh index f8e2f90..1059d9c 100644 --- a/project/lsf/finetune/small/electricity.sh +++ b/project/lsf-setup/seasonal_naive/finetune/small/electricity.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/lsf/finetune +cp=conf/lsf-setup/seasonal_naive/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/seasonal_naive/finetune/small/etth1.sh b/project/lsf-setup/seasonal_naive/finetune/small/etth1.sh similarity index 93% rename from project/seasonal_naive/finetune/small/etth1.sh rename to project/lsf-setup/seasonal_naive/finetune/small/etth1.sh index 9ee4a37..5ab9151 100644 --- a/project/seasonal_naive/finetune/small/etth1.sh +++ b/project/lsf-setup/seasonal_naive/finetune/small/etth1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=3; model=moirai_1.1_R_small -cp=conf/seasonal_naive/finetune +cp=conf/lsf-setup/seasonal_naive/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/seasonal_naive/finetune/small/etth2.sh b/project/lsf-setup/seasonal_naive/finetune/small/etth2.sh similarity index 93% rename from project/seasonal_naive/finetune/small/etth2.sh rename to project/lsf-setup/seasonal_naive/finetune/small/etth2.sh index 9f6a61d..8f016e4 100644 --- a/project/seasonal_naive/finetune/small/etth2.sh +++ b/project/lsf-setup/seasonal_naive/finetune/small/etth2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/seasonal_naive/finetune +cp=conf/lsf-setup/seasonal_naive/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/seasonal_naive/finetune/small/ettm1.sh b/project/lsf-setup/seasonal_naive/finetune/small/ettm1.sh similarity index 93% rename from project/seasonal_naive/finetune/small/ettm1.sh rename to project/lsf-setup/seasonal_naive/finetune/small/ettm1.sh index 0cab15e..94b342d 100644 --- a/project/seasonal_naive/finetune/small/ettm1.sh +++ b/project/lsf-setup/seasonal_naive/finetune/small/ettm1.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/seasonal_naive/finetune +cp=conf/lsf-setup/seasonal_naive/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/seasonal_naive/finetune/small/ettm2.sh b/project/lsf-setup/seasonal_naive/finetune/small/ettm2.sh similarity index 93% rename from project/seasonal_naive/finetune/small/ettm2.sh rename to project/lsf-setup/seasonal_naive/finetune/small/ettm2.sh index 0e0c929..058165f 100644 --- a/project/seasonal_naive/finetune/small/ettm2.sh +++ b/project/lsf-setup/seasonal_naive/finetune/small/ettm2.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/seasonal_naive/finetune +cp=conf/lsf-setup/seasonal_naive/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/seasonal_naive/finetune/small/run_multi.sh b/project/lsf-setup/seasonal_naive/finetune/small/run_multi.sh similarity index 100% rename from project/seasonal_naive/finetune/small/run_multi.sh rename to project/lsf-setup/seasonal_naive/finetune/small/run_multi.sh diff --git a/project/seasonal_naive/finetune/small/weather.sh b/project/lsf-setup/seasonal_naive/finetune/small/weather.sh similarity index 93% rename from project/seasonal_naive/finetune/small/weather.sh rename to project/lsf-setup/seasonal_naive/finetune/small/weather.sh index 62e4c86..1dad8f8 100644 --- a/project/seasonal_naive/finetune/small/weather.sh +++ b/project/lsf-setup/seasonal_naive/finetune/small/weather.sh @@ -3,7 +3,7 @@ export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; model=moirai_1.1_R_small -cp=conf/seasonal_naive/finetune +cp=conf/lsf-setup/seasonal_naive/finetune exp_name=lsf cl=3000 ft_pattern=full diff --git a/project/lsf/eval/small/ettm2.sh b/project/lsf/eval/small/ettm2.sh deleted file mode 100644 index b3ec93e..0000000 --- a/project/lsf/eval/small/ettm2.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -export HYDRA_FULL_ERROR=1 -export CUDA_VISIBLE_DEVICES=0 - -mode=S -cp=conf/lsf/eval -exp_name=lsf -cl=3000 -model=moirai_lightning_ckpt - - -cpp1='./outputs/lsf/finetune/moirai_1.1_R_small/lsf/full/ettm2/cl3000_pl96/checkpoints/epoch_9-step_2160.ckpt' -cpp2='./outputs/lsf/finetune/moirai_1.1_R_small/lsf/full/ettm2/cl3000_pl192/checkpoints/epoch_4-step_1075.ckpt' -cpp3='./outputs/lsf/finetune/moirai_1.1_R_small/lsf/full/ettm2/cl3000_pl336/checkpoints/epoch_1-step_428.ckpt' -cpp4='./outputs/lsf/finetune/moirai_1.1_R_small/lsf/full/ettm2/cl3000_pl720/checkpoints/epoch_1-step_422.ckpt' - - -index=1 -for pl in 96 192 336 720; do - case $index in - 1) cpp=$cpp1 ;; - 2) cpp=$cpp2 ;; - 3) cpp=$cpp3 ;; - 4) cpp=$cpp4 ;; - esac - - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) - - python -m cli.eval \ - -cp $cp \ - exp_name=$exp_name/$pretrained_model/$ft_pattern \ - model=$model \ - model.patch_size=64 \ - model.context_length=$cl \ - model.checkpoint_path=$cpp \ - model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ - data=lsf_test \ - data.dataset_name=ETTm2 \ - data.mode=$mode \ - data.prediction_length=$pl - - index=$((index+1)) -done diff --git a/project/lsf_point/eval/small/ettm1.sh b/project/lsf_point/eval/small/ettm1.sh deleted file mode 100644 index be14748..0000000 --- a/project/lsf_point/eval/small/ettm1.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -export HYDRA_FULL_ERROR=1 -export CUDA_VISIBLE_DEVICES=1 - -mode=S -cp=conf/lsf_point/eval -exp_name=lsf -cl=3000 -model=moirai_lightning_ckpt - - -cpp1='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm1/cl3000_pl96/checkpoints/epoch_44-step_9720.ckpt' -cpp2='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm1/cl3000_pl192/checkpoints/epoch_36-step_7955.ckpt' -cpp3='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm1/cl3000_pl336/checkpoints/epoch_11-step_2568.ckpt' -cpp4='./outputs/lsf_point/finetune/moirai_1.1_R_small/lsf/head_dp02/ettm1/cl3000_pl720/checkpoints/epoch_7-step_1688.ckpt' - - -index=1 -for pl in 96 192 336 720; do - case $index in - 1) cpp=$cpp1 ;; - 2) cpp=$cpp2 ;; - 3) cpp=$cpp3 ;; - 4) cpp=$cpp4 ;; - esac - - pretrained_model=$(echo $cpp | cut -d'/' -f5) - ft_pattern=$(echo $cpp | cut -d'/' -f7) - - python -m cli.eval \ - -cp $cp \ - exp_name=$exp_name/$pretrained_model/$ft_pattern \ - model=$model \ - model.patch_size=128 \ - model.context_length=$cl \ - model.checkpoint_path=$cpp \ - model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ - data=lsf_test \ - data.dataset_name=ETTm1 \ - data.mode=$mode \ - data.prediction_length=$pl - - index=$((index+1)) -done diff --git a/project/pf-setup/build_pf_ft_datasets.sh b/project/pf-setup/build_pf_ft_datasets.sh new file mode 100644 index 0000000..efd33af --- /dev/null +++ b/project/pf-setup/build_pf_ft_datasets.sh @@ -0,0 +1,49 @@ +#!/bin/bash +set -a +source .env +set +a + +ds_type="wide" +path_prefix=$LSF_PATH + +python -m uni2ts.data.builder.pf_simple \ + jena_weather \ + "${path_prefix}/weather/weather.csv" \ + --dataset_type $ds_type\ + --offset -1152 \ + --freq 10T \ + + +python -m uni2ts.data.builder.pf_simple \ + istanbul_traffic \ + "${path_prefix}/istanbul-traffic-index/istanbul_traffic.csv" \ + --dataset_type $ds_type\ + --offset -192 \ + + +python -m uni2ts.data.builder.pf_simple \ + turkey_power \ + "${path_prefix}/electrical-power-demand-in-turkey/power Generation and consumption.csv" \ + --dataset_type $ds_type \ + --offset -192 \ + + +python -m uni2ts.data.builder.pf_simple \ + bizitobs_l2c \ + "${path_prefix}/BizITObs/L2C.csv" \ + --dataset_type $ds_type \ + --offset -1008 \ + + +python -m uni2ts.data.builder.pf_simple \ + electricity \ + "gluonts" \ + --dataset_type $ds_type \ + --offset -192 \ + + +python -m uni2ts.data.builder.pf_simple \ + solar-energy \ + "gluonts" \ + --dataset_type $ds_type \ + --offset -192 \ diff --git a/project/pf-setup/origin/zero_shot/pf_small.sh b/project/pf-setup/origin/zero_shot/pf_small.sh new file mode 100644 index 0000000..291ffc5 --- /dev/null +++ b/project/pf-setup/origin/zero_shot/pf_small.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; + +cp=conf/pf-setup/origin/eval +exp_name=pf_zero_shot +context_length=3000 +model=moirai_1.1_R_small + + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name \ + model=$model \ + model.patch_size=32 \ + model.context_length=$context_length \ + data=gluonts_test \ + data.dataset_name=electricity + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name \ + model=$model \ + model.patch_size=32 \ + model.context_length=$context_length \ + data=gluonts_test \ + data.dataset_name=solar-energy + +#python -m cli.eval \ +# -cp $cp \ +# exp_name=$exp_name \ +# model=$model \ +# model=moirai_1.0_R_small \ +# model.patch_size=32 \ +# model.context_length=1000 \ +# data=gluonts_test \ +# data.dataset_name=walmart + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name \ + model=$model \ + model.patch_size=32 \ + model.context_length=$context_length \ + data=gluonts_test \ + data.dataset_name=jena_weather + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name \ + model=$model \ + model.patch_size=32 \ + model.context_length=$context_length \ + data=gluonts_test \ + data.dataset_name=istanbul_traffic + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name \ + model=$model \ + model.patch_size=64 \ + model.context_length=$context_length \ + data=gluonts_test \ + data.dataset_name=turkey_power \ No newline at end of file diff --git a/project/pf-setup/pf/eval/small/electricity.sh b/project/pf-setup/pf/eval/small/electricity.sh new file mode 100644 index 0000000..8d25a00 --- /dev/null +++ b/project/pf-setup/pf/eval/small/electricity.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=0 + +cp=conf/pf-setup/pf/eval +exp_name=pf +cl=3000 +pl=24 +model=moirai_lightning_ckpt + + +cpp='./outputs/pf-setup/pf/finetune/moirai_1.1_R_small/pf/full/solar-energy/cl3000_pl24/checkpoints/epoch_0-step_63.ckpt' + + +pretrained_model=$(echo $cpp | cut -d'/' -f6) +ft_pattern=$(echo $cpp | cut -d'/' -f8) + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=32 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=gluonts_test \ + data.dataset_name=solar-energy \ + data.prediction_length=$pl diff --git a/project/pf-setup/pf/eval/small/istanbul_traffic.sh b/project/pf-setup/pf/eval/small/istanbul_traffic.sh new file mode 100644 index 0000000..554e2bc --- /dev/null +++ b/project/pf-setup/pf/eval/small/istanbul_traffic.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=0 + +cp=conf/pf-setup/pf/eval +exp_name=pf +cl=3000 +pl=24 +model=moirai_lightning_ckpt + + +cpp='./outputs/pf-setup/pf/finetune/moirai_1.1_R_small/pf/full/istanbul_traffic/cl3000_pl24/checkpoints/epoch_9-step_30.ckpt' + + +pretrained_model=$(echo $cpp | cut -d'/' -f6) +ft_pattern=$(echo $cpp | cut -d'/' -f8) + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=32 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=gluonts_test \ + data.dataset_name=istanbul_traffic \ + data.prediction_length=$pl diff --git a/project/pf-setup/pf/eval/small/jena_weather.sh b/project/pf-setup/pf/eval/small/jena_weather.sh new file mode 100644 index 0000000..49f987f --- /dev/null +++ b/project/pf-setup/pf/eval/small/jena_weather.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=0 + +cp=conf/pf-setup/pf/eval +exp_name=pf +cl=3000 +pl=144 +model=moirai_lightning_ckpt + + +cpp='./outputs/pf-setup/pf/finetune/moirai_1.1_R_small/pf/full/jena_weather/cl3000_pl144/checkpoints/epoch_55-step_784.ckpt' + + +pretrained_model=$(echo $cpp | cut -d'/' -f6) +ft_pattern=$(echo $cpp | cut -d'/' -f8) + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=32 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=gluonts_test \ + data.dataset_name=jena_weather \ + data.prediction_length=$pl diff --git a/project/pf-setup/pf/eval/small/solar-energy.sh b/project/pf-setup/pf/eval/small/solar-energy.sh new file mode 100644 index 0000000..4b1e1a8 --- /dev/null +++ b/project/pf-setup/pf/eval/small/solar-energy.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=0 + +cp=conf/pf-setup/pf/eval +exp_name=pf +cl=3000 +pl=24 +model=moirai_lightning_ckpt + + +cpp='./outputs/pf-setup/pf/finetune/moirai_1.1_R_small/pf/full/solar-energy/cl3000_pl24/checkpoints/epoch_0-step_63-v3.ckpt' + + +pretrained_model=$(echo $cpp | cut -d'/' -f6) +ft_pattern=$(echo $cpp | cut -d'/' -f8) + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=32 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=gluonts_test \ + data.dataset_name=solar-energy \ + data.prediction_length=$pl diff --git a/project/pf-setup/pf/eval/small/turkey_power.sh b/project/pf-setup/pf/eval/small/turkey_power.sh new file mode 100644 index 0000000..388b865 --- /dev/null +++ b/project/pf-setup/pf/eval/small/turkey_power.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1 +export CUDA_VISIBLE_DEVICES=2 + +cp=conf/pf-setup/pf/eval +exp_name=pf +cl=3000 +pl=24 +model=moirai_lightning_ckpt + + +cpp='./outputs/pf-setup/pf/finetune/moirai_1.1_R_small/pf/full/turkey_power/cl3000_pl24/checkpoints/epoch_41-step_1428.ckpt' + + +pretrained_model=$(echo $cpp | cut -d'/' -f6) +ft_pattern=$(echo $cpp | cut -d'/' -f8) + +python -m cli.eval \ + -cp $cp \ + exp_name=$exp_name/$pretrained_model/$ft_pattern \ + model=$model \ + model.patch_size=64 \ + model.context_length=$cl \ + model.checkpoint_path=$cpp \ + model.pretrained_checkpoint_path=ckpt/$pretrained_model.ckpt \ + data=gluonts_test \ + data.dataset_name=turkey_power \ + data.prediction_length=$pl diff --git a/project/pf-setup/pf/finetune/small/electricity.sh b/project/pf-setup/pf/finetune/small/electricity.sh new file mode 100644 index 0000000..0efaa09 --- /dev/null +++ b/project/pf-setup/pf/finetune/small/electricity.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; + +model=moirai_1.1_R_small +cp=conf/pf-setup/pf/finetune +exp_name=pf +cl=3000 +pl=24 +ft_pattern=full + +data=electricity +ps=32 + +python -m cli.train \ +-cp $cp \ +exp_name=$exp_name \ +run_name=cl${cl}_pl${pl} \ +model=$model \ +model.patch_size=${ps} \ +model.context_length=$cl \ +model.prediction_length=$pl \ +model.finetune_pattern=$ft_pattern \ +data=${data} \ +data.patch_size=${ps} \ +data.context_length=$cl \ +data.prediction_length=$pl \ +val_data=${data} \ +val_data.patch_size=${ps} \ +val_data.context_length=$cl \ +val_data.prediction_length=$pl \ +model.lr=1e-5 diff --git a/project/pf-setup/pf/finetune/small/istanbul_traffic.sh b/project/pf-setup/pf/finetune/small/istanbul_traffic.sh new file mode 100644 index 0000000..6b6ef24 --- /dev/null +++ b/project/pf-setup/pf/finetune/small/istanbul_traffic.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; + +model=moirai_1.1_R_small +cp=conf/pf-setup/pf/finetune +exp_name=pf +cl=3000 +pl=24 +ft_pattern=full + +data=istanbul_traffic +ps=32 + +python -m cli.train \ +-cp $cp \ +exp_name=$exp_name \ +run_name=cl${cl}_pl${pl} \ +model=$model \ +model.patch_size=${ps} \ +model.context_length=$cl \ +model.prediction_length=$pl \ +model.finetune_pattern=$ft_pattern \ +data=${data} \ +data.patch_size=${ps} \ +data.context_length=$cl \ +data.prediction_length=$pl \ +val_data=${data} \ +val_data.patch_size=${ps} \ +val_data.context_length=$cl \ +val_data.prediction_length=$pl diff --git a/project/pf-setup/pf/finetune/small/jena_weather.sh b/project/pf-setup/pf/finetune/small/jena_weather.sh new file mode 100644 index 0000000..4259d6a --- /dev/null +++ b/project/pf-setup/pf/finetune/small/jena_weather.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; + +model=moirai_1.1_R_small +cp=conf/pf-setup/pf/finetune +exp_name=pf +cl=3000 +pl=144 +ft_pattern=full + +data=jena_weather +ps=32 + +python -m cli.train \ +-cp $cp \ +exp_name=$exp_name \ +run_name=cl${cl}_pl${pl} \ +model=$model \ +model.patch_size=${ps} \ +model.context_length=$cl \ +model.prediction_length=$pl \ +model.finetune_pattern=$ft_pattern \ +data=${data} \ +data.patch_size=${ps} \ +data.context_length=$cl \ +data.prediction_length=$pl \ +val_data=${data} \ +val_data.patch_size=${ps} \ +val_data.context_length=$cl \ +val_data.prediction_length=$pl diff --git a/project/pf-setup/pf/finetune/small/solar-energy.sh b/project/pf-setup/pf/finetune/small/solar-energy.sh new file mode 100644 index 0000000..1ba5f00 --- /dev/null +++ b/project/pf-setup/pf/finetune/small/solar-energy.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=0; + +model=moirai_1.1_R_small +cp=conf/pf-setup/pf/finetune +exp_name=pf +cl=3000 +pl=24 +ft_pattern=full + +data=solar-energy +ps=32 + +python -m cli.train \ +-cp $cp \ +exp_name=$exp_name \ +run_name=cl${cl}_pl${pl} \ +model=$model \ +model.patch_size=${ps} \ +model.context_length=$cl \ +model.prediction_length=$pl \ +model.finetune_pattern=$ft_pattern \ +data=${data} \ +data.patch_size=${ps} \ +data.context_length=$cl \ +data.prediction_length=$pl \ +val_data=${data} \ +val_data.patch_size=${ps} \ +val_data.context_length=$cl \ +val_data.prediction_length=$pl diff --git a/project/pf-setup/pf/finetune/small/turkey_power.sh b/project/pf-setup/pf/finetune/small/turkey_power.sh new file mode 100644 index 0000000..9e57147 --- /dev/null +++ b/project/pf-setup/pf/finetune/small/turkey_power.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +export HYDRA_FULL_ERROR=1; export CUDA_VISIBLE_DEVICES=2; + +model=moirai_1.1_R_small +cp=conf/pf-setup/pf/finetune +exp_name=pf +cl=3000 +pl=24 +ft_pattern=full + +data=turkey_power +ps=64 + +python -m cli.train \ +-cp $cp \ +exp_name=$exp_name \ +run_name=cl${cl}_pl${pl} \ +model=$model \ +model.patch_size=${ps} \ +model.context_length=$cl \ +model.prediction_length=$pl \ +model.finetune_pattern=$ft_pattern \ +data=${data} \ +data.patch_size=${ps} \ +data.context_length=$cl \ +data.prediction_length=$pl \ +val_data=${data} \ +val_data.patch_size=${ps} \ +val_data.context_length=$cl \ +val_data.prediction_length=$pl +#model.lr=5e-7 +#train_dataloader.batch_size=128 diff --git a/src/uni2ts/data/builder/pf_simple.py b/src/uni2ts/data/builder/pf_simple.py new file mode 100644 index 0000000..2b2ae69 --- /dev/null +++ b/src/uni2ts/data/builder/pf_simple.py @@ -0,0 +1,479 @@ +# Copyright (c) 2024, Salesforce, Inc. +# SPDX-License-Identifier: Apache-2 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +from dataclasses import dataclass +from itertools import product +from pathlib import Path +from typing import Any, Callable, Generator, Optional + +import datasets +import pandas as pd +from datasets import Features, Sequence, Value +from torch.utils.data import Dataset + +from uni2ts.common.env import env +from uni2ts.common.typing import GenFunc + +# from ._base import DatasetBuilder +from uni2ts.data.builder._base import DatasetBuilder +from uni2ts.data.dataset import ( + EvalDataset, + FinetuneDataset, + SampleTimeSeriesType, + TimeSeriesDataset, +) +from uni2ts.data.indexer import HuggingFaceDatasetIndexer +from uni2ts.transform import Transformation + +from typing import List, NamedTuple, Optional, cast +from .simple import _from_long_dataframe, _from_wide_dataframe, _from_wide_dataframe_multivariate + + +# Codes are adopted from Gluonts dataset module +# https://ts.gluon.ai/stable/_modules/gluonts/dataset/repository/datasets.html +# https://github.com/awslabs/gluonts/blob/dev/src/gluonts/dataset/repository/_lstnet.py + +root = ( + "https://raw.githubusercontent.com/laiguokun/" + "multivariate-time-series-data/master/" +) + + +class LstnetDataset(NamedTuple): + name: str + url: str + num_series: int + num_time_steps: int + prediction_length: int + rolling_evaluations: int + freq: str + start_date: str + agg_freq: Optional[str] = None + + +datasets_info = { + "exchange_rate": LstnetDataset( + name="exchange_rate", + url=root + "exchange_rate/exchange_rate.txt.gz", + num_series=8, + num_time_steps=7588, + prediction_length=30, + rolling_evaluations=5, + start_date="1990-01-01", + freq="1B", + agg_freq=None, + ), + "electricity": LstnetDataset( + name="electricity", + url=root + "electricity/electricity.txt.gz", + # original dataset can be found at + # https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014# + # the aggregated ones that is used from LSTNet filters out from the + # initial 370 series the one with no data in 2011 + num_series=321, + num_time_steps=26304, + prediction_length=24, + rolling_evaluations=7, + start_date="2012-01-01", + freq="1h", + agg_freq=None, + ), + "traffic": LstnetDataset( + name="traffic", + url=root + "traffic/traffic.txt.gz", + # note there are 963 in the original dataset from + # https://archive.ics.uci.edu/ml/datasets/PEMS-SF but only 862 in + # LSTNet + num_series=862, + num_time_steps=17544, + prediction_length=24, + rolling_evaluations=7, + start_date="2015-01-01", + freq="h", + agg_freq=None, + ), + "solar-energy": LstnetDataset( + name="solar-energy", + url=root + "solar-energy/solar_AL.txt.gz", + num_series=137, + num_time_steps=52560, + prediction_length=24, + rolling_evaluations=7, + start_date="2006-01-01", + freq="10min", + agg_freq="1h", # ToDo: Solar原本freq是10min agg_freq后变成1h + ), +} + + +def load_from_pandas( + df: pd.DataFrame, + time_index: pd.DatetimeIndex, + agg_freq: Optional[str] = None, +) -> List[pd.Series]: + df: pd.DataFrame = df.set_index(time_index) + + pivot_df = df.transpose() + pivot_df.head() + + timeseries = [] + for row in pivot_df.iterrows(): + ts = pd.Series(row[1].values, index=time_index) + if agg_freq is not None: + ts = ts.resample(agg_freq).sum() + first_valid = ts[ts.notnull()].index[0] + last_valid = ts[ts.notnull()].index[-1] + ts = ts[first_valid:last_valid] + + timeseries.append(ts) + + return timeseries + + +@dataclass +class SimpleFinetuneDatasetBuilder(DatasetBuilder): + dataset: str + windows: Optional[int] + distance: Optional[int] + prediction_length: Optional[int] + context_length: Optional[int] + patch_size: Optional[int] + storage_path: Path = env.CUSTOM_DATA_PATH + mean = None + std = None + + def __post_init__(self): + self.storage_path = Path(self.storage_path) + + def build_dataset( + self, + file: Path, + dataset_type: str, + offset: Optional[int] = None, + date_offset: Optional[pd.Timestamp] = None, + freq: str = "H", + normalize: Optional[bool] = False, + ): + + assert offset is None or date_offset is None, ( + "One or neither offset and date_offset must be specified, but not both. " + f"Got offset: {offset}, date_offset: {date_offset}" + ) + + # gluonts datasets + if self.dataset in datasets_info: + ds_info = datasets_info[self.dataset] + time_index = pd.period_range( + start=ds_info.start_date, + freq=ds_info.freq, + periods=ds_info.num_time_steps, + ) + time_index = time_index.to_timestamp() + + df = cast( + pd.DataFrame, + pd.read_csv(ds_info.url, header=None), # type: ignore + ) + timeseries = load_from_pandas( + df=df, time_index=time_index, agg_freq=ds_info.agg_freq + ) + df = pd.concat(timeseries, axis=1) + + # gluonts datasets + else: + if 'istanbul_traffic' in self.dataset: + df = pd.read_csv(file, parse_dates=['datetime'], index_col='datetime') + df = df.resample("h").mean() + elif 'turkey_power' in self.dataset: + df = pd.read_csv(file) + df.Date_Time = pd.to_datetime(df.Date_Time, format="%d.%m.%Y %H:%M") + df = df.set_index("Date_Time") + else: + df = pd.read_csv(file, index_col=0, parse_dates=True) + + if normalize: + end = ( + offset + if offset is not None + else ( + len(df[df.index <= date_offset].index) + if date_offset is not None + else len(df.index) + ) + ) + df = self.scale(df, 0, end) + + if dataset_type == "long": + _from_dataframe = _from_long_dataframe + elif dataset_type == "wide": + _from_dataframe = _from_wide_dataframe + elif dataset_type == "wide_multivariate": + _from_dataframe = _from_wide_dataframe_multivariate + else: + raise ValueError( + f"Unrecognized dataset_type, {dataset_type}." + " Valid options are 'long', 'wide', and 'wide_multivariate'." + ) + + example_gen_func, features = _from_dataframe( + df, freq=freq, offset=offset, date_offset=date_offset + ) + hf_dataset = datasets.Dataset.from_generator( + example_gen_func, features=features + ) + hf_dataset.info.dataset_name = self.dataset + hf_dataset.save_to_disk(self.storage_path / 'pf' / self.dataset) + + def load_dataset( + self, transform_map: dict[str, Callable[..., Transformation]] + ) -> Dataset: + return FinetuneDataset( + self.windows, + HuggingFaceDatasetIndexer( + datasets.load_from_disk( + str(self.storage_path / 'pf' / self.dataset), + ) + ), + transform=transform_map[self.dataset]( + distance=self.distance, + prediction_length=self.prediction_length, + context_length=self.context_length, + patch_size=self.patch_size, + ), + ) + + def scale(self, data, start, end): + train = data[start:end] + self.mean = train.mean(axis=0) + self.std = train.std(axis=0) + return (data - self.mean) / (self.std + 1e-10) + + +@dataclass +class SimpleEvalDatasetBuilder(DatasetBuilder): + dataset: str + offset: Optional[int] + windows: Optional[int] + distance: Optional[int] + prediction_length: Optional[int] + context_length: Optional[int] + patch_size: Optional[int] + storage_path: Path = env.CUSTOM_DATA_PATH + + def __post_init__(self): + self.storage_path = Path(self.storage_path) + + def build_dataset( + self, + file: Path, + dataset_type: str, + freq: str = "H", + mean: pd.Series = None, + std: pd.Series = None, + ): + # gluonts datasets + if self.dataset.removesuffix("_eval") in datasets_info: + ds_info = datasets_info[self.dataset.removesuffix("_eval")] + + time_index = pd.period_range( + start=ds_info.start_date, + freq=ds_info.freq, + periods=ds_info.num_time_steps, + ) + time_index = time_index.to_timestamp() + + df = cast( + pd.DataFrame, + pd.read_csv(ds_info.url, header=None), # type: ignore + ) + timeseries = load_from_pandas( + df=df, time_index=time_index, agg_freq=ds_info.agg_freq + ) + df = pd.concat(timeseries, axis=1) + + # gluonts datasets + else: + if 'istanbul_traffic' in self.dataset: + df = pd.read_csv(file, parse_dates=['datetime'], index_col='datetime') + df = df.resample("h").mean() + elif 'turkey_power' in self.dataset: + df = pd.read_csv(file) + df.Date_Time = pd.to_datetime(df.Date_Time, format="%d.%m.%Y %H:%M") + df = df.set_index("Date_Time") + else: + df = pd.read_csv(file, index_col=0, parse_dates=True) + + if mean is not None and std is not None: # Qz: Normalize data like LSF + df = (df - mean) / (std + 1e-10) + + if dataset_type == "long": + _from_dataframe = _from_long_dataframe + elif dataset_type == "wide": + _from_dataframe = _from_wide_dataframe + elif dataset_type == "wide_multivariate": + _from_dataframe = _from_wide_dataframe_multivariate + else: + raise ValueError( + f"Unrecognized dataset_type, {dataset_type}." + " Valid options are 'long', 'wide', and 'wide_multivariate'." + ) + + example_gen_func, features = _from_dataframe(df, freq=freq) + hf_dataset = datasets.Dataset.from_generator( + example_gen_func, features=features + ) + hf_dataset.info.dataset_name = self.dataset + hf_dataset.save_to_disk(self.storage_path / 'pf' / self.dataset) + + def load_dataset( + self, transform_map: dict[str, Callable[..., Transformation]] + ) -> Dataset: + return EvalDataset( + self.windows, + HuggingFaceDatasetIndexer( + datasets.load_from_disk( + str(self.storage_path / 'pf' / self.dataset), + ) + ), + transform=transform_map[self.dataset]( + offset=self.offset, + distance=self.distance, + prediction_length=self.prediction_length, + context_length=self.context_length, + patch_size=self.patch_size, + ), + ) + + +def generate_finetune_builder( + dataset: str, + train_length: int, + prediction_length: int, + context_length: int, + patch_size: int, + storage_path: Path = env.CUSTOM_DATA_PATH, +) -> SimpleFinetuneDatasetBuilder: + """ + Set distance=1 for training data. Same as standard LSF setting. + """ + return SimpleFinetuneDatasetBuilder( + dataset=dataset, + windows=(train_length - context_length) // prediction_length, + distance=prediction_length, + prediction_length=prediction_length, + context_length=context_length, + patch_size=patch_size, + storage_path=storage_path, + ) + + +def generate_eval_builder( + dataset: str, + offset: int, + eval_length: int, + prediction_length: int, + context_length: int, + patch_size: int, + storage_path: Path = env.CUSTOM_DATA_PATH, +) -> SimpleEvalDatasetBuilder: + """ + Set distance according to dataset. Decrease the number of validation samples to reduce computational cost. + """ + + return SimpleEvalDatasetBuilder( + dataset=dataset, + offset=offset, + windows=eval_length, + distance=1, + prediction_length=prediction_length, + context_length=context_length, + patch_size=patch_size, + storage_path=storage_path, + ) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("dataset_name", type=str) + parser.add_argument("file_path", type=str) + parser.add_argument( + "--dataset_type", + type=str, + choices=["wide", "long", "wide_multivariate"], + default="wide", + ) + parser.add_argument( + "--offset", + type=int, + default=None, + ) + parser.add_argument( + "--date_offset", + type=str, + default=None, + ) + # Define the `freq` argument with a default value. Use this value as 'freq' if 'freq' is None. + parser.add_argument( + "--freq", + default="H", # Set the default value + help="The user specified frequency", + ) + parser.add_argument( + "--normalize", + action="store_true", + help="Normalize train and eval data with train statistics", + ) + + args = parser.parse_args() + + # Create training dataset + # If offset/date_offset is not provided, the whole data will be used for training. + # Otherwise, only the part before offset is used for training. + train_dataset_builder = SimpleFinetuneDatasetBuilder( + dataset=args.dataset_name, + windows=None, + distance=None, + prediction_length=None, + context_length=None, + patch_size=None, + ) + train_dataset_builder.build_dataset( + file=Path(args.file_path), + dataset_type=args.dataset_type, + offset=args.offset, + date_offset=pd.Timestamp(args.date_offset) if args.date_offset else None, + freq=args.freq, + normalize=args.normalize, # Qz: To align with LSF. Default is False + ) + + # Create a validation dataset if offset/date_offset is provided. + # Eval dataset include the whole data. + if args.offset is not None or args.date_offset is not None: + SimpleEvalDatasetBuilder( + f"{args.dataset_name}_eval", + offset=None, + windows=None, + distance=None, + prediction_length=None, + context_length=None, + patch_size=None, + ).build_dataset( + file=Path(args.file_path), + dataset_type=args.dataset_type, + freq=args.freq, + mean=train_dataset_builder.mean, + std=train_dataset_builder.std, + ) diff --git a/src/uni2ts/data/builder/simple.py b/src/uni2ts/data/builder/simple.py index 1ec2867..832f880 100644 --- a/src/uni2ts/data/builder/simple.py +++ b/src/uni2ts/data/builder/simple.py @@ -243,7 +243,7 @@ def build_dataset( example_gen_func, features=features ) hf_dataset.info.dataset_name = self.dataset - hf_dataset.save_to_disk(self.storage_path / self.dataset) + hf_dataset.save_to_disk(self.storage_path / 'lsf' / self.dataset) def load_dataset( self, transform_map: dict[str, Callable[..., Transformation]] @@ -251,7 +251,7 @@ def load_dataset( return TimeSeriesDataset( HuggingFaceDatasetIndexer( datasets.load_from_disk( - str(self.storage_path / self.dataset), + str(self.storage_path / 'lsf' / self.dataset), ) ), transform=transform_map[self.dataset](), @@ -331,7 +331,7 @@ def build_dataset( example_gen_func, features=features ) hf_dataset.info.dataset_name = self.dataset - hf_dataset.save_to_disk(self.storage_path / self.dataset) + hf_dataset.save_to_disk(self.storage_path / 'lsf' / self.dataset) def load_dataset( self, transform_map: dict[str, Callable[..., Transformation]] @@ -340,7 +340,7 @@ def load_dataset( self.windows, HuggingFaceDatasetIndexer( datasets.load_from_disk( - str(self.storage_path / self.dataset), + str(self.storage_path / 'lsf' / self.dataset), ) ), transform=transform_map[self.dataset]( @@ -402,7 +402,7 @@ def build_dataset( example_gen_func, features=features ) hf_dataset.info.dataset_name = self.dataset - hf_dataset.save_to_disk(self.storage_path / self.dataset) + hf_dataset.save_to_disk(self.storage_path / 'lsf' / self.dataset) def load_dataset( self, transform_map: dict[str, Callable[..., Transformation]] @@ -411,7 +411,7 @@ def load_dataset( self.windows, HuggingFaceDatasetIndexer( datasets.load_from_disk( - str(self.storage_path / self.dataset), + str(self.storage_path / 'lsf' / self.dataset), ) ), transform=transform_map[self.dataset]( diff --git a/src/uni2ts/model/lsf_moirai/finetune.py b/src/uni2ts/model/lsf_moirai/finetune.py index fb1a4bb..89a4af1 100644 --- a/src/uni2ts/model/lsf_moirai/finetune.py +++ b/src/uni2ts/model/lsf_moirai/finetune.py @@ -72,6 +72,7 @@ from .module import MoiraiModule +from uni2ts.module.multi_scale.attention import GroupedQueryAttention class MoiraiFinetune(L.LightningModule): seq_fields: tuple[str, ...] = ( @@ -138,6 +139,32 @@ def __init__( self.patch_size = patch_size self.finetune_pattern = finetune_pattern + self.dropout_p = module_kwargs["dropout_p"] + self.attn_dropout_p = module_kwargs["attn_dropout_p"] + + def post_init(self): + if self.dropout_p > 0: + # for module in self.module.modules(): + # if isinstance(module, torch.nn.Dropout): + # module.p = self.dropout_p + + for name, module in self.module.named_modules(): + if isinstance(module, torch.nn.Dropout) and name.endswith('dropout'): + module.p = self.dropout_p + print(f"Set p of {name} to {self.dropout_p}") + + # for name, module in self.module.named_modules(): + # if isinstance(module, torch.nn.Dropout) and any( + # name.endswith(suffix) for suffix in ['dropout1', 'dropout2']): + # module.p = self.dropout_p + # print(f"Set p of {name} to {self.dropout_p}") + + if self.attn_dropout_p > 0: + for module in self.module.modules(): + if isinstance(module, GroupedQueryAttention): + module.attn_dropout_p = self.attn_dropout_p + + def forward( self, target: Float[torch.Tensor, "*batch seq_len max_patch"], @@ -271,11 +298,174 @@ def validation_step( return val_loss + # def configure_optimizers(self) -> dict: + # decay = set() + # no_decay = set() + # + # if "full" in self.finetune_pattern: + # if "wo_head" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "param_proj" in pn: + # p.requires_grad = False + # pass + # else: + # for param in self.parameters(): + # param.requires_grad = False + # + # # Unfreeze the corresponding params + # if "param_proj" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "param_proj" in pn: + # p.requires_grad = True + # + # if "in_proj" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "in_proj" in pn: + # p.requires_grad = True + # + # if "norm" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "norm1" in pn or "norm2" in pn: + # p.requires_grad = True + # + # if "mask" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "mask_encoding" in pn: + # p.requires_grad = True + # + # if "ffn" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "ffn" in pn: + # p.requires_grad = True + # + # if "q_proj" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "q_proj" in pn: + # p.requires_grad = True + # + # if "k_proj" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "k_proj" in pn: + # p.requires_grad = True + # + # if "v_proj" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "v_proj" in pn: + # p.requires_grad = True + # + # if "attn_norm" in self.finetune_pattern: # + # for pn, p in self.named_parameters(): + # if "self_attn.q_norm" in pn or "self_attn.k_norm" in pn: + # p.requires_grad = True + # + # if "var_attn_bias" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "var_attn_bias" in pn: + # p.requires_grad = True + # + # if "out_proj" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if "out_proj" in pn: + # p.requires_grad = True + # + # if "studentT" in self.finetune_pattern: + # for pn, p in self.named_parameters(): + # if ( + # "param_proj.proj.components.0" in pn + # or "param_proj.proj.weights_logits" in pn + # ): + # p.requires_grad = True + # + # whitelist_params = ( + # LearnedProjection, + # MultiInSizeLinear, + # MultiOutSizeLinear, + # nn.Linear, + # ) + # blacklist_params = ( + # BinaryAttentionBias, + # LearnedEmbedding, + # RMSNorm, + # nn.Embedding, + # nn.LayerNorm, + # ) + # + # for mn, m in self.named_modules(): + # for pn, p in m.named_parameters(): + # if not p.requires_grad: + # continue + # + # fpn = f"{mn}.{pn}" if mn else pn + # if pn.endswith("bias"): + # no_decay.add(fpn) + # elif pn.endswith("weight") and isinstance(m, whitelist_params): + # decay.add(fpn) + # elif pn.endswith("weight") and isinstance(m, blacklist_params): + # no_decay.add(fpn) + # + # # validate that we considered every parameter + # param_dict = {pn: p for pn, p in self.named_parameters() if p.requires_grad} + # self.trainable_params = param_dict + # + # inter_params = decay & no_decay + # union_params = decay | no_decay + # assert ( + # len(inter_params) == 0 + # ), f"parameters {str(inter_params)} made it into both decay/no_decay sets!" + # assert ( + # len(param_dict.keys() - union_params) == 0 + # ), f"parameters {str(param_dict.keys() - union_params)} were not separated into either decay/no_decay set!" + # + # optim_groups = [ + # { + # "params": filter( + # lambda p: p.requires_grad, + # [param_dict[pn] for pn in sorted(list(decay))], + # ), + # "weight_decay": self.hparams.weight_decay, + # }, + # { + # "params": filter( + # lambda p: p.requires_grad, + # [param_dict[pn] for pn in sorted(list(no_decay))], + # ), + # "weight_decay": 0.0, + # }, + # ] + # + # optimizer = torch.optim.AdamW( + # optim_groups, + # lr=self.hparams.lr, + # betas=(self.hparams.beta1, self.hparams.beta2), + # eps=1e-6, + # ) + # scheduler = get_scheduler( + # SchedulerType.CONSTANT, # Use constant lr scheduler + # optimizer, + # num_warmup_steps=self.hparams.num_warmup_steps, + # num_training_steps=self.hparams.num_training_steps, + # ) + # return { + # "optimizer": optimizer, + # "lr_scheduler": { + # "scheduler": scheduler, + # "monitor": "train_loss", + # "interval": "step", + # }, + # } + + def configure_optimizers(self) -> dict: - decay = set() - no_decay = set() + encoder_decay = set() + encoder_no_decay = set() + head_decay = set() + head_no_decay = set() if "full" in self.finetune_pattern: + if "wo_head" in self.finetune_pattern: + for pn, p in self.named_parameters(): + if "param_proj" in pn: + p.requires_grad = False pass else: for param in self.parameters(): @@ -365,19 +555,29 @@ def configure_optimizers(self) -> dict: continue fpn = f"{mn}.{pn}" if mn else pn - if pn.endswith("bias"): - no_decay.add(fpn) - elif pn.endswith("weight") and isinstance(m, whitelist_params): - decay.add(fpn) - elif pn.endswith("weight") and isinstance(m, blacklist_params): - no_decay.add(fpn) + + if "param_proj" in fpn: + if pn.endswith("bias"): + head_no_decay.add(fpn) + elif pn.endswith("weight") and isinstance(m, whitelist_params): + head_decay.add(fpn) + elif pn.endswith("weight") and isinstance(m, blacklist_params): + head_no_decay.add(fpn) + + else: + if pn.endswith("bias"): + encoder_no_decay.add(fpn) + elif pn.endswith("weight") and isinstance(m, whitelist_params): + encoder_decay.add(fpn) + elif pn.endswith("weight") and isinstance(m, blacklist_params): + encoder_no_decay.add(fpn) # validate that we considered every parameter param_dict = {pn: p for pn, p in self.named_parameters() if p.requires_grad} self.trainable_params = param_dict - inter_params = decay & no_decay - union_params = decay | no_decay + inter_params = encoder_decay & encoder_no_decay & head_decay & head_no_decay + union_params = encoder_decay | encoder_no_decay | head_decay | head_no_decay assert ( len(inter_params) == 0 ), f"parameters {str(inter_params)} made it into both decay/no_decay sets!" @@ -389,22 +589,40 @@ def configure_optimizers(self) -> dict: { "params": filter( lambda p: p.requires_grad, - [param_dict[pn] for pn in sorted(list(decay))], + [param_dict[pn] for pn in sorted(list(encoder_decay))], + ), + "lr": self.hparams.lr, + "weight_decay": self.hparams.weight_decay, + }, + { + "params": filter( + lambda p: p.requires_grad, + [param_dict[pn] for pn in sorted(list(encoder_no_decay))], + ), + "lr": self.hparams.lr, + "weight_decay": 0.0, + }, + { + "params": filter( + lambda p: p.requires_grad, + [param_dict[pn] for pn in sorted(list(head_decay))], ), + "lr": 20.*self.hparams.lr, "weight_decay": self.hparams.weight_decay, }, { "params": filter( lambda p: p.requires_grad, - [param_dict[pn] for pn in sorted(list(no_decay))], + [param_dict[pn] for pn in sorted(list(head_no_decay))], ), + "lr": 20.*self.hparams.lr, "weight_decay": 0.0, }, ] optimizer = torch.optim.AdamW( optim_groups, - lr=self.hparams.lr, + # lr=self.hparams.lr, betas=(self.hparams.beta1, self.hparams.beta2), eps=1e-6, ) diff --git a/src/uni2ts/model/lsf_moirai_point/finetune.py b/src/uni2ts/model/lsf_moirai_point/finetune.py index 911e813..ef6ec63 100644 --- a/src/uni2ts/model/lsf_moirai_point/finetune.py +++ b/src/uni2ts/model/lsf_moirai_point/finetune.py @@ -318,6 +318,7 @@ def configure_optimizers(self) -> dict: MultiInSizeLinear, MultiOutSizeLinear, nn.Linear, + nn.Conv1d ) blacklist_params = ( BinaryAttentionBias, diff --git a/src/uni2ts/model/lsf_moirai_point/module.py b/src/uni2ts/model/lsf_moirai_point/module.py index 3d519b6..70b2d5b 100644 --- a/src/uni2ts/model/lsf_moirai_point/module.py +++ b/src/uni2ts/model/lsf_moirai_point/module.py @@ -132,11 +132,13 @@ def replace_forecast_head(self, seq_len, pred_len): self.distr_output = None self.param_proj = None - self.head_dropout = nn.Dropout(p=0.7, inplace=False) - self.head_fc1 = nn.Linear( - in_features=seq_len * self.d_model, out_features=self.d_model - ) - self.head_fc2 = nn.Linear(in_features=self.d_model, out_features=pred_len) + # self.head_dropout = nn.Dropout(p=0.7, inplace=False) + # self.head_fc1 = nn.Linear( + # in_features=seq_len * self.d_model, out_features=self.d_model + # ) + # self.head_fc2 = nn.Linear(in_features=self.d_model, out_features=pred_len) + + self.head = CNNPredictionHead(input_dim=self.d_model, hidden_dim=self.d_model//4, seq_len=seq_len, output_dim=pred_len) def forward( self, @@ -184,10 +186,60 @@ def forward( var_id=variate_id, ) - reprs = self.head_dropout(reprs.flatten(1)) - pred = self.head_fc1(reprs) - pred = self.head_fc2(pred) # (bs, pl) + # reprs = self.head_dropout(reprs.flatten(1)) + # pred = self.head_fc1(reprs) + # pred = self.head_fc2(pred) # (bs, pl) + + pred = self.head(reprs) + loc = loc[:, 0] scale = scale[:, 0] pred = pred * scale + loc return pred + + +class CNNPredictionHead(nn.Module): + def __init__(self, input_dim, hidden_dim, output_dim, seq_len, kernel_size=3): + """ + Args: + input_dim: 每个时间步的特征维度 + hidden_dim: CNN 中间层的隐藏维度 + output_dim: 最终预测的输出维度 + kernel_size: 卷积核大小 + """ + super(CNNPredictionHead, self).__init__() + + # 1D卷积层,用于提取局部特征 + self.conv1 = nn.Conv1d(in_channels=input_dim, out_channels=hidden_dim, kernel_size=kernel_size, + padding=kernel_size // 2) + + # 1D卷积层,进一步提取特征 + self.conv2 = nn.Conv1d(in_channels=hidden_dim, out_channels=hidden_dim, kernel_size=kernel_size, + padding=kernel_size // 2) + + # 全连接层,将展开后的特征映射到预测输出 + self.fc = nn.Linear(hidden_dim * seq_len, output_dim) + + def forward(self, reprs): + """ + Args: + reprs: Tensor, 输入的序列特征,形状为 (bs, seq_len, dim) + Returns: + pred: Tensor, 预测结果,形状为 (bs, output_dim) + """ + # 将 reprs 从 (bs, seq_len, dim) 转置为 (bs, dim, seq_len) 以便于 1D 卷积处理 + reprs = reprs.permute(0, 2, 1) # 转置为 (bs, dim, seq_len) + + # 通过第一个卷积层 + x = F.relu(self.conv1(reprs)) + + # 通过第二个卷积层 + x = F.relu(self.conv2(x)) + + # 展开特征,将 (bs, hidden_dim, seq_len) 展开为 (bs, seq_len * hidden_dim) + x = x.view(x.size(0), -1) + + # 全连接层进行最终预测 + pred = self.fc(x) + + return pred diff --git a/src/uni2ts/model/multi_scale_moirai/finetune.py b/src/uni2ts/model/multi_scale_moirai/finetune.py index b73520e..72662d3 100644 --- a/src/uni2ts/model/multi_scale_moirai/finetune.py +++ b/src/uni2ts/model/multi_scale_moirai/finetune.py @@ -36,6 +36,7 @@ BinaryAttentionBias, LearnedEmbedding, LearnedProjection, + MultiScaleRotaryProjection ) from uni2ts.module.ts_embed import MultiInSizeLinear, MultiOutSizeLinear from uni2ts.optim import SchedulerType, get_scheduler @@ -128,17 +129,49 @@ def __init__( self.num_new_scales = num_new_scales self.ds_factor = ds_factor + self.token_idx_per_scale = self._get_token_idx_per_scale() + def post_init(self): - for layer in self.module.encoder.layers: - # Check if the layer has an attribute named `self_attn` and if it is an instance of GroupedQueryAttention - if hasattr(layer, 'self_attn') and isinstance(layer.self_attn, GroupedQueryAttention): - # Call post_init() method of the GroupedQueryAttention object - layer.self_attn.init_multi_scale_modules(self.context_length, self.patch_size, self.num_new_scales, self.ds_factor) + # for layer in self.module.encoder.layers: + # # Check if the layer has an attribute named `self_attn` and if it is an instance of GroupedQueryAttention + # if hasattr(layer, 'self_attn') and isinstance(layer.self_attn, GroupedQueryAttention): + # # Call post_init() method of the GroupedQueryAttention object + # layer.self_attn.init_multi_scale_modules(self.context_length, self.patch_size, self.num_new_scales, self.ds_factor) + + for module in self.module.encoder.modules(): + if isinstance(module, MultiScaleRotaryProjection): + module.post_init(self.token_idx_per_scale) - # ToDo: Call psot_init() method to replace BinaryAttentionBias to CrossVariateAttentionBias + # ToDo: Call post_init() method to replace BinaryAttentionBias to CrossVariateAttentionBias # from_pretrained的Pipeline是什么?先init,再load? 然后load不了的参数自动忽略?如果是这样就不用加post_init # 直接再transformer处修改var_attn_bias的类型就行了 + + def _get_token_idx_per_scale(self): + base_token_len = math.ceil(self.context_length / self.patch_size) + math.ceil(self.prediction_length / self.patch_size) + ctx_len = self.context_length + new_scale_token_len = [] + + # New scales only include context part. + for i in range(self.num_new_scales): + ctx_len = math.ceil(ctx_len / self.ds_factor) + ctx_token_len = math.ceil(ctx_len / self.patch_size) + + new_scale_token_len.append(ctx_token_len) + + token_idx_per_scale = [list(range(base_token_len))] + + for i in range(self.num_new_scales): + start = base_token_len if i == 0 else end + end = start + new_scale_token_len[i] + + index = list(range(start, end)) + token_idx_per_scale.append(index) + + return token_idx_per_scale + + + def forward( self, target: Float[torch.Tensor, "*batch seq_len max_patch"], @@ -291,6 +324,9 @@ def configure_optimizers(self) -> dict: if "film" in pn: p.requires_grad = True + if "var_attn_bias.emb" in pn: + p.requires_grad = True + # Unfreeze the corresponding params if "param_proj" in self.finetune_pattern: for pn, p in self.named_parameters(): diff --git a/src/uni2ts/model/multi_scale_moirai/forecast.py b/src/uni2ts/model/multi_scale_moirai/forecast.py index 556098e..cd9b5aa 100644 --- a/src/uni2ts/model/multi_scale_moirai/forecast.py +++ b/src/uni2ts/model/multi_scale_moirai/forecast.py @@ -43,6 +43,15 @@ from uni2ts.module.multi_scale.attention import GroupedQueryAttention +from uni2ts.module.position import ( + BinaryAttentionBias, + LearnedEmbedding, + LearnedProjection, + MultiScaleRotaryProjection +) + + + class SampleNLLLoss(_PackedNLLLoss): def reduce_loss( self, @@ -112,15 +121,47 @@ def __init__( self.ds_factor = ds_factor self.strict_loading = False + self.token_idx_per_scale = self._get_token_idx_per_scale() + self.post_init() # ToDO: Make it optional. + def post_init(self): - for layer in self.module.encoder.layers: - # Check if the layer has an attribute named `self_attn` and if it is an instance of GroupedQueryAttention - if hasattr(layer, 'self_attn') and isinstance(layer.self_attn, GroupedQueryAttention): - # Call post_init() method of the GroupedQueryAttention object - layer.self_attn.init_multi_scale_modules(self.hparams.context_length, self.hparams.patch_size, self.num_new_scales, self.ds_factor) + # for layer in self.module.encoder.layers: + # # Check if the layer has an attribute named `self_attn` and if it is an instance of GroupedQueryAttention + # if hasattr(layer, 'self_attn') and isinstance(layer.self_attn, GroupedQueryAttention): + # # Call post_init() method of the GroupedQueryAttention object + # layer.self_attn.init_multi_scale_modules(self.hparams.context_length, self.hparams.patch_size, self.num_new_scales, self.ds_factor) + + for module in self.module.encoder.modules(): + if isinstance(module, MultiScaleRotaryProjection): + module.post_init(self.token_idx_per_scale) + + + def _get_token_idx_per_scale(self): + base_token_len = math.ceil(self.hparams.context_length / self.hparams.patch_size) + math.ceil(self.hparams.prediction_length / self.hparams.patch_size) + ctx_len = self.hparams.context_length + new_scale_token_len = [] + + # New scales only include context part. + for i in range(self.num_new_scales): + ctx_len = math.ceil(ctx_len / self.ds_factor) + ctx_token_len = math.ceil(ctx_len / self.hparams.patch_size) + + new_scale_token_len.append(ctx_token_len) + + token_idx_per_scale = [list(range(base_token_len))] + + for i in range(self.num_new_scales): + start = base_token_len if i == 0 else end + end = start + new_scale_token_len[i] + + index = list(range(start, end)) + token_idx_per_scale.append(index) + + return token_idx_per_scale + @contextmanager def hparams_context( diff --git a/src/uni2ts/model/multi_scale_moirai/module.py b/src/uni2ts/model/multi_scale_moirai/module.py index 667f04e..12fe158 100644 --- a/src/uni2ts/model/multi_scale_moirai/module.py +++ b/src/uni2ts/model/multi_scale_moirai/module.py @@ -32,8 +32,10 @@ from uni2ts.module.packed_scaler import PackedNOPScaler, PackedStdScaler from uni2ts.module.position import ( BinaryAttentionBias, + CrossVariateAttentionBias, QueryKeyProjection, RotaryProjection, + MultiScaleRotaryProjection ) from uni2ts.module.ts_embed import MultiInSizeLinear @@ -80,7 +82,6 @@ def __init__( attn_dropout_p: float, dropout_p: float, scaling: bool = True, - num_new_scales: int = 2, ): """ :param distr_output: distribution output object @@ -126,12 +127,19 @@ def __init__( use_qk_norm=True, var_attn_bias_layer=partial( BinaryAttentionBias - ), # ToDo: 这个var attn bias可以改 + # CrossVariateAttentionBias, + # num_vars=4 # ToDo: 这个num_vars得提供外部接口 + ), time_qk_proj_layer=partial( QueryKeyProjection, - proj_layer=RotaryProjection, + proj_layer=MultiScaleRotaryProjection, kwargs=dict(max_len=max_seq_len), - partial_factor=(0.0, 0.5), + partial_factor=(0.0, 0.5), # 之前的partial factor是0-0.5 + + # QueryKeyProjection, + # proj_layer=RotaryProjection, # ToDo: 可以改 + # kwargs=dict(max_len=max_seq_len), + # partial_factor=(0.0, 0.5), # 之前的partial factor是0-0.5 ), shared_var_attn_bias=False, shared_time_qk_proj=True, @@ -140,7 +148,7 @@ def __init__( self.distr_output = distr_output self.param_proj = self.distr_output.get_param_proj(d_model, patch_sizes) - self.num_new_scales = num_new_scales + # self.num_new_scales = num_new_scales def forward( self, @@ -196,43 +204,3 @@ def forward( distr_param = self.param_proj(reprs, patch_size) distr = self.distr_output.distribution(distr_param, loc=loc, scale=scale) return distr - - def add_new_scale_embedding( - self, - reprs: Float[torch.Tensor, "*batch seq_len d_model"], - sample_id: Int[torch.Tensor, "*batch seq_len"], - variate_id: Int[torch.Tensor, "*batch seq_len"], - ): - - # Each item has the same number of samples. - num_samples_per_item = torch.max(sample_id).item() - - # Each sample has the same seq_len - sample_mask = torch.eq(sample_id.unsqueeze(-1), sample_id.unsqueeze(-2)) - sample_seq_len = sample_mask[0][0].int().sum().item() - - variate_diff = torch.diff(variate_id[0], dim=-1) - variate_change_points = torch.nonzero(variate_diff).flatten() + 1 - variate_change_points = torch.cat( - [ - variate_change_points, - torch.tensor([variate_id.shape[1]]).to(variate_id.device), - ] - ) - - for i in range(self.num_new_scales): - index_scale_i = [] # index of new scale i in all the samples - - for sample in range(num_samples_per_item): - variate_start_idx = ( - variate_change_points[i].item() + sample * sample_seq_len - ) - variate_end_idx = ( - variate_change_points[i + 1].item() + sample * sample_seq_len - ) - index_scale_i.append((variate_start_idx, variate_end_idx)) - - for start, end in index_scale_i: - reprs[..., start:end, :] += self.new_scale_encoding[i].weight - - return reprs diff --git a/src/uni2ts/module/multi_scale/attention.py b/src/uni2ts/module/multi_scale/attention.py index 9288c4a..e399f6b 100644 --- a/src/uni2ts/module/multi_scale/attention.py +++ b/src/uni2ts/module/multi_scale/attention.py @@ -306,22 +306,22 @@ def forward( value = self.v_proj(value) # ToDo: Plan B: Directly apply different Film on query / key to different scales. W.o revising RoPE - if self.num_new_scales is not None: - index_by_variate = self.get_token_index_by_variate(query_var_id) - - for scale in range(self.num_new_scales): - assert torch.equal(query_var_id, kv_var_id), "query_var_id is different from kv_var_id" - index = index_by_variate[scale + 1] - - query_scale = query[..., index, :] # (bs, num_patch_new_scale, dim) - query_scale_reprs = self.film_controller(torch.mean(query_scale, dim=1)) - query_weight = self.query_film_generator[scale](query_scale_reprs) - query[..., index, :] = query_weight.unsqueeze(-2) * query_scale - - key_scale = key[..., index, :] - key_scale_reprs = self.film_controller(torch.mean(key_scale, dim=1)) - key_weight = self.key_film_generator[scale](key_scale_reprs) - key[..., index, :] = key_weight.unsqueeze(-2) * key_scale + # if self.num_new_scales is not None: + # index_by_variate = self.get_token_index_by_variate(query_var_id) + # + # for scale in range(self.num_new_scales): + # assert torch.equal(query_var_id, kv_var_id), "query_var_id is different from kv_var_id" + # index = index_by_variate[scale + 1] + # + # query_scale = query[..., index, :] # (bs, num_patch_new_scale, dim) + # query_scale_reprs = self.film_controller(torch.mean(query_scale, dim=1)) + # query_weight = self.query_film_generator[scale](query_scale_reprs) + # query[..., index, :] = query_weight.unsqueeze(-2) * query_scale + # + # key_scale = key[..., index, :] + # key_scale_reprs = self.film_controller(torch.mean(key_scale, dim=1)) + # key_weight = self.key_film_generator[scale](key_scale_reprs) + # key[..., index, :] = key_weight.unsqueeze(-2) * key_scale # if self.num_new_scales is not None: # index_by_variate = self.get_token_index_by_variate(query_var_id) diff --git a/src/uni2ts/module/multi_scale/transformer.py b/src/uni2ts/module/multi_scale/transformer.py index dd78f37..7d63e00 100644 --- a/src/uni2ts/module/multi_scale/transformer.py +++ b/src/uni2ts/module/multi_scale/transformer.py @@ -23,7 +23,7 @@ from torch import nn from ..ffn import FeedForward, GatedLinearUnitFeedForward -from ..position import AttentionBias, QueryKeyProjection +from ..position import AttentionBias, QueryKeyProjection, MultiScaleRotaryProjection from .attention import GroupedQueryAttention diff --git a/src/uni2ts/module/position/__init__.py b/src/uni2ts/module/position/__init__.py index abc5617..6c8d85d 100644 --- a/src/uni2ts/module/position/__init__.py +++ b/src/uni2ts/module/position/__init__.py @@ -27,6 +27,7 @@ Projection, QueryKeyProjection, RotaryProjection, + MultiScaleRotaryProjection ) __all__ = [ @@ -42,4 +43,5 @@ "QueryKeyProjection", "RotaryProjection", "SinusoidalPositionEncoding", + "MultiScaleRotaryProjection" ] diff --git a/src/uni2ts/module/position/attn_bias.py b/src/uni2ts/module/position/attn_bias.py index 2865463..a1ffeb1 100644 --- a/src/uni2ts/module/position/attn_bias.py +++ b/src/uni2ts/module/position/attn_bias.py @@ -16,7 +16,7 @@ import abc import torch -from einops import einsum, rearrange +from einops import einsum, rearrange, repeat from jaxtyping import Float, Int from torch import nn @@ -93,6 +93,7 @@ def __init__(self, dim: int, num_heads: int, num_groups: int, num_vars: int): # QZ: Initialize a learnable embedding for each variate # Each embedding should contain num_heads embeddings with d dimension? # Each head has num_vars embeddings with d dimension + self.dim = dim self.num_vars = num_vars self.emb = nn.ModuleList( [nn.Embedding(num_embeddings=self.num_heads, embedding_dim=dim//4) for _ in range(num_vars)] @@ -107,10 +108,10 @@ def forward( ) -> Float[torch.Tensor, "*batch #group #hpg q_len kv_len"]: # Create empty tensors for query and kv embeddings bs = query.size(0) - q_len, kv_len = query.size(-2), kv_id.size(-2) + q_len, kv_len = query.size(-2), key.size(-2) q_emb = torch.empty((q_len, self.num_heads, self.dim//4), device=query.device) kv_emb = torch.empty((kv_len, self.num_heads, self.dim//4), device=key.device) - index_by_variate = self.get_token_index_by_variate(query_id) + index_by_variate = self.get_token_index_by_variate(query_id.squeeze()) # Insert the emb based on variate_id for i in range(self.num_vars): @@ -122,11 +123,17 @@ def forward( bias = einsum(q_emb, kv_emb, "q_len n_heads dim , kv_len n_heads dim -> n_heads q_len kv_len") bias = rearrange( bias, - "(group hpg) q_len kv_len -> bs group hpg q_len kv_len", - bs=bs, + "(group hpg) q_len kv_len -> group hpg q_len kv_len", group=self.num_groups, hpg=self.heads_per_group, ) + + bias = repeat( + bias, + "group hpg q_len kv_len -> bs group hpg q_len kv_len", + bs=bs + ) + return bias def get_token_index_by_variate( @@ -143,6 +150,7 @@ def get_token_index_by_variate( return indices_by_variate + class LinearAttentionBias(AttentionBias): def __init__(self, dim: int, num_heads: int, num_groups: int): super().__init__(dim, num_heads, num_groups) diff --git a/src/uni2ts/module/position/attn_projection.py b/src/uni2ts/module/position/attn_projection.py index 274dc33..420d6c3 100644 --- a/src/uni2ts/module/position/attn_projection.py +++ b/src/uni2ts/module/position/attn_projection.py @@ -56,7 +56,7 @@ class RotaryProjection(Projection): def __init__( self, *, - proj_width: int, # ToDo: 这个proj_width怎么传进来的?get_layer传的是dim? + proj_width: int, num_heads: int, num_groups: int, max_len: int = 512, @@ -66,7 +66,7 @@ def __init__( assert ( self.proj_width % 2 == 0 ), f"proj_width must be even, got {self.proj_width}" - self.register_buffer( # QZ: Eq 15 + self.register_buffer( # QZ: Eq 15 (16, ) "theta", 1.0 / torch.pow( @@ -87,7 +87,7 @@ def _init_freq(self, max_len: int): ) m_theta = einsum(position, self.theta, "length, width -> length width") m_theta = repeat(m_theta, "length width -> length (width 2)") - self.register_buffer("cos", torch.cos(m_theta), persistent=False) + self.register_buffer("cos", torch.cos(m_theta), persistent=False) # (512, 32) self.register_buffer("sin", torch.sin(m_theta), persistent=False) @staticmethod @@ -97,15 +97,106 @@ def _rotate(x: Float[torch.Tensor, "... dim"]) -> Float[torch.Tensor, "... dim"] def forward( self, - x: Float[torch.Tensor, "*batch group hpg seq dim"], + x: Float[torch.Tensor, "*batch group hpg seq dim"], # (32, 6, 1, 46, 32) seq_id: Optional[Int[torch.Tensor, "*batch #group #hpg seq"]], ) -> Float[torch.Tensor, "*batch group hpg seq dim"]: self._init_freq(max_len=seq_id.max() + 1) - rot_cos = self.cos[seq_id] + rot_cos = self.cos[seq_id] # (32, 1, 1, 46, 32) rot_sin = self.sin[seq_id] return rot_cos * x + rot_sin * self._rotate(x) # QZ: Eq 34 in the paper +class MultiScaleRotaryProjection(Projection): + def __init__( + self, + *, + proj_width: int, + num_heads: int, + num_groups: int, + max_len: int = 512, + base: int = 10000, + token_idx_per_scale: Optional[list] = None # ToDo: list of time index of each scale [[], [], []] + ): + super().__init__(proj_width, num_heads, num_groups) + + self.token_idx_per_scale = token_idx_per_scale + + assert ( + self.proj_width % 2 == 0 + ), f"proj_width must be even, got {self.proj_width}" + self.register_buffer( # QZ: Eq 15 + "theta", + 1.0 + / torch.pow( + base, + torch.arange(0, self.proj_width, 2, dtype=torch.float) + / self.proj_width, + ), + persistent=False, + ) + + + self.max_len = max_len + + + def post_init(self, token_idx_per_scale): + self.token_idx_per_scale = token_idx_per_scale + self.num_scales = len(token_idx_per_scale) + + for i in range(self.num_scales): + self.register_buffer(f"cos{i}", None, persistent=False) + self.register_buffer(f"sin{i}", None, persistent=False) + self._init_freq(max_len=self.max_len) + + def _init_freq(self, max_len: int): + + for i in range(self.num_scales): + + if i == 0: + position = torch.arange( + max_len, device=self.theta.device, dtype=self.theta.dtype + ) + m_theta = einsum(position, self.theta, "length, width -> length width") + m_theta = repeat(m_theta, "length width -> length (width 2)") + self.register_buffer("cos0", torch.cos(m_theta), persistent=False) + self.register_buffer("sin0", torch.sin(m_theta), persistent=False) + + else: + start, step = sum(list(range(0, 2**i))) / 2**i, 2*i + position = torch.arange( + start=start, end=max_len, step=step, device=self.theta.device, dtype=self.theta.dtype + ) + m_theta = einsum(position, self.theta, "length, width -> length width") + m_theta = repeat(m_theta, "length width -> length (width 2)") + self.register_buffer(f"cos{i}", torch.cos(m_theta), persistent=False) + self.register_buffer(f"sin{i}", torch.sin(m_theta), persistent=False) + + @staticmethod + def _rotate(x: Float[torch.Tensor, "... dim"]) -> Float[torch.Tensor, "... dim"]: + x1, x2 = rearrange(x, "... (dim r) -> r ... dim", r=2) + return rearrange([-x2, x1], "r ... dim -> ... (dim r)", r=2) # noqa + + def forward( + self, + x: Float[torch.Tensor, "*batch group hpg seq dim"], + seq_id: Optional[Int[torch.Tensor, "*batch #group #hpg seq"]], + ) -> Float[torch.Tensor, "*batch group hpg seq dim"]: + + # if self.token_idx_per_scale is None: + # self.token_idx_per_scale = self.get_token_index_by_variate(variate_id) + + + out = torch.empty_like(x, device=x.device, dtype=x.dtype) + + for i in range(self.num_scales): + idx_scale_i = self.token_idx_per_scale[i] + + rot_cos = getattr(self, f"cos{i}")[seq_id[..., :, :, idx_scale_i]] + rot_sin = getattr(self, f"sin{i}")[seq_id[..., :, :, idx_scale_i]] + out[..., :, :, idx_scale_i, :] = rot_cos * x[..., :, :, idx_scale_i, :] + rot_sin * self._rotate(x[..., :, :, idx_scale_i, :]) + + return out # QZ: Eq 34 in the paper + class LearnedProjection(Projection): def __init__( self, diff --git a/src/uni2ts/transform/multi_scale.py b/src/uni2ts/transform/multi_scale.py index 34fa040..c7673cf 100644 --- a/src/uni2ts/transform/multi_scale.py +++ b/src/uni2ts/transform/multi_scale.py @@ -22,7 +22,7 @@ class AddNewScaleContextSeries(CheckArrNDimMixin, Transformation): """ target_field: str - ds_factor: str + ds_factor: int num_new_scales_fields: tuple[str, ...] expected_ndim: int = 2