Understanding how SageMaker invokes your code
When we worked with built-in algorithms and frameworks, we didn't pay much attention to how SageMaker actually invoked the training and deployment code. After all, that's what "built-in" means: grab what you need off the shelf and get to work.
Of course, things are different if we want to use our own custom code and containers. We need to understand how they interface with SageMaker so that we implement them exactly right.
In this section, we'll discuss this interface in detail. Let's start with the file layout.
Understanding the file layout inside a SageMaker container
To make our life simpler, SageMaker estimators automatically copy hyperparameters and input data inside training containers. Likewise, they automatically copy the trained model from the container to S3. At deployment time, they do the reverse operation, copying the model from S3 into the container.
As you can imagine, this requires...