Files
JEPA/config_jepa.yaml
yilv 9332e557de fix(jepa): 调整训练超参数并优化JEPA损失计算
- 调整基础学习率从2.0e-4至1.0e-4
- 将初始EMA动量从0.999改为0.996并添加注释
- 将JEPA损失替换为原始表征的MSE,移除冗余层归一化步骤
- 修复余弦相似度计算中误用归一化目标的问题
2026-05-30 12:25:06 +08:00

80 lines
2.6 KiB
YAML

# ==============================================================================
# CWT-JEPA Training Configuration
# Joint Embedding Predictive Architecture for Physiological Signals
# ==============================================================================
# ------------------------------------------------------------------------------
# 1. Training & Optimization
# ------------------------------------------------------------------------------
train:
epochs: 300 # JEPA 收敛更快,300 epochs 通常足够
batch_size: 256 # 与原 CWT-MAE 保持一致
accum_iter: 1
# 学习率 (JEPA 对 LR 敏感度较低,可略微提高)
base_lr: 1.0e-4
min_lr: 1.0e-6
warmup_epochs: 10
auto_scale_lr: True
weight_decay: 0.05
clip_grad: 3.0
use_amp: True
use_compile: False # 如 GPU 支持可开启
save_freq: 50
save_dir: "./checkpoint_jepa"
resume: "./checkpoint_jepa/checkpoint_last.pth"
# ------------------------------------------------------------------------------
# 2. Dataset Configuration
# ------------------------------------------------------------------------------
data:
index_path: "train_index.json" # 指向 CWT_MAE_v3 的数据索引
signal_len: 1000
num_workers: 16
use_sliding_window: True
window_stride: 500
# ------------------------------------------------------------------------------
# 3. Model Architecture (CWT-JEPA)
# ------------------------------------------------------------------------------
model:
# --- Input Processing (保持与原 CWT-MAE 一致) ---
cwt_scales: 64
use_diff: True
# --- Patch 参数 ---
patch_size_time: 25
patch_size_freq: 8
# --- Context & Target Encoder (共享架构, 独立权重) ---
embed_dim: 768
depth: 12
num_heads: 12
mlp_ratio: 4.0
# --- Predictor (Tier 3: 轻量, AdaLN 条件注入) ---
predictor_depth: 6
predictor_num_heads: 12
# --- Multi-block Masking (Tier 1: I-JEPA 风格) ---
mask_ratio: 0.75
num_target_blocks: 4
target_scale_range: [0.15, 0.25] # target 块大小范围
# --- EMA Target Encoder (Tier 1) ---
ema_momentum: 0.996 # 初始动量 (0.999 太慢,target 漂移过快)
ema_end_momentum: 1.0 # 最终动量 (cosine schedule)
# --- SIGReg Anti-collapse (Tier 2: LeJEPA + VICReg) ---
sigreg_lambda: 0.1 # SIGReg 整体权重
sigreg_var_weight: 1.0 # 方差项权重
sigreg_cov_weight: 1.0 # 协方差项权重
# --- Auxiliary Loss ---
stats_loss_weight: 0.1 # 统计量预测损失权重 (辅助任务,不宜过大)
# --- Data Ratio (可选) ---
data_ratio: 1.0