MLS-C01 Question 202
Select 2You are training a machine learning model in Amazon SageMaker, and you want to ensure the model starts training with pre-defined weights to improve performance. Which of the following approaches can you use to initialize the model with custom weights?
- A
Provide a pre-trained model artifact stored in an S3 bucket.
- B
Use the built-in SageMaker algorithm and set the 'initialWeights' hyperparameter.
- C
Load custom weights in the training script using a framework like TensorFlow or PyTorch.
- D
Enable automatic model initialization using the SageMaker AutoPilot feature.
Show answer and explanation
Correct answers: A, C
Explanation
To initialize a model with custom weights in Amazon SageMaker, you can either provide a pre-trained model artifact via an S3 bucket or use a custom training script with frameworks like TensorFlow or PyTorch to load the weights. SageMaker AutoPilot and built-in algorithms don't natively support direct weight initialization, making the first and third options correct.
- A. Correct.
Correct. SageMaker allows you to provide pre-trained model artifacts stored in an S3 bucket to initialize the model with custom weights.
- B. Incorrect.
Incorrect. SageMaker built-in algorithms do not have a generic 'initialWeights' hyperparameter. Custom weight initialization must be handled differently.
- C. Correct.
Correct. Using frameworks like TensorFlow or PyTorch, you can load custom weights in your training script to initialize the model.
- D. Incorrect.
Incorrect. SageMaker AutoPilot automatically builds and trains models but does not allow direct initialization of weights with custom values.