SageMaker:PipelineModel 和超参数调整
我们想要使用 PipelineModel 调整 SageMaker ="https://sagemaker.readthedocs.io/en/stable/api/training/tuner.html?highlight=HyperparameterTuner" rel="nofollow noreferrer">HyperparameterTuner(或类似的东西),其中管道的多个组件具有关联的超参数。我们案例中的两个组件都是通过用于 ML 算法的 SageMaker 容器实现的。
model = PipelineModel(..., models = [ our_model, xgb_model ])
deploy = Estimator(image_uri = model, ...)
...
tuner = HyperparameterTuner(deply, .... tune_parameters, ....)
tuner.fit(...)
现在,当然存在如何在调优期间将tune_parameters
分配到管道步骤的问题。
在 scikit-learn 中,这是通过专门命名调整参数
来实现的。
不过,我没有找到一种方法可以通过 SageMaker 实现类似的目标。此外,搜索这两个关键字会带来相同的问题 这里但这并不是我们真正想要做的。
有什么建议如何实现这一目标吗?
We want to tune a SageMaker PipelineModel with a HyperparameterTuner (or something similar) where several components of the pipeline have associated hyperparameters. Both components in our case are realized via SageMaker containers for ML algorithms.
model = PipelineModel(..., models = [ our_model, xgb_model ])
deploy = Estimator(image_uri = model, ...)
...
tuner = HyperparameterTuner(deply, .... tune_parameters, ....)
tuner.fit(...)
Now, there is of course the problem how to distribute the tune_parameters
to the pipeline steps during the tuning.
In scikit-learn this is achieved by specially naming the tuning parameters <StepName>__<ParameterName>
.
I don't see a way to achieve something similar with SageMaker, though. Also, search of the two keywords brings up the same question here but is not really what we want to do.
Any suggestion how to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果需要联合优化两个模型,您可以在脚本模式下运行 SageMaker HPO 作业并在脚本中定义两个模型。或者,您可以运行两个 HPO 作业,优化每个模型,然后创建管道模型。对于在 PipelineModel 上执行 HPO 作业没有本机支持。
我在 AWS 工作,我的观点仅代表我自己。
If both the models need to be jointly optimized, you could run a SageMaker HPO job in script mode and define both the models in the script. Or you could run two HPO jobs, optimize each model, and then create the Pipeline Model. There is no native support for doing an HPO job on a PipelineModel.
I work at AWS and my opinions are my own.