Skip to content

微调loss一直保持很小但微调后模型效果比预训练模型更差 #48

@wsy-00

Description

@wsy-00

数据集特点:超过百万个时间点(单变量与多变量都试过,现象相似);
训练10个epochs,vali_loss和test_loss维持在1e-4级别且有逐渐下降趋势;
但微调后效果不佳,如下图:

Image

微调的参数:
# 构建训练命令
cmd = [
sys.executable, 'run.py',
'--task_name', 'forecast',
'--is_training', '1',
'--model_id', model_id,
'--model', 'timer_xl',
'--data', 'UnivariateDatasetBenchmark',
'--root_path', './dataset/',
'--data_path', f'{data_name}.csv',
'--checkpoints', './checkpoints/finetune',
'--adaptation',
'--pretrain_model_path', f'./checkpoints/timer_xl/checkpoint.pth',

    '--input_token_len', '96',    # 与预训练一致
    '--output_token_len', '96',   # 与预训练一致
    '--d_model', '1024',          # 与预训练一致
    '--e_layers', '8',            # 与预训练一致
    '--d_ff', '2048',            # 与预训练一致
    '--n_heads', '8',             # 与预训练一致
    '--dropout', '0.1',
    '--activation', 'relu',
    '--use_norm',                 # 与预训练一致
    
    # # 可以调整的序列长度参数
    '--seq_len', '360',           # 数据处理用的序列长度
    '--test_seq_len', '360',
    '--test_pred_len', '60',

    # 训练配置
    '--itr', '1',
    '--train_epochs', '10',
    '--batch_size', '32',
    '--learning_rate', '0.0001',
    '--weight_decay', '1e-6',
    '--patience', '5',
    '--loss', 'MSE',
    '--cosine',
    '--valid_last',
    '--tmax', '5',
    
    # GPU配置
    '--gpu', '0',
    '--num_workers', '10',
    
    # 其他
    '--des', 'finetune',
    '--seed', '2024'
]

请问我的设置是否有问题?或者说可以从哪些地方检查问题?感谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions