noswear
noswear

Reputation: 321

Training multiple model in AWS Sagemaker

Can I train multiple model in AWS Sagemaker by evaluating the models is train.py script and also how to get back multiple metrics from multiple models?

Any links, docs or videos would be useful.

Upvotes: 0

Views: 1467

Answers (1)

Olivier Cruchant
Olivier Cruchant

Reputation: 4037

Yes, what you write in a sagemaker training script (assuming you use something that lets you pass custom code like your own container or a framework container) is flexible, and does not need to be just one model or even ML. You can definitely write multiple model trainings in a single container, and pull all related metrics using SageMaker metric capture via regex, see an example regex here with the Sklearn random forest. That being said, it is often a better idea to separate things and have one model per SageMaker job, because of the following reasons among other:

  1. It allows you to separate model metadata and metrics and compare them easily with the SageMaker metadata service
  2. It allows you to specialize hardware to each model and get better economics. Each model has its own sweet spot when it comes to CPU, GPU, RAM
  3. It allows you to use the exact same container for single training but also for bayesian hyperparameter search, an method that can be both faster and cheaper than regular gridsearch.

Upvotes: 1

Related Questions