Sagemaker 的持续培训

Continuous Training in Sagemaker

我正在尝试 Amazon Sagemaker,我还没有想出我们如何进行持续训练。
例如,如果我在 s3 中有一个 CSV 文件,并且我想在每次更新 CSV 文件时进行训练。

我知道我们可以再次访问笔记本并重新运行 整个笔记本来实现这一点。
但我正在寻找一种自动化的方式,使用一些 python 脚本或将 lambda 函数与 s3 事件等一起使用

您可以使用 python 的 boto3 sdk 开始在 lambda 上进行训练,然后您需要在更新 csv 时触发 lambda。

http://boto3.readthedocs.io/en/latest/reference/services/sagemaker.html

示例python代码

https://docs.aws.amazon.com/sagemaker/latest/dg/ex1-train-model-create-training-job.html

补充:您不需要使用 lambda,您只需 start/cronjob python 脚本任何类型的实例,其中包含 python 和 aws sdk。

aws-samples GitHub.

中有几个关于如何完成此操作的示例

serverless-sagemaker-orchestration example sounds most similar to the use case you are describing. This example walks you through how to continuously train a SageMaker linear regression model for housing price predictions on new CSV data that is added daily to a S3 bucket using the built-in LinearLearner algorithm, orchestrated with Amazon CloudWatch Events, AWS Step Functions, and AWS Lambda.

还有类似的 aws-sagemaker-build 示例,但如果您正在寻找详细说明,目前可能更难理解。

希望对您有所帮助!