22
33开始训练、评估前,请先下载
44
5- [ ICAR-ENSO数据集] ( https://nbviewer.org/github/MIT-AI-Accelerator/eie-sevir/blob/master/examples/SEVIR_Tutorial.ipynb#download )
5+ [ ICAR-ENSO数据集] ( https://tianchi.aliyun.com/dataset/98942 )
66
7- [ SEVIR数据集] ( https://tianchi.aliyun.com/dataset/98942 )
7+ [ SEVIR数据集] (https://nbviewer.org/github/MIT-AI-Accelerator/eie-sevir/blob/master/examples/SEVIR_Tutorial.ipynb#download
8+ )
89
910=== "模型训练命令"
1011
@@ -77,14 +78,14 @@ EarthFormer 原代码中训练了 ICAR-ENSO 数据集中海面温度 (sst) 和 S
7778
7879<figure markdown >
7980 ![ earthformer-pretraining] ( https://paddle-org.bj.bcebos.com/paddlescience/docs/earthformer/earthformer-pretrain.png ) { loading=lazy style="margin:0 auto;height:70%;width:70%"}
80- <figcaption >earthformer模型预训练 </figcaption >
81+ <figcaption >earthformer 模型预训练 </figcaption >
8182</figure >
8283
8384在推理阶段,给定长度序列为 $T$ 的数据,得到长度序列为 $K$ 的预测结果。
8485
8586<figure markdown >
8687 ![ earthformer-pretraining] ( https://paddle-org.bj.bcebos.com/paddlescience/docs/earthformer/earthformer-infer.png ) { loading=lazy style="margin:0 auto;height:60%;width:60%"}
87- <figcaption >earthformer模型推理 </figcaption >
88+ <figcaption >earthformer 模型推理 </figcaption >
8889</figure >
8990
9091## 3. 海面温度模型实现
@@ -95,7 +96,7 @@ EarthFormer 原代码中训练了 ICAR-ENSO 数据集中海面温度 (sst) 和 S
9596
9697数据集采用了 [ EarthFormer] ( https://github.com/amazon-science/earth-forecasting-transformer/tree/main ) 处理好的 ICAR-ENSO 数据集。
9798
98- 本数据集由气候与应用前沿研究院 ICAR 提供。数据包括 CMIP5/6 模式的历史模拟数据和美国 SODA 模式重建的近100多年历史观测同化数据。每个样本包含以下气象及时空变量:海表温度异常 (SST) ,热含量异常 (T300),纬向风异常 (Ua),经向风异常 (Va),数据维度为 (year,month,lat,lon)。训练数据提供对应月份的 Nino3.4 index 标签数据。测试用的初始场数据为国际多个海洋资料同化结果提供的随机抽取的 n 段 12 个时间序列,数据格式采用NPY格式保存 。
99+ 本数据集由气候与应用前沿研究院 ICAR 提供。数据包括 CMIP5/6 模式的历史模拟数据和美国 SODA 模式重建的近100多年历史观测同化数据。每个样本包含以下气象及时空变量:海表温度异常 (SST) ,热含量异常 (T300),纬向风异常 (Ua),经向风异常 (Va),数据维度为 (year,month,lat,lon)。训练数据提供对应月份的 Nino3.4 index 标签数据。测试用的初始场数据为国际多个海洋资料同化结果提供的随机抽取的 n 段 12 个时间序列,数据格式采用 NPY 格式保存 。
99100
100101** 训练数据:**
101102
@@ -141,9 +142,9 @@ examples/earthformer/earthformer_enso_train.py:58:64
141142
142143` SupervisedConstraint ` 的第一个参数是数据的加载方式,这里使用上文中定义的 ` train_dataloader_cfg ` ;
143144
144- 第二个参数是损失函数的定义,这里使用自定义的损失函数 ` mse_loss ` ;
145+ 第二个参数是损失函数的定义,这里使用自定义的损失函数 ` mse_loss ` ;
145146
146- 第三个参数是约束条件的名字,方便后续对其索引。此处命名为 " Sup" 。
147+ 第三个参数是约束条件的名字,方便后续对其索引。此处命名为 ` Sup ` 。
147148
148149#### 3.2.2 模型构建
149150
@@ -167,7 +168,7 @@ examples/earthformer/conf/earthformer_enso_pretrain.yaml:46:105
167168
168169#### 3.2.3 学习率与优化器构建
169170
170- 本案例中使用的学习率方法为 ` Cosine ` ,学习率大小设置为 2e-4。优化器使用 ` AdamW ` ,并将参数进行分组,使用不同的
171+ 本案例中使用的学习率方法为 ` Cosine ` ,学习率大小设置为 ` 2e-4 ` 。优化器使用 ` AdamW ` ,并将参数进行分组,使用不同的
171172` weight_decay ` ,用 PaddleScience 代码表示如下:
172173
173174``` py linenums="101" title="examples/earthformer/earthformer_enso_train.py"
@@ -186,7 +187,7 @@ examples/earthformer/earthformer_enso_train.py:68:95
186187-- 8 < --
187188```
188189
189- ` SupervisedValidator ` 评估器与 ` SupervisedConstraint ` 比较相似,不同的是评估器需要设置评价指标 ` metric ` ,在这里使用了自定义的评价指标分别是 ` MAE ` 、` MSE ` 、` RMSE ` 、` corr_nino3.4_epoch ` 和 ` corr_nino3.4_weighted_epoch ` 。
190+ ` SupervisedValidator ` 评估器与 ` SupervisedConstraint ` 比较相似,不同的是评估器需要设置评价指标 ` metric ` ,在这里使用了自定义的评价指标分别是 ` MAE ` 、` MSE ` 、` RMSE ` 、` corr_nino3.4_epoch ` 和 ` corr_nino3.4_weighted_epoch ` 。
190191
191192#### 3.2.5 模型训练与评估
192193
@@ -314,9 +315,9 @@ examples/earthformer/earthformer_sevir_train.py:61:67
314315
315316` SupervisedConstraint ` 的第一个参数是数据的加载方式,这里使用上文中定义的 ` train_dataloader_cfg ` ;
316317
317- 第二个参数是损失函数的定义,这里使用自定义的损失函数 ` mse_loss ` ;
318+ 第二个参数是损失函数的定义,这里使用自定义的损失函数 ` mse_loss ` ;
318319
319- 第三个参数是约束条件的名字,方便后续对其索引。此处命名为 " Sup" 。
320+ 第三个参数是约束条件的名字,方便后续对其索引。此处命名为 ` Sup ` 。
320321
321322### 4.2.2 模型构建
322323
@@ -340,7 +341,7 @@ examples/earthformer/conf/earthformer_sevir_pretrain.yaml:58:117
340341
341342#### 4.2.3 学习率与优化器构建
342343
343- 本案例中使用的学习率方法为 ` Cosine ` ,学习率大小设置为 1e-3。优化器使用 ` AdamW ` ,并将参数进行分组,使用不同的 ` weight_decay ` ,用 PaddleScience 代码表示如下:
344+ 本案例中使用的学习率方法为 ` Cosine ` ,学习率大小设置为 ` 1e-3 ` 。优化器使用 ` AdamW ` ,并将参数进行分组,使用不同的 ` weight_decay ` ,用 PaddleScience 代码表示如下:
344345
345346``` py linenums="121" title="examples/earthformer/earthformer_sevir_train.py"
346347-- 8 < --
@@ -445,6 +446,9 @@ examples/earthformer/earthformer_sevir_train.py:279:285
445446创建预测器:
446447
447448``` py linenums="293" title="examples/earthformer/earthformer_sevir_train.py"
449+ -- 8 < --
450+ examples/ earthformer/ earthformer_sevir_train.py:293 :294
451+ -- 8 < --
448452```
449453
450454准备预测数据并进行对应模式的数据预处理:
@@ -483,7 +487,7 @@ examples/earthformer/earthformer_sevir_train.py
483487
484488<figure markdown >
485489 ![ SEVIR-predict] ( https://paddle-org.bj.bcebos.com/paddlescience/docs/earthformer/sevir-predict.png ) { loading=lazy style="margin:0 auto;height:100%;width:100%"}
486- <figcaption >SEVIR中vil的预测结果 ("prediction")与真值结果("target")</figcaption >
490+ <figcaption >SEVIR 中 vil 的预测结果 ("prediction")与真值结果("target")</figcaption >
487491</figure >
488492
489493说明:
0 commit comments