使用内置的 sagemaker 算法进行增量学习
Incremental learning with a built-in sagemaker algorithm
我正在训练 DeepAR AWS SageMaker 内置算法。使用 sagemaker SDK,我可以使用特定的超参数训练模型:
estimator = sagemaker.estimator.Estimator(
sagemaker_session=sagemaker_session,
image_name=image_name,
role=role,
train_instance_count=1,
train_instance_type='ml.c4.2xlarge',
base_job_name='wfp-deepar',
output_path=join(s3_path, 'output')
)
estimator.set_hyperparameters(**{
'time_freq': 'M',
'epochs': '50',
'mini_batch_size': '96',
'learning_rate': '1E-3',
'context_length': '12',
'dropout_rate': 0,
'prediction_length': '12'
})
estimator.fit(inputs=data_channels, wait=True, job_name='wfp-deepar-job-level-5')
我想用较小的学习率再次训练生成的模型。我按照这里描述的增量训练方法:https://docs.aws.amazon.com/en_pv/sagemaker/latest/dg/incremental-training.html,但它不起作用,显然(根据link),只有两个内置模型支持增量学习。
有没有人找到解决这个问题的方法,以便他们可以训练具有预定学习率的内置算法?
遗憾的是,SageMaker 内置的 DeepAR 模型不支持学习率调度和增量学习。如果你想在 DeepAR 架构上实施学习率平台计划,我建议考虑:
- 使用开源 DeepAR 实现 (code, demo)
- 或使用具有学习率调度能力的DeepAR+ algo of the Amazon Forecast service。
我正在训练 DeepAR AWS SageMaker 内置算法。使用 sagemaker SDK,我可以使用特定的超参数训练模型:
estimator = sagemaker.estimator.Estimator(
sagemaker_session=sagemaker_session,
image_name=image_name,
role=role,
train_instance_count=1,
train_instance_type='ml.c4.2xlarge',
base_job_name='wfp-deepar',
output_path=join(s3_path, 'output')
)
estimator.set_hyperparameters(**{
'time_freq': 'M',
'epochs': '50',
'mini_batch_size': '96',
'learning_rate': '1E-3',
'context_length': '12',
'dropout_rate': 0,
'prediction_length': '12'
})
estimator.fit(inputs=data_channels, wait=True, job_name='wfp-deepar-job-level-5')
我想用较小的学习率再次训练生成的模型。我按照这里描述的增量训练方法:https://docs.aws.amazon.com/en_pv/sagemaker/latest/dg/incremental-training.html,但它不起作用,显然(根据link),只有两个内置模型支持增量学习。
有没有人找到解决这个问题的方法,以便他们可以训练具有预定学习率的内置算法?
遗憾的是,SageMaker 内置的 DeepAR 模型不支持学习率调度和增量学习。如果你想在 DeepAR 架构上实施学习率平台计划,我建议考虑:
- 使用开源 DeepAR 实现 (code, demo)
- 或使用具有学习率调度能力的DeepAR+ algo of the Amazon Forecast service。