File size: 2,278 Bytes
5a5d1a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# DGMR 训练配置示例
# 论文配置:4 帧雷达观测上下文(num_context=4)预测 18 帧(forecast_steps=18),
# 空间 256×256 单通道,latent_channels=768 / context_channels=384(生成器约 13.4M 参数)。
# 当前默认配置为连通性验证小配置:空间 128×128,预测 6 帧;fake_data.py
# 根据 num_context、forecast_steps 与 batch_size 自动推导每年所需时间长度 T。
model:
  start_epoch: 0
  max_epoch: 100
  lr: 1E-4                 # 论文使用 Adam lr=1e-4 分别训练生成器与判别器
  lr_disc: 1E-4
  patience: 50
  checkpoint_dir: "./data/checkpoints"

  # DGMR 结构参数(论文值见注释)
  forecast_steps: 6        # 预测帧数,论文为 18;小配置取 6
  num_context: 4           # 上下文(观测)帧数,论文为 4
  input_channels: 1        # 每帧通道数,论文为 1(雷达回波)
  output_shape: 128        # 空间尺寸(需 32 整除),论文为 256
  conv_type: "standard"    # standard / coord / 3d
  latent_channels: 384     # 论文为 768
  context_channels: 192    # 论文为 384
  generation_steps: 6      # 网格单元正则器 Monte-Carlo 采样次数,论文为 6
  grid_lambda: 20.0        # 网格单元正则器权重,论文为 20
  precip_weight_cap: 24.0  # 网格单元权重函数上限,论文为 24

# 整个数据读取流程
datapipe:
  name: "ERA5"
  task: "weather_forecasting"

  dataset:
    type: "hdf5"
    data_dir: './data/'
    train_time: [1951, 1952]
    val_time: [1953]
    test_time: [1954]
    img_size: [128, 128]
    verbose: true
    cache: false

    # 气象变量(DGMR 面向单通道雷达回波场,此处为占位变量名)
    channels: ['rain_radar']

  # DataLoader 配置
  # 注意:DGMR 判别器内部含 BatchNorm1d,训练 batch 必须 >= 2。
  # fake_data.py 会保证每个年份至少产生 batch_size 个完整时间窗口。
  dataloader:
    mask_dtype: "float32"
    batch_size: 2
    num_workers: 1
    pin_memory: true
    drop_last: true
    shuffle: false
    prefetch_factor: 2
    persistent_workers: true

  # 分布式配置
  distributed:
    enabled: true
    sampler: "DistributedSampler"
    rank: 0
    world_size: 2
    shuffle: true
    seed: 42
    drop_last: true