.SageMakerContainer | R Documentation |
This class is responsible for creating the directories and configuration files that the docker containers will use for either training or serving.
new()
Initialize a SageMakerContainer instance It uses a :class:'sagemaker.session.Session' for general interaction with user configuration such as getting the default sagemaker S3 bucket. However this class does not call any of the SageMaker APIs.
.SageMakerContainer$new( instance_type, instance_count, image, sagemaker_session = NULL, container_entrypoint = NULL, container_arguments = NULL )
instance_type
(str): The instance type to use. Either 'local' or 'local_gpu'
instance_count
(int): The number of instances to create.
image
(str): docker image to use.
sagemaker_session
(sagemaker.session.Session): a sagemaker session to use when interacting with SageMaker.
container_entrypoint
(str): the container entrypoint to execute
container_arguments
(str): the container entrypoint arguments
process()
Run a processing job locally using docker-compose.
.SageMakerContainer$process( processing_inputs, processing_output_config, environment, processing_job_name )
processing_inputs
(dict): The processing input specification.
processing_output_config
(dict): The processing output configuration specification.
environment
(dict): The environment collection for the processing job.
processing_job_name
(str): Name of the local processing job being run.
train()
Run a training job locally using docker-compose.
.SageMakerContainer$train( input_data_config, output_data_config, hyperparameters, job_name )
input_data_config
(dict): The Input Data Configuration, this contains data such as the channels to be used for training.
output_data_config
: The configuration of the output data.
hyperparameters
(dict): The HyperParameters for the training job.
job_name
(str): Name of the local training job being run.
(str): Location of the trained model.
serve()
Host a local endpoint using docker-compose.
.SageMakerContainer$serve(model_dir, environment)
model_dir
(str): pointing to a file or s3:// location.
environment
a dictionary of environment variables to be passed to the hosting container.
stop_serving()
Stop the serving container. The serving container runs in async mode to allow the SDK to do other tasks.
.SageMakerContainer$stop_serving()
retrieve_artifacts()
Get the model artifacts from all the container nodes. Used after training completes to gather the data from all the individual containers. As the official SageMaker Training Service, it will override duplicate files if multiple containers have the same file names.
.SageMakerContainer$retrieve_artifacts( compose_data, output_data_config, job_name )
compose_data
(list): Docker-Compose configuration in dictionary format.
output_data_config
: The configuration of the output data.
job_name
: The name of the job.
Local path to the collected model artifacts.
write_processing_config_files()
Write the config files for the processing containers. This method writes the hyperparameters, resources and input data configuration files.
.SageMakerContainer$write_processing_config_files( host, environment, processing_inputs, processing_output_config, processing_job_name )
host
(str): Host to write the configuration for
environment
(dict): Environment variable collection.
processing_inputs
(dict): Processing inputs.
processing_output_config
(dict): Processing output configuration.
processing_job_name
(str): Processing job name.
write_config_files()
Write the config files for the training containers. This method writes the hyperparameters, resources and input data configuration files.
.SageMakerContainer$write_config_files( host, hyperparameters, input_data_config )
host
(str): Host to write the configuration for
hyperparameters
(dict): Hyperparameters for training.
input_data_config
(dict): Training input channels to be used for training.
NULL
clone()
The objects of this class are cloneable with this method.
.SageMakerContainer$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.