修改脚本结构MOE

This commit is contained in:
2026-04-19 18:33:36 +08:00
parent 745868a456
commit 6693f3916c
13 changed files with 1675 additions and 1096 deletions

View File

@@ -1,70 +1,39 @@
# 默认配置MZM MLP 多输出回归基线
# 将数据 txt 放到 data/ 下并修改 data_path或保持路径指向你的文件
# 默认配置MZM MoE PINN按 notebook 迁移)
data_path: data/dataset.txt
best_hyperparams_path: best_hyperparams.json
split_ratios: [0.7, 0.15, 0.15] # train, val, test可改为 [0.8, 0.1, 0.1]
random_seed: 42
# 切分策略:按 8 维输入分组,避免“同输入异输出”跨集合泄漏;再按目标分桶近似分层
split_mode: grouped_stratified # grouped_stratified | random
split_stratify_target: V_pi
split_stratify_bins: 10
remove_duplicate_rows: true
# 异常值处理策略none | iqr | zscore | quantile_clip
# 默认仅报告极端值,不删除;物理上不可信的 V_pi 由下方区间门控剔除
outlier_strategy: none
# 启用非 none 策略时在训练子集上拟合阈值iqr/zscore 仅删训练集离群行quantile_clip 按训练分位数 winsorize
outlier_apply_to: targets # targets | all
outlier_config:
iqr_k: 1.5
zscore_threshold: 4.0
quantile_lower: 0.001
quantile_upper: 0.999
# 以 txt 第 11 列(列名 V_pi为物理门控仅保留闭区间 [v_pi_min, v_pi_max] 内样本
filter_v_pi_range: true
v_pi_min: 0.0
v_pi_max: 500.0
# 在区间过滤之后,是否再剔除 V_pi<=0若需保留 V_pi=0仍在 [0,500] 内),请设为 false
remove_nonpositive_vpi: false
data:
test_size: 0.1
random_state: 123
filter_v_pi_max: 500.0
model:
input_dim: 8
hidden_dims: [200, 300, 350, 300, 200]
output_dim: 3
batchnorm: false
# 温和 dropout实测略优于全 0见 results/run_20260419_163305
dropout: 0.05
residual: false
hidden_dims: [64, 128, 64]
n_experts: 60
gating_hidden: 8
dropout_rate: 0.0
use_bn: true
activation: relu
optimizer:
name: adamw
lr: 0.001
weight_decay: 0.0001
scheduler:
type: cosine # cosine | plateau
plateau_factor: 0.5
plateau_patience: 10
plateau_min_lr: 1.0e-6
weight_decay: 0.05
betas: [0.9, 0.999]
training:
batch_size: 128
epochs: 300
early_stopping_patience: 30
epochs: 100
num_workers: 0
loss:
type: huber # huber | weighted_mse
huber_delta: 1.0
# BW_3dB, IL, V_pi略加重 V_pi 以小幅提升其测试 R²
target_weights: [1.0, 1.0, 1.2]
# 默认会先从 best_hyperparams.json 读取这些系数,再用此处显式值覆盖
physics:
lambda_bw_mon: 0.0
lambda_IL_mon: 0.3
lambda_vpiL: 0.005
lambda_smooth: 0.1
# 总输出目录;每次训练会在其下创建 run_时间戳/
output_dir: results
# 评估/推理时若未指定 run_dir可填最近一次 run 的路径(可选)
last_run_dir: null