repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/sagemaker-python-sdk | src/sagemaker/local/image.py | _SageMakerContainer.retrieve_artifacts | def retrieve_artifacts(self, compose_data, output_data_config, job_name):
"""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... | python | def retrieve_artifacts(self, compose_data, output_data_config, job_name):
"""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... | [
"def",
"retrieve_artifacts",
"(",
"self",
",",
"compose_data",
",",
"output_data_config",
",",
"job_name",
")",
":",
"# We need a directory to store the artfiacts from all the nodes",
"# and another one to contained the compressed final artifacts",
"artifacts",
"=",
"os",
".",
"p... | 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.
Args:
com... | [
"Get",
"the",
"model",
"artifacts",
"from",
"all",
"the",
"container",
"nodes",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L201-L256 | train | Get the model artifacts from all the containers and store them in the artifacts directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/image.py | _SageMakerContainer.write_config_files | def write_config_files(self, host, hyperparameters, input_data_config):
"""Write the config files for the training containers.
This method writes the hyperparameters, resources and input data configuration files.
Args:
host (str): Host to write the configuration for
hyp... | python | def write_config_files(self, host, hyperparameters, input_data_config):
"""Write the config files for the training containers.
This method writes the hyperparameters, resources and input data configuration files.
Args:
host (str): Host to write the configuration for
hyp... | [
"def",
"write_config_files",
"(",
"self",
",",
"host",
",",
"hyperparameters",
",",
"input_data_config",
")",
":",
"config_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"container_root",
",",
"host",
",",
"'input'",
",",
"'config'",
")",
"r... | Write the config files for the training containers.
This method writes the hyperparameters, resources and input data configuration files.
Args:
host (str): Host to write the configuration for
hyperparameters (dict): Hyperparameters for training.
input_data_config (d... | [
"Write",
"the",
"config",
"files",
"for",
"the",
"training",
"containers",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L258-L289 | train | This method writes the hyperparameters resources and input data configuration files for the training containers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/image.py | _SageMakerContainer._generate_compose_file | def _generate_compose_file(self, command, additional_volumes=None, additional_env_vars=None):
"""Writes a config file describing a training/hosting environment.
This method generates a docker compose configuration file, it has an entry for each container
that will be created (based on self.hos... | python | def _generate_compose_file(self, command, additional_volumes=None, additional_env_vars=None):
"""Writes a config file describing a training/hosting environment.
This method generates a docker compose configuration file, it has an entry for each container
that will be created (based on self.hos... | [
"def",
"_generate_compose_file",
"(",
"self",
",",
"command",
",",
"additional_volumes",
"=",
"None",
",",
"additional_env_vars",
"=",
"None",
")",
":",
"boto_session",
"=",
"self",
".",
"sagemaker_session",
".",
"boto_session",
"additional_volumes",
"=",
"additiona... | Writes a config file describing a training/hosting environment.
This method generates a docker compose configuration file, it has an entry for each container
that will be created (based on self.hosts). it calls
:meth:~sagemaker.local_session.SageMakerContainer._create_docker_host to generate t... | [
"Writes",
"a",
"config",
"file",
"describing",
"a",
"training",
"/",
"hosting",
"environment",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L360-L416 | train | This method generates a docker compose configuration file describing a training or hosting environment. It generates a config file describing a training or hosting environment. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/image.py | _SageMakerContainer._build_optml_volumes | def _build_optml_volumes(self, host, subdirs):
"""Generate a list of :class:`~sagemaker.local_session.Volume` required for the container to start.
It takes a folder with the necessary files for training and creates a list of opt volumes that
the Container needs to start.
Args:
... | python | def _build_optml_volumes(self, host, subdirs):
"""Generate a list of :class:`~sagemaker.local_session.Volume` required for the container to start.
It takes a folder with the necessary files for training and creates a list of opt volumes that
the Container needs to start.
Args:
... | [
"def",
"_build_optml_volumes",
"(",
"self",
",",
"host",
",",
"subdirs",
")",
":",
"volumes",
"=",
"[",
"]",
"for",
"subdir",
"in",
"subdirs",
":",
"host_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"container_root",
",",
"host",
",",
... | Generate a list of :class:`~sagemaker.local_session.Volume` required for the container to start.
It takes a folder with the necessary files for training and creates a list of opt volumes that
the Container needs to start.
Args:
host (str): container for which the volumes will be ge... | [
"Generate",
"a",
"list",
"of",
":",
"class",
":",
"~sagemaker",
".",
"local_session",
".",
"Volume",
"required",
"for",
"the",
"container",
"to",
"start",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/image.py#L486-L506 | train | Build a list of volumes that need to be training for the container. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | examples/cli/host/script.py | model_fn | def model_fn(model_dir):
"""
Load the gluon model. Called once when hosting service starts.
:param: model_dir The directory where model files are stored.
:return: a model (in this case a Gluon network)
"""
symbol = mx.sym.load('%s/model.json' % model_dir)
outputs = mx.symbol.softmax(data=sy... | python | def model_fn(model_dir):
"""
Load the gluon model. Called once when hosting service starts.
:param: model_dir The directory where model files are stored.
:return: a model (in this case a Gluon network)
"""
symbol = mx.sym.load('%s/model.json' % model_dir)
outputs = mx.symbol.softmax(data=sy... | [
"def",
"model_fn",
"(",
"model_dir",
")",
":",
"symbol",
"=",
"mx",
".",
"sym",
".",
"load",
"(",
"'%s/model.json'",
"%",
"model_dir",
")",
"outputs",
"=",
"mx",
".",
"symbol",
".",
"softmax",
"(",
"data",
"=",
"symbol",
",",
"name",
"=",
"'softmax_lab... | Load the gluon model. Called once when hosting service starts.
:param: model_dir The directory where model files are stored.
:return: a model (in this case a Gluon network) | [
"Load",
"the",
"gluon",
"model",
".",
"Called",
"once",
"when",
"hosting",
"service",
"starts",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/examples/cli/host/script.py#L8-L21 | train | Loads the gluon model. Called once when hosting service starts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | examples/cli/host/script.py | transform_fn | def transform_fn(net, data, input_content_type, output_content_type):
"""
Transform a request using the Gluon model. Called once per request.
:param net: The Gluon model.
:param data: The request payload.
:param input_content_type: The request content type.
:param output_content_type: The (desi... | python | def transform_fn(net, data, input_content_type, output_content_type):
"""
Transform a request using the Gluon model. Called once per request.
:param net: The Gluon model.
:param data: The request payload.
:param input_content_type: The request content type.
:param output_content_type: The (desi... | [
"def",
"transform_fn",
"(",
"net",
",",
"data",
",",
"input_content_type",
",",
"output_content_type",
")",
":",
"# we can use content types to vary input/output handling, but",
"# here we just assume json for both",
"parsed",
"=",
"json",
".",
"loads",
"(",
"data",
")",
... | Transform a request using the Gluon model. Called once per request.
:param net: The Gluon model.
:param data: The request payload.
:param input_content_type: The request content type.
:param output_content_type: The (desired) response content type.
:return: response payload and content type. | [
"Transform",
"a",
"request",
"using",
"the",
"Gluon",
"model",
".",
"Called",
"once",
"per",
"request",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/examples/cli/host/script.py#L24-L41 | train | Transform a request using the Gluon model. Called once per request. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/pca.py | PCA._prepare_for_training | def _prepare_for_training(self, records, mini_batch_size=None, job_name=None):
"""Set hyperparameters needed for training.
Args:
* records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
* mini_batch_size (int or None): The size of each mini-batch to use when ... | python | def _prepare_for_training(self, records, mini_batch_size=None, job_name=None):
"""Set hyperparameters needed for training.
Args:
* records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
* mini_batch_size (int or None): The size of each mini-batch to use when ... | [
"def",
"_prepare_for_training",
"(",
"self",
",",
"records",
",",
"mini_batch_size",
"=",
"None",
",",
"job_name",
"=",
"None",
")",
":",
"num_records",
"=",
"None",
"if",
"isinstance",
"(",
"records",
",",
"list",
")",
":",
"for",
"record",
"in",
"records... | Set hyperparameters needed for training.
Args:
* records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
* mini_batch_size (int or None): The size of each mini-batch to use when training. If ``None``, a
default value will be used.
* job_nam... | [
"Set",
"hyperparameters",
"needed",
"for",
"training",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/pca.py#L103-L129 | train | Set hyperparameters needed for training. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | create_image_uri | def create_image_uri(region, framework, instance_type, framework_version, py_version=None,
account='520713654638', accelerator_type=None, optimized_families=None):
"""Return the ECR URI of an image.
Args:
region (str): AWS region where the image is uploaded.
framework (str)... | python | def create_image_uri(region, framework, instance_type, framework_version, py_version=None,
account='520713654638', accelerator_type=None, optimized_families=None):
"""Return the ECR URI of an image.
Args:
region (str): AWS region where the image is uploaded.
framework (str)... | [
"def",
"create_image_uri",
"(",
"region",
",",
"framework",
",",
"instance_type",
",",
"framework_version",
",",
"py_version",
"=",
"None",
",",
"account",
"=",
"'520713654638'",
",",
"accelerator_type",
"=",
"None",
",",
"optimized_families",
"=",
"None",
")",
... | Return the ECR URI of an image.
Args:
region (str): AWS region where the image is uploaded.
framework (str): framework used by the image.
instance_type (str): SageMaker instance type. Used to determine device type (cpu/gpu/family-specific optimized).
framework_version (str): The ver... | [
"Return",
"the",
"ECR",
"URI",
"of",
"an",
"image",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L49-L103 | train | Create an image URI based on the given parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | validate_source_dir | def validate_source_dir(script, directory):
"""Validate that the source directory exists and it contains the user script
Args:
script (str): Script filename.
directory (str): Directory containing the source file.
Raises:
ValueError: If ``directory`` does not exist, is not a direct... | python | def validate_source_dir(script, directory):
"""Validate that the source directory exists and it contains the user script
Args:
script (str): Script filename.
directory (str): Directory containing the source file.
Raises:
ValueError: If ``directory`` does not exist, is not a direct... | [
"def",
"validate_source_dir",
"(",
"script",
",",
"directory",
")",
":",
"if",
"directory",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"os",
".",
"path",
".",
"join",
"(",
"directory",
",",
"script",
")",
")",
":",
"raise",
"ValueError",
... | Validate that the source directory exists and it contains the user script
Args:
script (str): Script filename.
directory (str): Directory containing the source file.
Raises:
ValueError: If ``directory`` does not exist, is not a directory, or does not contain ``script``. | [
"Validate",
"that",
"the",
"source",
"directory",
"exists",
"and",
"it",
"contains",
"the",
"user",
"script"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L125-L139 | train | Validate that the source directory exists and contains the user script. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | tar_and_upload_dir | def tar_and_upload_dir(session, bucket, s3_key_prefix, script,
directory=None, dependencies=None, kms_key=None):
"""Package source files and upload a compress tar file to S3. The S3 location will be
``s3://<bucket>/s3_key_prefix/sourcedir.tar.gz``.
If directory is an S3 URI, an Uploa... | python | def tar_and_upload_dir(session, bucket, s3_key_prefix, script,
directory=None, dependencies=None, kms_key=None):
"""Package source files and upload a compress tar file to S3. The S3 location will be
``s3://<bucket>/s3_key_prefix/sourcedir.tar.gz``.
If directory is an S3 URI, an Uploa... | [
"def",
"tar_and_upload_dir",
"(",
"session",
",",
"bucket",
",",
"s3_key_prefix",
",",
"script",
",",
"directory",
"=",
"None",
",",
"dependencies",
"=",
"None",
",",
"kms_key",
"=",
"None",
")",
":",
"if",
"directory",
"and",
"directory",
".",
"lower",
"(... | Package source files and upload a compress tar file to S3. The S3 location will be
``s3://<bucket>/s3_key_prefix/sourcedir.tar.gz``.
If directory is an S3 URI, an UploadedCode object will be returned, but nothing will be
uploaded to S3 (this allow reuse of code already in S3).
If directory is None, th... | [
"Package",
"source",
"files",
"and",
"upload",
"a",
"compress",
"tar",
"file",
"to",
"S3",
".",
"The",
"S3",
"location",
"will",
"be",
"s3",
":",
"//",
"<bucket",
">",
"/",
"s3_key_prefix",
"/",
"sourcedir",
".",
"tar",
".",
"gz",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L142-L194 | train | Package source files and upload a tar file to S3. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | framework_name_from_image | def framework_name_from_image(image_name):
"""Extract the framework and Python version from the image name.
Args:
image_name (str): Image URI, which should be one of the following forms:
legacy:
'<account>.dkr.ecr.<region>.amazonaws.com/sagemaker-<fw>-<py_ver>-<device>:<containe... | python | def framework_name_from_image(image_name):
"""Extract the framework and Python version from the image name.
Args:
image_name (str): Image URI, which should be one of the following forms:
legacy:
'<account>.dkr.ecr.<region>.amazonaws.com/sagemaker-<fw>-<py_ver>-<device>:<containe... | [
"def",
"framework_name_from_image",
"(",
"image_name",
")",
":",
"sagemaker_pattern",
"=",
"re",
".",
"compile",
"(",
"ECR_URI_PATTERN",
")",
"sagemaker_match",
"=",
"sagemaker_pattern",
".",
"match",
"(",
"image_name",
")",
"if",
"sagemaker_match",
"is",
"None",
... | Extract the framework and Python version from the image name.
Args:
image_name (str): Image URI, which should be one of the following forms:
legacy:
'<account>.dkr.ecr.<region>.amazonaws.com/sagemaker-<fw>-<py_ver>-<device>:<container_version>'
legacy:
'<acco... | [
"Extract",
"the",
"framework",
"and",
"Python",
"version",
"from",
"the",
"image",
"name",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L205-L248 | train | Extract the framework and Python version from the image name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | framework_version_from_tag | def framework_version_from_tag(image_tag):
"""Extract the framework version from the image tag.
Args:
image_tag (str): Image tag, which should take the form '<framework_version>-<device>-<py_version>'
Returns:
str: The framework version.
"""
tag_pattern = re.compile('^(.*)-(cpu|gpu... | python | def framework_version_from_tag(image_tag):
"""Extract the framework version from the image tag.
Args:
image_tag (str): Image tag, which should take the form '<framework_version>-<device>-<py_version>'
Returns:
str: The framework version.
"""
tag_pattern = re.compile('^(.*)-(cpu|gpu... | [
"def",
"framework_version_from_tag",
"(",
"image_tag",
")",
":",
"tag_pattern",
"=",
"re",
".",
"compile",
"(",
"'^(.*)-(cpu|gpu)-(py2|py3)$'",
")",
"tag_match",
"=",
"tag_pattern",
".",
"match",
"(",
"image_tag",
")",
"return",
"None",
"if",
"tag_match",
"is",
... | Extract the framework version from the image tag.
Args:
image_tag (str): Image tag, which should take the form '<framework_version>-<device>-<py_version>'
Returns:
str: The framework version. | [
"Extract",
"the",
"framework",
"version",
"from",
"the",
"image",
"tag",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L251-L262 | train | Extract the framework version from the image tag. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | parse_s3_url | def parse_s3_url(url):
"""Returns an (s3 bucket, key name/prefix) tuple from a url with an s3 scheme
Args:
url (str):
Returns:
tuple: A tuple containing:
str: S3 bucket name
str: S3 key
"""
parsed_url = urlparse(url)
if parsed_url.scheme != "s3":
... | python | def parse_s3_url(url):
"""Returns an (s3 bucket, key name/prefix) tuple from a url with an s3 scheme
Args:
url (str):
Returns:
tuple: A tuple containing:
str: S3 bucket name
str: S3 key
"""
parsed_url = urlparse(url)
if parsed_url.scheme != "s3":
... | [
"def",
"parse_s3_url",
"(",
"url",
")",
":",
"parsed_url",
"=",
"urlparse",
"(",
"url",
")",
"if",
"parsed_url",
".",
"scheme",
"!=",
"\"s3\"",
":",
"raise",
"ValueError",
"(",
"\"Expecting 's3' scheme, got: {} in {}\"",
".",
"format",
"(",
"parsed_url",
".",
... | Returns an (s3 bucket, key name/prefix) tuple from a url with an s3 scheme
Args:
url (str):
Returns:
tuple: A tuple containing:
str: S3 bucket name
str: S3 key | [
"Returns",
"an",
"(",
"s3",
"bucket",
"key",
"name",
"/",
"prefix",
")",
"tuple",
"from",
"a",
"url",
"with",
"an",
"s3",
"scheme"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L265-L279 | train | Parse an s3 url and return a tuple containing the bucket name and prefix | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/fw_utils.py | model_code_key_prefix | def model_code_key_prefix(code_location_key_prefix, model_name, image):
"""Returns the s3 key prefix for uploading code during model deployment
The location returned is a potential concatenation of 2 parts
1. code_location_key_prefix if it exists
2. model_name or a name derived from the image
... | python | def model_code_key_prefix(code_location_key_prefix, model_name, image):
"""Returns the s3 key prefix for uploading code during model deployment
The location returned is a potential concatenation of 2 parts
1. code_location_key_prefix if it exists
2. model_name or a name derived from the image
... | [
"def",
"model_code_key_prefix",
"(",
"code_location_key_prefix",
",",
"model_name",
",",
"image",
")",
":",
"training_job_name",
"=",
"sagemaker",
".",
"utils",
".",
"name_from_image",
"(",
"image",
")",
"return",
"'/'",
".",
"join",
"(",
"filter",
"(",
"None",
... | Returns the s3 key prefix for uploading code during model deployment
The location returned is a potential concatenation of 2 parts
1. code_location_key_prefix if it exists
2. model_name or a name derived from the image
Args:
code_location_key_prefix (str): the s3 key prefix from code_l... | [
"Returns",
"the",
"s3",
"key",
"prefix",
"for",
"uploading",
"code",
"during",
"model",
"deployment"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_utils.py#L282-L298 | train | Returns the s3 key prefix for uploading code during model deployment | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/local_session.py | LocalSagemakerClient.create_training_job | def create_training_job(self, TrainingJobName, AlgorithmSpecification, OutputDataConfig,
ResourceConfig, InputDataConfig=None, **kwargs):
"""
Create a training job in Local Mode
Args:
TrainingJobName (str): local training job name.
AlgorithmSpe... | python | def create_training_job(self, TrainingJobName, AlgorithmSpecification, OutputDataConfig,
ResourceConfig, InputDataConfig=None, **kwargs):
"""
Create a training job in Local Mode
Args:
TrainingJobName (str): local training job name.
AlgorithmSpe... | [
"def",
"create_training_job",
"(",
"self",
",",
"TrainingJobName",
",",
"AlgorithmSpecification",
",",
"OutputDataConfig",
",",
"ResourceConfig",
",",
"InputDataConfig",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"InputDataConfig",
"=",
"InputDataConfig",
"or",... | Create a training job in Local Mode
Args:
TrainingJobName (str): local training job name.
AlgorithmSpecification (dict): Identifies the training algorithm to use.
InputDataConfig (dict): Describes the training dataset and the location where it is stored.
OutputDat... | [
"Create",
"a",
"training",
"job",
"in",
"Local",
"Mode",
"Args",
":",
"TrainingJobName",
"(",
"str",
")",
":",
"local",
"training",
"job",
"name",
".",
"AlgorithmSpecification",
"(",
"dict",
")",
":",
"Identifies",
"the",
"training",
"algorithm",
"to",
"use"... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/local_session.py#L55-L75 | train | Creates a training job in Local Mode. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/local_session.py | LocalSagemakerClient.describe_training_job | def describe_training_job(self, TrainingJobName):
"""Describe a local training job.
Args:
TrainingJobName (str): Training job name to describe.
Returns: (dict) DescribeTrainingJob Response.
"""
if TrainingJobName not in LocalSagemakerClient._training_jobs:
... | python | def describe_training_job(self, TrainingJobName):
"""Describe a local training job.
Args:
TrainingJobName (str): Training job name to describe.
Returns: (dict) DescribeTrainingJob Response.
"""
if TrainingJobName not in LocalSagemakerClient._training_jobs:
... | [
"def",
"describe_training_job",
"(",
"self",
",",
"TrainingJobName",
")",
":",
"if",
"TrainingJobName",
"not",
"in",
"LocalSagemakerClient",
".",
"_training_jobs",
":",
"error_response",
"=",
"{",
"'Error'",
":",
"{",
"'Code'",
":",
"'ValidationException'",
",",
"... | Describe a local training job.
Args:
TrainingJobName (str): Training job name to describe.
Returns: (dict) DescribeTrainingJob Response. | [
"Describe",
"a",
"local",
"training",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/local_session.py#L77-L90 | train | Describe a local training job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/local_session.py | LocalSagemakerClient.create_model | def create_model(self, ModelName, PrimaryContainer, *args, **kwargs): # pylint: disable=unused-argument
"""Create a Local Model Object
Args:
ModelName (str): the Model Name
PrimaryContainer (dict): a SageMaker primary container definition
"""
LocalSagemakerClien... | python | def create_model(self, ModelName, PrimaryContainer, *args, **kwargs): # pylint: disable=unused-argument
"""Create a Local Model Object
Args:
ModelName (str): the Model Name
PrimaryContainer (dict): a SageMaker primary container definition
"""
LocalSagemakerClien... | [
"def",
"create_model",
"(",
"self",
",",
"ModelName",
",",
"PrimaryContainer",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"LocalSagemakerClient",
".",
"_models",
"[",
"ModelName",
"]",
"=",
"_LocalModel",
"(",
"Mode... | Create a Local Model Object
Args:
ModelName (str): the Model Name
PrimaryContainer (dict): a SageMaker primary container definition | [
"Create",
"a",
"Local",
"Model",
"Object"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/local_session.py#L105-L112 | train | Create a Local Model Object
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/local_session.py | LocalSession._initialize | def _initialize(self, boto_session, sagemaker_client, sagemaker_runtime_client):
"""Initialize this Local SageMaker Session."""
self.boto_session = boto_session or boto3.Session()
self._region_name = self.boto_session.region_name
if self._region_name is None:
raise ValueErr... | python | def _initialize(self, boto_session, sagemaker_client, sagemaker_runtime_client):
"""Initialize this Local SageMaker Session."""
self.boto_session = boto_session or boto3.Session()
self._region_name = self.boto_session.region_name
if self._region_name is None:
raise ValueErr... | [
"def",
"_initialize",
"(",
"self",
",",
"boto_session",
",",
"sagemaker_client",
",",
"sagemaker_runtime_client",
")",
":",
"self",
".",
"boto_session",
"=",
"boto_session",
"or",
"boto3",
".",
"Session",
"(",
")",
"self",
".",
"_region_name",
"=",
"self",
"."... | Initialize this Local SageMaker Session. | [
"Initialize",
"this",
"Local",
"SageMaker",
"Session",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/local_session.py#L205-L216 | train | Initialize this Local SageMaker Session. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/sklearn/model.py | SKLearnModel.prepare_container_def | def prepare_container_def(self, instance_type, accelerator_type=None):
"""Return a container definition with framework configuration set in model environment variables.
Args:
instance_type (str): The EC2 instance type to deploy this Model to. For example, 'ml.p2.xlarge'.
acceler... | python | def prepare_container_def(self, instance_type, accelerator_type=None):
"""Return a container definition with framework configuration set in model environment variables.
Args:
instance_type (str): The EC2 instance type to deploy this Model to. For example, 'ml.p2.xlarge'.
acceler... | [
"def",
"prepare_container_def",
"(",
"self",
",",
"instance_type",
",",
"accelerator_type",
"=",
"None",
")",
":",
"if",
"accelerator_type",
":",
"raise",
"ValueError",
"(",
"\"Accelerator types are not supported for Scikit-Learn.\"",
")",
"deploy_image",
"=",
"self",
"... | Return a container definition with framework configuration set in model environment variables.
Args:
instance_type (str): The EC2 instance type to deploy this Model to. For example, 'ml.p2.xlarge'.
accelerator_type (str): The Elastic Inference accelerator type to deploy to the instance ... | [
"Return",
"a",
"container",
"definition",
"with",
"framework",
"configuration",
"set",
"in",
"model",
"environment",
"variables",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/sklearn/model.py#L75-L105 | train | Prepare a container definition for the model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | upload_numpy_to_s3_shards | def upload_numpy_to_s3_shards(num_shards, s3, bucket, key_prefix, array, labels=None):
"""Upload the training ``array`` and ``labels`` arrays to ``num_shards`` s3 objects,
stored in "s3://``bucket``/``key_prefix``/"."""
shards = _build_shards(num_shards, array)
if labels is not None:
label_shard... | python | def upload_numpy_to_s3_shards(num_shards, s3, bucket, key_prefix, array, labels=None):
"""Upload the training ``array`` and ``labels`` arrays to ``num_shards`` s3 objects,
stored in "s3://``bucket``/``key_prefix``/"."""
shards = _build_shards(num_shards, array)
if labels is not None:
label_shard... | [
"def",
"upload_numpy_to_s3_shards",
"(",
"num_shards",
",",
"s3",
",",
"bucket",
",",
"key_prefix",
",",
"array",
",",
"labels",
"=",
"None",
")",
":",
"shards",
"=",
"_build_shards",
"(",
"num_shards",
",",
"array",
")",
"if",
"labels",
"is",
"not",
"None... | Upload the training ``array`` and ``labels`` arrays to ``num_shards`` s3 objects,
stored in "s3://``bucket``/``key_prefix``/". | [
"Upload",
"the",
"training",
"array",
"and",
"labels",
"arrays",
"to",
"num_shards",
"s3",
"objects",
"stored",
"in",
"s3",
":",
"//",
"bucket",
"/",
"key_prefix",
"/",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L242-L275 | train | Upload the training array and labels arrays to num_shards s3 objects stored in s3://bucket / key_prefix /. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | registry | def registry(region_name, algorithm=None):
"""Return docker registry for the given AWS region
Note: Not all the algorithms listed below have an Amazon Estimator implemented. For full list of
pre-implemented Estimators, look at:
https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/amaz... | python | def registry(region_name, algorithm=None):
"""Return docker registry for the given AWS region
Note: Not all the algorithms listed below have an Amazon Estimator implemented. For full list of
pre-implemented Estimators, look at:
https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/amaz... | [
"def",
"registry",
"(",
"region_name",
",",
"algorithm",
"=",
"None",
")",
":",
"if",
"algorithm",
"in",
"[",
"None",
",",
"'pca'",
",",
"'kmeans'",
",",
"'linear-learner'",
",",
"'factorization-machines'",
",",
"'ntm'",
",",
"'randomcutforest'",
",",
"'knn'",... | Return docker registry for the given AWS region
Note: Not all the algorithms listed below have an Amazon Estimator implemented. For full list of
pre-implemented Estimators, look at:
https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/amazon | [
"Return",
"docker",
"registry",
"for",
"the",
"given",
"AWS",
"region"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L278-L370 | train | Return the docker registry for the given AWS region. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | get_image_uri | def get_image_uri(region_name, repo_name, repo_version=1):
"""Return algorithm image URI for the given AWS region, repository name, and repository version"""
repo = '{}:{}'.format(repo_name, repo_version)
return '{}/{}'.format(registry(region_name, repo_name), repo) | python | def get_image_uri(region_name, repo_name, repo_version=1):
"""Return algorithm image URI for the given AWS region, repository name, and repository version"""
repo = '{}:{}'.format(repo_name, repo_version)
return '{}/{}'.format(registry(region_name, repo_name), repo) | [
"def",
"get_image_uri",
"(",
"region_name",
",",
"repo_name",
",",
"repo_version",
"=",
"1",
")",
":",
"repo",
"=",
"'{}:{}'",
".",
"format",
"(",
"repo_name",
",",
"repo_version",
")",
"return",
"'{}/{}'",
".",
"format",
"(",
"registry",
"(",
"region_name",... | Return algorithm image URI for the given AWS region, repository name, and repository version | [
"Return",
"algorithm",
"image",
"URI",
"for",
"the",
"given",
"AWS",
"region",
"repository",
"name",
"and",
"repository",
"version"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L373-L376 | train | Return algorithm image URI for the given AWS region repository name and repository version | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | AmazonAlgorithmEstimatorBase._prepare_init_params_from_job_description | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_n... | python | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_n... | [
"def",
"_prepare_init_params_from_job_description",
"(",
"cls",
",",
"job_details",
",",
"model_channel_name",
"=",
"None",
")",
":",
"init_params",
"=",
"super",
"(",
"AmazonAlgorithmEstimatorBase",
",",
"cls",
")",
".",
"_prepare_init_params_from_job_description",
"(",
... | Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_name (str): Name of the channel where pre-trained model data will be downloaded.
Returns:
... | [
"Convert",
"the",
"job",
"description",
"to",
"init",
"params",
"that",
"can",
"be",
"handled",
"by",
"the",
"class",
"constructor"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L77-L101 | train | Convert the job description to init params that can be handled by the class constructor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | AmazonAlgorithmEstimatorBase._prepare_for_training | def _prepare_for_training(self, records, mini_batch_size=None, job_name=None):
"""Set hyperparameters needed for training.
Args:
* records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
* mini_batch_size (int or None): The size of each mini-batch to use when ... | python | def _prepare_for_training(self, records, mini_batch_size=None, job_name=None):
"""Set hyperparameters needed for training.
Args:
* records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
* mini_batch_size (int or None): The size of each mini-batch to use when ... | [
"def",
"_prepare_for_training",
"(",
"self",
",",
"records",
",",
"mini_batch_size",
"=",
"None",
",",
"job_name",
"=",
"None",
")",
":",
"super",
"(",
"AmazonAlgorithmEstimatorBase",
",",
"self",
")",
".",
"_prepare_for_training",
"(",
"job_name",
"=",
"job_nam... | Set hyperparameters needed for training.
Args:
* records (:class:`~RecordSet`): The records to train this ``Estimator`` on.
* mini_batch_size (int or None): The size of each mini-batch to use when training. If ``None``, a
default value will be used.
* job_nam... | [
"Set",
"hyperparameters",
"needed",
"for",
"training",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L103-L128 | train | Set hyperparameters needed for training. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | AmazonAlgorithmEstimatorBase.fit | def fit(self, records, mini_batch_size=None, wait=True, logs=True, job_name=None):
"""Fit this Estimator on serialized Record objects, stored in S3.
``records`` should be an instance of :class:`~RecordSet`. This defines a collection of
S3 data files to train this ``Estimator`` on.
Trai... | python | def fit(self, records, mini_batch_size=None, wait=True, logs=True, job_name=None):
"""Fit this Estimator on serialized Record objects, stored in S3.
``records`` should be an instance of :class:`~RecordSet`. This defines a collection of
S3 data files to train this ``Estimator`` on.
Trai... | [
"def",
"fit",
"(",
"self",
",",
"records",
",",
"mini_batch_size",
"=",
"None",
",",
"wait",
"=",
"True",
",",
"logs",
"=",
"True",
",",
"job_name",
"=",
"None",
")",
":",
"self",
".",
"_prepare_for_training",
"(",
"records",
",",
"job_name",
"=",
"job... | Fit this Estimator on serialized Record objects, stored in S3.
``records`` should be an instance of :class:`~RecordSet`. This defines a collection of
S3 data files to train this ``Estimator`` on.
Training data is expected to be encoded as dense or sparse vectors in the "values" feature
... | [
"Fit",
"this",
"Estimator",
"on",
"serialized",
"Record",
"objects",
"stored",
"in",
"S3",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L130-L160 | train | Fit this Estimator on serialized Record objects stored in S3 and store them in S3. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/amazon_estimator.py | AmazonAlgorithmEstimatorBase.record_set | def record_set(self, train, labels=None, channel="train"):
"""Build a :class:`~RecordSet` from a numpy :class:`~ndarray` matrix and label vector.
For the 2D ``ndarray`` ``train``, each row is converted to a :class:`~Record` object.
The vector is stored in the "values" entry of the ``features`` ... | python | def record_set(self, train, labels=None, channel="train"):
"""Build a :class:`~RecordSet` from a numpy :class:`~ndarray` matrix and label vector.
For the 2D ``ndarray`` ``train``, each row is converted to a :class:`~Record` object.
The vector is stored in the "values" entry of the ``features`` ... | [
"def",
"record_set",
"(",
"self",
",",
"train",
",",
"labels",
"=",
"None",
",",
"channel",
"=",
"\"train\"",
")",
":",
"s3",
"=",
"self",
".",
"sagemaker_session",
".",
"boto_session",
".",
"resource",
"(",
"'s3'",
")",
"parsed_s3_url",
"=",
"urlparse",
... | Build a :class:`~RecordSet` from a numpy :class:`~ndarray` matrix and label vector.
For the 2D ``ndarray`` ``train``, each row is converted to a :class:`~Record` object.
The vector is stored in the "values" entry of the ``features`` property of each Record.
If ``labels`` is not None, each corre... | [
"Build",
"a",
":",
"class",
":",
"~RecordSet",
"from",
"a",
"numpy",
":",
"class",
":",
"~ndarray",
"matrix",
"and",
"label",
"vector",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/amazon_estimator.py#L162-L193 | train | Build a RecordSet from a 2D numpy matrix and label vector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | get_data_source_instance | def get_data_source_instance(data_source, sagemaker_session):
"""Return an Instance of :class:`sagemaker.local.data.DataSource` that can handle
the provided data_source URI.
data_source can be either file:// or s3://
Args:
data_source (str): a valid URI that points to a data source.
sa... | python | def get_data_source_instance(data_source, sagemaker_session):
"""Return an Instance of :class:`sagemaker.local.data.DataSource` that can handle
the provided data_source URI.
data_source can be either file:// or s3://
Args:
data_source (str): a valid URI that points to a data source.
sa... | [
"def",
"get_data_source_instance",
"(",
"data_source",
",",
"sagemaker_session",
")",
":",
"parsed_uri",
"=",
"urlparse",
"(",
"data_source",
")",
"if",
"parsed_uri",
".",
"scheme",
"==",
"'file'",
":",
"return",
"LocalFileDataSource",
"(",
"parsed_uri",
".",
"net... | Return an Instance of :class:`sagemaker.local.data.DataSource` that can handle
the provided data_source URI.
data_source can be either file:// or s3://
Args:
data_source (str): a valid URI that points to a data source.
sagemaker_session (:class:`sagemaker.session.Session`): a SageMaker Ses... | [
"Return",
"an",
"Instance",
"of",
":",
"class",
":",
"sagemaker",
".",
"local",
".",
"data",
".",
"DataSource",
"that",
"can",
"handle",
"the",
"provided",
"data_source",
"URI",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L30-L49 | train | Return an instance of a Data Source that can handle the provided data_source URI. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | get_splitter_instance | def get_splitter_instance(split_type):
"""Return an Instance of :class:`sagemaker.local.data.Splitter` according to
the specified `split_type`.
Args:
split_type (str): either 'Line' or 'RecordIO'. Can be left as None to signal no data split
will happen.
Returns
:class:`sage... | python | def get_splitter_instance(split_type):
"""Return an Instance of :class:`sagemaker.local.data.Splitter` according to
the specified `split_type`.
Args:
split_type (str): either 'Line' or 'RecordIO'. Can be left as None to signal no data split
will happen.
Returns
:class:`sage... | [
"def",
"get_splitter_instance",
"(",
"split_type",
")",
":",
"if",
"split_type",
"is",
"None",
":",
"return",
"NoneSplitter",
"(",
")",
"elif",
"split_type",
"==",
"'Line'",
":",
"return",
"LineSplitter",
"(",
")",
"elif",
"split_type",
"==",
"'RecordIO'",
":"... | Return an Instance of :class:`sagemaker.local.data.Splitter` according to
the specified `split_type`.
Args:
split_type (str): either 'Line' or 'RecordIO'. Can be left as None to signal no data split
will happen.
Returns
:class:`sagemaker.local.data.Splitter`: an Instance of a S... | [
"Return",
"an",
"Instance",
"of",
":",
"class",
":",
"sagemaker",
".",
"local",
".",
"data",
".",
"Splitter",
"according",
"to",
"the",
"specified",
"split_type",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L52-L70 | train | Returns an Instance of a Splitter according to
the specified split_type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | get_batch_strategy_instance | def get_batch_strategy_instance(strategy, splitter):
"""Return an Instance of :class:`sagemaker.local.data.BatchStrategy` according to `strategy`
Args:
strategy (str): Either 'SingleRecord' or 'MultiRecord'
splitter (:class:`sagemaker.local.data.Splitter): splitter to get the data from.
Re... | python | def get_batch_strategy_instance(strategy, splitter):
"""Return an Instance of :class:`sagemaker.local.data.BatchStrategy` according to `strategy`
Args:
strategy (str): Either 'SingleRecord' or 'MultiRecord'
splitter (:class:`sagemaker.local.data.Splitter): splitter to get the data from.
Re... | [
"def",
"get_batch_strategy_instance",
"(",
"strategy",
",",
"splitter",
")",
":",
"if",
"strategy",
"==",
"'SingleRecord'",
":",
"return",
"SingleRecordStrategy",
"(",
"splitter",
")",
"elif",
"strategy",
"==",
"'MultiRecord'",
":",
"return",
"MultiRecordStrategy",
... | Return an Instance of :class:`sagemaker.local.data.BatchStrategy` according to `strategy`
Args:
strategy (str): Either 'SingleRecord' or 'MultiRecord'
splitter (:class:`sagemaker.local.data.Splitter): splitter to get the data from.
Returns
:class:`sagemaker.local.data.BatchStrategy`: a... | [
"Return",
"an",
"Instance",
"of",
":",
"class",
":",
"sagemaker",
".",
"local",
".",
"data",
".",
"BatchStrategy",
"according",
"to",
"strategy"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L73-L88 | train | Returns an Instance of a BatchStrategy according to strategy | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | LocalFileDataSource.get_file_list | def get_file_list(self):
"""Retrieve the list of absolute paths to all the files in this data source.
Returns:
List[str] List of absolute paths.
"""
if os.path.isdir(self.root_path):
return [os.path.join(self.root_path, f) for f in os.listdir(self.root_path)
... | python | def get_file_list(self):
"""Retrieve the list of absolute paths to all the files in this data source.
Returns:
List[str] List of absolute paths.
"""
if os.path.isdir(self.root_path):
return [os.path.join(self.root_path, f) for f in os.listdir(self.root_path)
... | [
"def",
"get_file_list",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"root_path",
")",
":",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"root_path",
",",
"f",
")",
"for",
"f",
"in",
"os",
... | Retrieve the list of absolute paths to all the files in this data source.
Returns:
List[str] List of absolute paths. | [
"Retrieve",
"the",
"list",
"of",
"absolute",
"paths",
"to",
"all",
"the",
"files",
"in",
"this",
"data",
"source",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L119-L129 | train | Retrieve the list of absolute paths to all the files in this data source. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | LocalFileDataSource.get_root_dir | def get_root_dir(self):
"""Retrieve the absolute path to the root directory of this data source.
Returns:
str: absolute path to the root directory of this data source.
"""
if os.path.isdir(self.root_path):
return self.root_path
else:
return os... | python | def get_root_dir(self):
"""Retrieve the absolute path to the root directory of this data source.
Returns:
str: absolute path to the root directory of this data source.
"""
if os.path.isdir(self.root_path):
return self.root_path
else:
return os... | [
"def",
"get_root_dir",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"root_path",
")",
":",
"return",
"self",
".",
"root_path",
"else",
":",
"return",
"os",
".",
"path",
".",
"dirname",
"(",
"self",
".",
"root_path",... | Retrieve the absolute path to the root directory of this data source.
Returns:
str: absolute path to the root directory of this data source. | [
"Retrieve",
"the",
"absolute",
"path",
"to",
"the",
"root",
"directory",
"of",
"this",
"data",
"source",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L131-L140 | train | Retrieve the absolute path to the root directory of this data source. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | RecordIOSplitter.split | def split(self, file):
"""Split a file into records using a specific strategy
This RecordIOSplitter splits the data into individual RecordIO records.
Args:
file (str): path to the file to split
Returns: generator for the individual records that were split from the file
... | python | def split(self, file):
"""Split a file into records using a specific strategy
This RecordIOSplitter splits the data into individual RecordIO records.
Args:
file (str): path to the file to split
Returns: generator for the individual records that were split from the file
... | [
"def",
"split",
"(",
"self",
",",
"file",
")",
":",
"with",
"open",
"(",
"file",
",",
"'rb'",
")",
"as",
"f",
":",
"for",
"record",
"in",
"sagemaker",
".",
"amazon",
".",
"common",
".",
"read_recordio",
"(",
"f",
")",
":",
"yield",
"record"
] | Split a file into records using a specific strategy
This RecordIOSplitter splits the data into individual RecordIO records.
Args:
file (str): path to the file to split
Returns: generator for the individual records that were split from the file | [
"Split",
"a",
"file",
"into",
"records",
"using",
"a",
"specific",
"strategy"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L248-L260 | train | Splits a file into individual RecordIO records using a specific strategy | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | MultiRecordStrategy.pad | def pad(self, file, size=6):
"""Group together as many records as possible to fit in the specified size
Args:
file (str): file path to read the records from.
size (int): maximum size in MB that each group of records will be fitted to.
passing 0 means unlimited si... | python | def pad(self, file, size=6):
"""Group together as many records as possible to fit in the specified size
Args:
file (str): file path to read the records from.
size (int): maximum size in MB that each group of records will be fitted to.
passing 0 means unlimited si... | [
"def",
"pad",
"(",
"self",
",",
"file",
",",
"size",
"=",
"6",
")",
":",
"buffer",
"=",
"''",
"for",
"element",
"in",
"self",
".",
"splitter",
".",
"split",
"(",
"file",
")",
":",
"if",
"_payload_size_within_limit",
"(",
"buffer",
"+",
"element",
","... | Group together as many records as possible to fit in the specified size
Args:
file (str): file path to read the records from.
size (int): maximum size in MB that each group of records will be fitted to.
passing 0 means unlimited size.
Returns:
genera... | [
"Group",
"together",
"as",
"many",
"records",
"as",
"possible",
"to",
"fit",
"in",
"the",
"specified",
"size"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L293-L313 | train | Returns a generator that yields the specified size of the records in file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/local/data.py | SingleRecordStrategy.pad | def pad(self, file, size=6):
"""Group together as many records as possible to fit in the specified size
This SingleRecordStrategy will not group any record and will return them one by one as
long as they are within the maximum size.
Args:
file (str): file path to read the r... | python | def pad(self, file, size=6):
"""Group together as many records as possible to fit in the specified size
This SingleRecordStrategy will not group any record and will return them one by one as
long as they are within the maximum size.
Args:
file (str): file path to read the r... | [
"def",
"pad",
"(",
"self",
",",
"file",
",",
"size",
"=",
"6",
")",
":",
"for",
"element",
"in",
"self",
".",
"splitter",
".",
"split",
"(",
"file",
")",
":",
"if",
"_validate_payload_size",
"(",
"element",
",",
"size",
")",
":",
"yield",
"element"
] | Group together as many records as possible to fit in the specified size
This SingleRecordStrategy will not group any record and will return them one by one as
long as they are within the maximum size.
Args:
file (str): file path to read the records from.
size (int): max... | [
"Group",
"together",
"as",
"many",
"records",
"as",
"possible",
"to",
"fit",
"in",
"the",
"specified",
"size"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/data.py#L321-L337 | train | Returns a generator that yields all the records in the specified size. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/chainer/estimator.py | Chainer.hyperparameters | def hyperparameters(self):
"""Return hyperparameters used by your custom Chainer code during training."""
hyperparameters = super(Chainer, self).hyperparameters()
additional_hyperparameters = {Chainer._use_mpi: self.use_mpi,
Chainer._num_processes: self.num... | python | def hyperparameters(self):
"""Return hyperparameters used by your custom Chainer code during training."""
hyperparameters = super(Chainer, self).hyperparameters()
additional_hyperparameters = {Chainer._use_mpi: self.use_mpi,
Chainer._num_processes: self.num... | [
"def",
"hyperparameters",
"(",
"self",
")",
":",
"hyperparameters",
"=",
"super",
"(",
"Chainer",
",",
"self",
")",
".",
"hyperparameters",
"(",
")",
"additional_hyperparameters",
"=",
"{",
"Chainer",
".",
"_use_mpi",
":",
"self",
".",
"use_mpi",
",",
"Chain... | Return hyperparameters used by your custom Chainer code during training. | [
"Return",
"hyperparameters",
"used",
"by",
"your",
"custom",
"Chainer",
"code",
"during",
"training",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/chainer/estimator.py#L99-L111 | train | Return hyperparameters used by your custom Chainer code during training. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/chainer/estimator.py | Chainer.create_model | def create_model(self, model_server_workers=None, role=None, vpc_config_override=VPC_CONFIG_DEFAULT):
"""Create a SageMaker ``ChainerModel`` object that can be deployed to an ``Endpoint``.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``, which is also used during
... | python | def create_model(self, model_server_workers=None, role=None, vpc_config_override=VPC_CONFIG_DEFAULT):
"""Create a SageMaker ``ChainerModel`` object that can be deployed to an ``Endpoint``.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``, which is also used during
... | [
"def",
"create_model",
"(",
"self",
",",
"model_server_workers",
"=",
"None",
",",
"role",
"=",
"None",
",",
"vpc_config_override",
"=",
"VPC_CONFIG_DEFAULT",
")",
":",
"role",
"=",
"role",
"or",
"self",
".",
"role",
"return",
"ChainerModel",
"(",
"self",
".... | Create a SageMaker ``ChainerModel`` object that can be deployed to an ``Endpoint``.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``, which is also used during
transform jobs. If not specified, the role from the Estimator will be used.
model_serv... | [
"Create",
"a",
"SageMaker",
"ChainerModel",
"object",
"that",
"can",
"be",
"deployed",
"to",
"an",
"Endpoint",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/chainer/estimator.py#L113-L137 | train | Create a SageMaker ChainerModel object that can be deployed to an Endpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/chainer/estimator.py | Chainer._prepare_init_params_from_job_description | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_n... | python | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_n... | [
"def",
"_prepare_init_params_from_job_description",
"(",
"cls",
",",
"job_details",
",",
"model_channel_name",
"=",
"None",
")",
":",
"init_params",
"=",
"super",
"(",
"Chainer",
",",
"cls",
")",
".",
"_prepare_init_params_from_job_description",
"(",
"job_details",
",... | Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_name (str): Name of the channel where pre-trained model data will be downloaded.
Returns:
... | [
"Convert",
"the",
"job",
"description",
"to",
"init",
"params",
"that",
"can",
"be",
"handled",
"by",
"the",
"class",
"constructor"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/chainer/estimator.py#L140-L176 | train | Convert the job description to init params that can be handled by the class constructor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/common.py | write_numpy_to_dense_tensor | def write_numpy_to_dense_tensor(file, array, labels=None):
"""Writes a numpy array to a dense tensor"""
# Validate shape of array and labels, resolve array and label types
if not len(array.shape) == 2:
raise ValueError("Array must be a Matrix")
if labels is not None:
if not len(labels.s... | python | def write_numpy_to_dense_tensor(file, array, labels=None):
"""Writes a numpy array to a dense tensor"""
# Validate shape of array and labels, resolve array and label types
if not len(array.shape) == 2:
raise ValueError("Array must be a Matrix")
if labels is not None:
if not len(labels.s... | [
"def",
"write_numpy_to_dense_tensor",
"(",
"file",
",",
"array",
",",
"labels",
"=",
"None",
")",
":",
"# Validate shape of array and labels, resolve array and label types",
"if",
"not",
"len",
"(",
"array",
".",
"shape",
")",
"==",
"2",
":",
"raise",
"ValueError",
... | Writes a numpy array to a dense tensor | [
"Writes",
"a",
"numpy",
"array",
"to",
"a",
"dense",
"tensor"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/common.py#L88-L110 | train | Writes a numpy array to a dense tensor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/common.py | write_spmatrix_to_sparse_tensor | def write_spmatrix_to_sparse_tensor(file, array, labels=None):
"""Writes a scipy sparse matrix to a sparse tensor"""
if not issparse(array):
raise TypeError("Array must be sparse")
# Validate shape of array and labels, resolve array and label types
if not len(array.shape) == 2:
raise V... | python | def write_spmatrix_to_sparse_tensor(file, array, labels=None):
"""Writes a scipy sparse matrix to a sparse tensor"""
if not issparse(array):
raise TypeError("Array must be sparse")
# Validate shape of array and labels, resolve array and label types
if not len(array.shape) == 2:
raise V... | [
"def",
"write_spmatrix_to_sparse_tensor",
"(",
"file",
",",
"array",
",",
"labels",
"=",
"None",
")",
":",
"if",
"not",
"issparse",
"(",
"array",
")",
":",
"raise",
"TypeError",
"(",
"\"Array must be sparse\"",
")",
"# Validate shape of array and labels, resolve array... | Writes a scipy sparse matrix to a sparse tensor | [
"Writes",
"a",
"scipy",
"sparse",
"matrix",
"to",
"a",
"sparse",
"tensor"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/common.py#L113-L150 | train | Writes a scipy sparse matrix to a sparse tensor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/common.py | read_records | def read_records(file):
"""Eagerly read a collection of amazon Record protobuf objects from file."""
records = []
for record_data in read_recordio(file):
record = Record()
record.ParseFromString(record_data)
records.append(record)
return records | python | def read_records(file):
"""Eagerly read a collection of amazon Record protobuf objects from file."""
records = []
for record_data in read_recordio(file):
record = Record()
record.ParseFromString(record_data)
records.append(record)
return records | [
"def",
"read_records",
"(",
"file",
")",
":",
"records",
"=",
"[",
"]",
"for",
"record_data",
"in",
"read_recordio",
"(",
"file",
")",
":",
"record",
"=",
"Record",
"(",
")",
"record",
".",
"ParseFromString",
"(",
"record_data",
")",
"records",
".",
"app... | Eagerly read a collection of amazon Record protobuf objects from file. | [
"Eagerly",
"read",
"a",
"collection",
"of",
"amazon",
"Record",
"protobuf",
"objects",
"from",
"file",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/common.py#L153-L160 | train | Eagerly read a collection of amazon Record protobuf objects from file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/common.py | _write_recordio | def _write_recordio(f, data):
"""Writes a single data point as a RecordIO record to the given file."""
length = len(data)
f.write(struct.pack('I', _kmagic))
f.write(struct.pack('I', length))
pad = (((length + 3) >> 2) << 2) - length
f.write(data)
f.write(padding[pad]) | python | def _write_recordio(f, data):
"""Writes a single data point as a RecordIO record to the given file."""
length = len(data)
f.write(struct.pack('I', _kmagic))
f.write(struct.pack('I', length))
pad = (((length + 3) >> 2) << 2) - length
f.write(data)
f.write(padding[pad]) | [
"def",
"_write_recordio",
"(",
"f",
",",
"data",
")",
":",
"length",
"=",
"len",
"(",
"data",
")",
"f",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"_kmagic",
")",
")",
"f",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
"... | Writes a single data point as a RecordIO record to the given file. | [
"Writes",
"a",
"single",
"data",
"point",
"as",
"a",
"RecordIO",
"record",
"to",
"the",
"given",
"file",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/common.py#L176-L183 | train | Writes a single data point as a RecordIO record to the given file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | Model.prepare_container_def | def prepare_container_def(self, instance_type, accelerator_type=None): # pylint: disable=unused-argument
"""Return a dict created by ``sagemaker.container_def()`` for deploying this model to a specified instance type.
Subclasses can override this to provide custom container definitions for
dep... | python | def prepare_container_def(self, instance_type, accelerator_type=None): # pylint: disable=unused-argument
"""Return a dict created by ``sagemaker.container_def()`` for deploying this model to a specified instance type.
Subclasses can override this to provide custom container definitions for
dep... | [
"def",
"prepare_container_def",
"(",
"self",
",",
"instance_type",
",",
"accelerator_type",
"=",
"None",
")",
":",
"# pylint: disable=unused-argument",
"return",
"sagemaker",
".",
"container_def",
"(",
"self",
".",
"image",
",",
"self",
".",
"model_data",
",",
"se... | Return a dict created by ``sagemaker.container_def()`` for deploying this model to a specified instance type.
Subclasses can override this to provide custom container definitions for
deployment to a specific instance type. Called by ``deploy()``.
Args:
instance_type (str): The EC2 ... | [
"Return",
"a",
"dict",
"created",
"by",
"sagemaker",
".",
"container_def",
"()",
"for",
"deploying",
"this",
"model",
"to",
"a",
"specified",
"instance",
"type",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L73-L87 | train | Prepare a container definition for deploying this model to a specific instance type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | Model._create_sagemaker_model | def _create_sagemaker_model(self, instance_type, accelerator_type=None, tags=None):
"""Create a SageMaker Model Entity
Args:
instance_type (str): The EC2 instance type that this Model will be used for, this is only
used to determine if the image needs GPU support or not.
... | python | def _create_sagemaker_model(self, instance_type, accelerator_type=None, tags=None):
"""Create a SageMaker Model Entity
Args:
instance_type (str): The EC2 instance type that this Model will be used for, this is only
used to determine if the image needs GPU support or not.
... | [
"def",
"_create_sagemaker_model",
"(",
"self",
",",
"instance_type",
",",
"accelerator_type",
"=",
"None",
",",
"tags",
"=",
"None",
")",
":",
"container_def",
"=",
"self",
".",
"prepare_container_def",
"(",
"instance_type",
",",
"accelerator_type",
"=",
"accelera... | Create a SageMaker Model Entity
Args:
instance_type (str): The EC2 instance type that this Model will be used for, this is only
used to determine if the image needs GPU support or not.
accelerator_type (str): Type of Elastic Inference accelerator to attach to an endpoint... | [
"Create",
"a",
"SageMaker",
"Model",
"Entity"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L97-L118 | train | Create a SageMaker Model Entity
MimeType | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | Model.compile | def compile(self, target_instance_family, input_shape, output_path, role,
tags=None, job_name=None, compile_max_run=5 * 60, framework=None, framework_version=None):
"""Compile this ``Model`` with SageMaker Neo.
Args:
target_instance_family (str): Identifies the device that y... | python | def compile(self, target_instance_family, input_shape, output_path, role,
tags=None, job_name=None, compile_max_run=5 * 60, framework=None, framework_version=None):
"""Compile this ``Model`` with SageMaker Neo.
Args:
target_instance_family (str): Identifies the device that y... | [
"def",
"compile",
"(",
"self",
",",
"target_instance_family",
",",
"input_shape",
",",
"output_path",
",",
"role",
",",
"tags",
"=",
"None",
",",
"job_name",
"=",
"None",
",",
"compile_max_run",
"=",
"5",
"*",
"60",
",",
"framework",
"=",
"None",
",",
"f... | Compile this ``Model`` with SageMaker Neo.
Args:
target_instance_family (str): Identifies the device that you want to run your model after compilation, for
example: ml_c5. Allowed strings are: ml_c5, ml_m5, ml_c4, ml_m4, jetsontx1, jetsontx2, ml_p2, ml_p3,
deeplens, ... | [
"Compile",
"this",
"Model",
"with",
"SageMaker",
"Neo",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L162-L209 | train | Compile this model with SageMaker Neo. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | Model.deploy | def deploy(self, initial_instance_count, instance_type, accelerator_type=None, endpoint_name=None,
update_endpoint=False, tags=None, kms_key=None):
"""Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``.
Create a SageMaker ``Model`` and ``EndpointConfig``, and ... | python | def deploy(self, initial_instance_count, instance_type, accelerator_type=None, endpoint_name=None,
update_endpoint=False, tags=None, kms_key=None):
"""Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``.
Create a SageMaker ``Model`` and ``EndpointConfig``, and ... | [
"def",
"deploy",
"(",
"self",
",",
"initial_instance_count",
",",
"instance_type",
",",
"accelerator_type",
"=",
"None",
",",
"endpoint_name",
"=",
"None",
",",
"update_endpoint",
"=",
"False",
",",
"tags",
"=",
"None",
",",
"kms_key",
"=",
"None",
")",
":",... | Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``.
Create a SageMaker ``Model`` and ``EndpointConfig``, and deploy an ``Endpoint`` from this ``Model``.
If ``self.predictor_cls`` is not None, this method returns a the result of invoking
``self.predictor_cls`` on the ... | [
"Deploy",
"this",
"Model",
"to",
"an",
"Endpoint",
"and",
"optionally",
"return",
"a",
"Predictor",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L211-L283 | train | Deploy this model to an Amazon SageMaker Endpoint and optionally return a Predictor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | Model.transformer | def transformer(self, instance_count, instance_type, strategy=None, assemble_with=None, output_path=None,
output_kms_key=None, accept=None, env=None, max_concurrent_transforms=None,
max_payload=None, tags=None, volume_kms_key=None):
"""Return a ``Transformer`` that uses t... | python | def transformer(self, instance_count, instance_type, strategy=None, assemble_with=None, output_path=None,
output_kms_key=None, accept=None, env=None, max_concurrent_transforms=None,
max_payload=None, tags=None, volume_kms_key=None):
"""Return a ``Transformer`` that uses t... | [
"def",
"transformer",
"(",
"self",
",",
"instance_count",
",",
"instance_type",
",",
"strategy",
"=",
"None",
",",
"assemble_with",
"=",
"None",
",",
"output_path",
"=",
"None",
",",
"output_kms_key",
"=",
"None",
",",
"accept",
"=",
"None",
",",
"env",
"=... | Return a ``Transformer`` that uses this Model.
Args:
instance_count (int): Number of EC2 instances to use.
instance_type (str): Type of EC2 instance to use, for example, 'ml.c4.xlarge'.
strategy (str): The strategy used to decide how to batch records in a single request (def... | [
"Return",
"a",
"Transformer",
"that",
"uses",
"this",
"Model",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L285-L317 | train | Returns a Transformer that uses this Model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | FrameworkModel.prepare_container_def | def prepare_container_def(self, instance_type, accelerator_type=None): # pylint disable=unused-argument
"""Return a container definition with framework configuration set in model environment variables.
This also uploads user-supplied code to S3.
Args:
instance_type (str): The EC2 ... | python | def prepare_container_def(self, instance_type, accelerator_type=None): # pylint disable=unused-argument
"""Return a container definition with framework configuration set in model environment variables.
This also uploads user-supplied code to S3.
Args:
instance_type (str): The EC2 ... | [
"def",
"prepare_container_def",
"(",
"self",
",",
"instance_type",
",",
"accelerator_type",
"=",
"None",
")",
":",
"# pylint disable=unused-argument",
"deploy_key_prefix",
"=",
"fw_utils",
".",
"model_code_key_prefix",
"(",
"self",
".",
"key_prefix",
",",
"self",
".",... | Return a container definition with framework configuration set in model environment variables.
This also uploads user-supplied code to S3.
Args:
instance_type (str): The EC2 instance type to deploy this Model to. For example, 'ml.p2.xlarge'.
accelerator_type (str): The Elastic ... | [
"Return",
"a",
"container",
"definition",
"with",
"framework",
"configuration",
"set",
"in",
"model",
"environment",
"variables",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L408-L425 | train | Returns a SageMaker container definition object with framework configuration set in model environment variables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/model.py | ModelPackage._create_sagemaker_model | def _create_sagemaker_model(self, *args): # pylint: disable=unused-argument
"""Create a SageMaker Model Entity
Args:
*args: Arguments coming from the caller. This class
does not require any so they are ignored.
"""
if self.algorithm_arn:
# When M... | python | def _create_sagemaker_model(self, *args): # pylint: disable=unused-argument
"""Create a SageMaker Model Entity
Args:
*args: Arguments coming from the caller. This class
does not require any so they are ignored.
"""
if self.algorithm_arn:
# When M... | [
"def",
"_create_sagemaker_model",
"(",
"self",
",",
"*",
"args",
")",
":",
"# pylint: disable=unused-argument",
"if",
"self",
".",
"algorithm_arn",
":",
"# When ModelPackage is created using an algorithm_arn we need to first",
"# create a ModelPackage. If we had already created one t... | Create a SageMaker Model Entity
Args:
*args: Arguments coming from the caller. This class
does not require any so they are ignored. | [
"Create",
"a",
"SageMaker",
"Model",
"Entity"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/model.py#L538-L569 | train | Create a SageMaker Model Entity and return the ModelPackage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/predictor.py | RealTimePredictor.predict | def predict(self, data, initial_args=None):
"""Return the inference from the specified endpoint.
Args:
data (object): Input data for which you want the model to provide inference.
If a serializer was specified when creating the RealTimePredictor, the result of the
... | python | def predict(self, data, initial_args=None):
"""Return the inference from the specified endpoint.
Args:
data (object): Input data for which you want the model to provide inference.
If a serializer was specified when creating the RealTimePredictor, the result of the
... | [
"def",
"predict",
"(",
"self",
",",
"data",
",",
"initial_args",
"=",
"None",
")",
":",
"request_args",
"=",
"self",
".",
"_create_request_args",
"(",
"data",
",",
"initial_args",
")",
"response",
"=",
"self",
".",
"sagemaker_session",
".",
"sagemaker_runtime_... | Return the inference from the specified endpoint.
Args:
data (object): Input data for which you want the model to provide inference.
If a serializer was specified when creating the RealTimePredictor, the result of the
serializer is sent as input data. Otherwise the d... | [
"Return",
"the",
"inference",
"from",
"the",
"specified",
"endpoint",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/predictor.py#L62-L81 | train | Return the inference from the specified endpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/predictor.py | RealTimePredictor.delete_endpoint | def delete_endpoint(self, delete_endpoint_config=True):
"""Delete the Amazon SageMaker endpoint backing this predictor. Also delete the endpoint configuration attached
to it if delete_endpoint_config is True.
Args:
delete_endpoint_config (bool, optional): Flag to indicate whether to... | python | def delete_endpoint(self, delete_endpoint_config=True):
"""Delete the Amazon SageMaker endpoint backing this predictor. Also delete the endpoint configuration attached
to it if delete_endpoint_config is True.
Args:
delete_endpoint_config (bool, optional): Flag to indicate whether to... | [
"def",
"delete_endpoint",
"(",
"self",
",",
"delete_endpoint_config",
"=",
"True",
")",
":",
"if",
"delete_endpoint_config",
":",
"self",
".",
"_delete_endpoint_config",
"(",
")",
"self",
".",
"sagemaker_session",
".",
"delete_endpoint",
"(",
"self",
".",
"endpoin... | Delete the Amazon SageMaker endpoint backing this predictor. Also delete the endpoint configuration attached
to it if delete_endpoint_config is True.
Args:
delete_endpoint_config (bool, optional): Flag to indicate whether to delete endpoint configuration together
with endpoi... | [
"Delete",
"the",
"Amazon",
"SageMaker",
"endpoint",
"backing",
"this",
"predictor",
".",
"Also",
"delete",
"the",
"endpoint",
"configuration",
"attached",
"to",
"it",
"if",
"delete_endpoint_config",
"is",
"True",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/predictor.py#L116-L129 | train | Delete the Amazon SageMaker endpoint backing this predictor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/predictor.py | RealTimePredictor.delete_model | def delete_model(self):
"""Deletes the Amazon SageMaker models backing this predictor.
"""
request_failed = False
failed_models = []
for model_name in self._model_names:
try:
self.sagemaker_session.delete_model(model_name)
except Exception... | python | def delete_model(self):
"""Deletes the Amazon SageMaker models backing this predictor.
"""
request_failed = False
failed_models = []
for model_name in self._model_names:
try:
self.sagemaker_session.delete_model(model_name)
except Exception... | [
"def",
"delete_model",
"(",
"self",
")",
":",
"request_failed",
"=",
"False",
"failed_models",
"=",
"[",
"]",
"for",
"model_name",
"in",
"self",
".",
"_model_names",
":",
"try",
":",
"self",
".",
"sagemaker_session",
".",
"delete_model",
"(",
"model_name",
"... | Deletes the Amazon SageMaker models backing this predictor. | [
"Deletes",
"the",
"Amazon",
"SageMaker",
"models",
"backing",
"this",
"predictor",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/predictor.py#L131-L146 | train | Deletes the Amazon SageMaker models backing this predictor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | AnalyticsMetricsBase.dataframe | def dataframe(self, force_refresh=False):
"""A pandas dataframe with lots of interesting results about this object.
Created by calling SageMaker List and Describe APIs and converting them into
a convenient tabular summary.
Args:
force_refresh (bool): Set to True to fetch the... | python | def dataframe(self, force_refresh=False):
"""A pandas dataframe with lots of interesting results about this object.
Created by calling SageMaker List and Describe APIs and converting them into
a convenient tabular summary.
Args:
force_refresh (bool): Set to True to fetch the... | [
"def",
"dataframe",
"(",
"self",
",",
"force_refresh",
"=",
"False",
")",
":",
"if",
"force_refresh",
":",
"self",
".",
"clear_cache",
"(",
")",
"if",
"self",
".",
"_dataframe",
"is",
"None",
":",
"self",
".",
"_dataframe",
"=",
"self",
".",
"_fetch_data... | A pandas dataframe with lots of interesting results about this object.
Created by calling SageMaker List and Describe APIs and converting them into
a convenient tabular summary.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API. | [
"A",
"pandas",
"dataframe",
"with",
"lots",
"of",
"interesting",
"results",
"about",
"this",
"object",
".",
"Created",
"by",
"calling",
"SageMaker",
"List",
"and",
"Describe",
"APIs",
"and",
"converting",
"them",
"into",
"a",
"convenient",
"tabular",
"summary",
... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L48-L60 | train | A pandas dataframe with lots of interesting results about this object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | HyperparameterTuningJobAnalytics.clear_cache | def clear_cache(self):
"""Clear the object of all local caches of API methods.
"""
super(HyperparameterTuningJobAnalytics, self).clear_cache()
self._tuning_job_describe_result = None
self._training_job_summaries = None | python | def clear_cache(self):
"""Clear the object of all local caches of API methods.
"""
super(HyperparameterTuningJobAnalytics, self).clear_cache()
self._tuning_job_describe_result = None
self._training_job_summaries = None | [
"def",
"clear_cache",
"(",
"self",
")",
":",
"super",
"(",
"HyperparameterTuningJobAnalytics",
",",
"self",
")",
".",
"clear_cache",
"(",
")",
"self",
".",
"_tuning_job_describe_result",
"=",
"None",
"self",
".",
"_training_job_summaries",
"=",
"None"
] | Clear the object of all local caches of API methods. | [
"Clear",
"the",
"object",
"of",
"all",
"local",
"caches",
"of",
"API",
"methods",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L102-L107 | train | Clear the local cache of all local data structures. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | HyperparameterTuningJobAnalytics.tuning_ranges | def tuning_ranges(self):
"""A dictionary describing the ranges of all tuned hyperparameters.
The keys are the names of the hyperparameter, and the values are the ranges.
"""
out = {}
for _, ranges in self.description()['HyperParameterTuningJobConfig']['ParameterRanges'].items():
... | python | def tuning_ranges(self):
"""A dictionary describing the ranges of all tuned hyperparameters.
The keys are the names of the hyperparameter, and the values are the ranges.
"""
out = {}
for _, ranges in self.description()['HyperParameterTuningJobConfig']['ParameterRanges'].items():
... | [
"def",
"tuning_ranges",
"(",
"self",
")",
":",
"out",
"=",
"{",
"}",
"for",
"_",
",",
"ranges",
"in",
"self",
".",
"description",
"(",
")",
"[",
"'HyperParameterTuningJobConfig'",
"]",
"[",
"'ParameterRanges'",
"]",
".",
"items",
"(",
")",
":",
"for",
... | A dictionary describing the ranges of all tuned hyperparameters.
The keys are the names of the hyperparameter, and the values are the ranges. | [
"A",
"dictionary",
"describing",
"the",
"ranges",
"of",
"all",
"tuned",
"hyperparameters",
".",
"The",
"keys",
"are",
"the",
"names",
"of",
"the",
"hyperparameter",
"and",
"the",
"values",
"are",
"the",
"ranges",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L141-L149 | train | A dictionary describing the ranges of all tuned hyperparameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | HyperparameterTuningJobAnalytics.description | def description(self, force_refresh=False):
"""Call ``DescribeHyperParameterTuningJob`` for the hyperparameter tuning job.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.
Returns:
dict: The Amazon SageMaker response for ``DescribeHyp... | python | def description(self, force_refresh=False):
"""Call ``DescribeHyperParameterTuningJob`` for the hyperparameter tuning job.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.
Returns:
dict: The Amazon SageMaker response for ``DescribeHyp... | [
"def",
"description",
"(",
"self",
",",
"force_refresh",
"=",
"False",
")",
":",
"if",
"force_refresh",
":",
"self",
".",
"clear_cache",
"(",
")",
"if",
"not",
"self",
".",
"_tuning_job_describe_result",
":",
"self",
".",
"_tuning_job_describe_result",
"=",
"s... | Call ``DescribeHyperParameterTuningJob`` for the hyperparameter tuning job.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.
Returns:
dict: The Amazon SageMaker response for ``DescribeHyperParameterTuningJob``. | [
"Call",
"DescribeHyperParameterTuningJob",
"for",
"the",
"hyperparameter",
"tuning",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L151-L166 | train | Get the description of the hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | HyperparameterTuningJobAnalytics.training_job_summaries | def training_job_summaries(self, force_refresh=False):
"""A (paginated) list of everything from ``ListTrainingJobsForTuningJob``.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.
Returns:
dict: The Amazon SageMaker response for ``List... | python | def training_job_summaries(self, force_refresh=False):
"""A (paginated) list of everything from ``ListTrainingJobsForTuningJob``.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.
Returns:
dict: The Amazon SageMaker response for ``List... | [
"def",
"training_job_summaries",
"(",
"self",
",",
"force_refresh",
"=",
"False",
")",
":",
"if",
"force_refresh",
":",
"self",
".",
"clear_cache",
"(",
")",
"if",
"self",
".",
"_training_job_summaries",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_tra... | A (paginated) list of everything from ``ListTrainingJobsForTuningJob``.
Args:
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.
Returns:
dict: The Amazon SageMaker response for ``ListTrainingJobsForTuningJob``. | [
"A",
"(",
"paginated",
")",
"list",
"of",
"everything",
"from",
"ListTrainingJobsForTuningJob",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L168-L196 | train | A list of all training jobs for a hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | TrainingJobAnalytics.clear_cache | def clear_cache(self):
"""Clear the object of all local caches of API methods, so
that the next time any properties are accessed they will be refreshed from
the service.
"""
super(TrainingJobAnalytics, self).clear_cache()
self._data = defaultdict(list)
self._time_... | python | def clear_cache(self):
"""Clear the object of all local caches of API methods, so
that the next time any properties are accessed they will be refreshed from
the service.
"""
super(TrainingJobAnalytics, self).clear_cache()
self._data = defaultdict(list)
self._time_... | [
"def",
"clear_cache",
"(",
"self",
")",
":",
"super",
"(",
"TrainingJobAnalytics",
",",
"self",
")",
".",
"clear_cache",
"(",
")",
"self",
".",
"_data",
"=",
"defaultdict",
"(",
"list",
")",
"self",
".",
"_time_interval",
"=",
"self",
".",
"_determine_time... | Clear the object of all local caches of API methods, so
that the next time any properties are accessed they will be refreshed from
the service. | [
"Clear",
"the",
"object",
"of",
"all",
"local",
"caches",
"of",
"API",
"methods",
"so",
"that",
"the",
"next",
"time",
"any",
"properties",
"are",
"accessed",
"they",
"will",
"be",
"refreshed",
"from",
"the",
"service",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L240-L247 | train | Clear the local cache of all API methods so
is not used. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | TrainingJobAnalytics._determine_timeinterval | def _determine_timeinterval(self):
"""Return a dictionary with two datetime objects, start_time and end_time,
covering the interval of the training job
"""
description = self._sage_client.describe_training_job(TrainingJobName=self.name)
start_time = self._start_time or descriptio... | python | def _determine_timeinterval(self):
"""Return a dictionary with two datetime objects, start_time and end_time,
covering the interval of the training job
"""
description = self._sage_client.describe_training_job(TrainingJobName=self.name)
start_time = self._start_time or descriptio... | [
"def",
"_determine_timeinterval",
"(",
"self",
")",
":",
"description",
"=",
"self",
".",
"_sage_client",
".",
"describe_training_job",
"(",
"TrainingJobName",
"=",
"self",
".",
"name",
")",
"start_time",
"=",
"self",
".",
"_start_time",
"or",
"description",
"["... | Return a dictionary with two datetime objects, start_time and end_time,
covering the interval of the training job | [
"Return",
"a",
"dictionary",
"with",
"two",
"datetime",
"objects",
"start_time",
"and",
"end_time",
"covering",
"the",
"interval",
"of",
"the",
"training",
"job"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L249-L266 | train | Return a dictionary with two datetime objects start_time and end_time covering the interval of the training job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | TrainingJobAnalytics._fetch_metric | def _fetch_metric(self, metric_name):
"""Fetch all the values of a named metric, and add them to _data
"""
request = {
'Namespace': self.CLOUDWATCH_NAMESPACE,
'MetricName': metric_name,
'Dimensions': [
{
'Name': 'TrainingJob... | python | def _fetch_metric(self, metric_name):
"""Fetch all the values of a named metric, and add them to _data
"""
request = {
'Namespace': self.CLOUDWATCH_NAMESPACE,
'MetricName': metric_name,
'Dimensions': [
{
'Name': 'TrainingJob... | [
"def",
"_fetch_metric",
"(",
"self",
",",
"metric_name",
")",
":",
"request",
"=",
"{",
"'Namespace'",
":",
"self",
".",
"CLOUDWATCH_NAMESPACE",
",",
"'MetricName'",
":",
"metric_name",
",",
"'Dimensions'",
":",
"[",
"{",
"'Name'",
":",
"'TrainingJobName'",
",... | Fetch all the values of a named metric, and add them to _data | [
"Fetch",
"all",
"the",
"values",
"of",
"a",
"named",
"metric",
"and",
"add",
"them",
"to",
"_data"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L273-L306 | train | Fetch all the values of a named metric and add them to _data
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | TrainingJobAnalytics._add_single_metric | def _add_single_metric(self, timestamp, metric_name, value):
"""Store a single metric in the _data dict which can be
converted to a dataframe.
"""
# note that this method is built this way to make it possible to
# support live-refreshing charts in Bokeh at some point in the futur... | python | def _add_single_metric(self, timestamp, metric_name, value):
"""Store a single metric in the _data dict which can be
converted to a dataframe.
"""
# note that this method is built this way to make it possible to
# support live-refreshing charts in Bokeh at some point in the futur... | [
"def",
"_add_single_metric",
"(",
"self",
",",
"timestamp",
",",
"metric_name",
",",
"value",
")",
":",
"# note that this method is built this way to make it possible to",
"# support live-refreshing charts in Bokeh at some point in the future.",
"self",
".",
"_data",
"[",
"'times... | Store a single metric in the _data dict which can be
converted to a dataframe. | [
"Store",
"a",
"single",
"metric",
"in",
"the",
"_data",
"dict",
"which",
"can",
"be",
"converted",
"to",
"a",
"dataframe",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L308-L316 | train | Store a single metric in the _data dict which can be
converted to a dataframe. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/analytics.py | TrainingJobAnalytics._metric_names_for_training_job | def _metric_names_for_training_job(self):
"""Helper method to discover the metrics defined for a training job.
"""
training_description = self._sage_client.describe_training_job(TrainingJobName=self._training_job_name)
metric_definitions = training_description['AlgorithmSpecification'][... | python | def _metric_names_for_training_job(self):
"""Helper method to discover the metrics defined for a training job.
"""
training_description = self._sage_client.describe_training_job(TrainingJobName=self._training_job_name)
metric_definitions = training_description['AlgorithmSpecification'][... | [
"def",
"_metric_names_for_training_job",
"(",
"self",
")",
":",
"training_description",
"=",
"self",
".",
"_sage_client",
".",
"describe_training_job",
"(",
"TrainingJobName",
"=",
"self",
".",
"_training_job_name",
")",
"metric_definitions",
"=",
"training_description",
... | Helper method to discover the metrics defined for a training job. | [
"Helper",
"method",
"to",
"discover",
"the",
"metrics",
"defined",
"for",
"a",
"training",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/analytics.py#L318-L326 | train | Helper method to discover the metrics defined for a training job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | name_from_base | def name_from_base(base, max_length=63, short=False):
"""Append a timestamp to the provided string.
This function assures that the total length of the resulting string is not
longer than the specified max length, trimming the input parameter if necessary.
Args:
base (str): String used as prefi... | python | def name_from_base(base, max_length=63, short=False):
"""Append a timestamp to the provided string.
This function assures that the total length of the resulting string is not
longer than the specified max length, trimming the input parameter if necessary.
Args:
base (str): String used as prefi... | [
"def",
"name_from_base",
"(",
"base",
",",
"max_length",
"=",
"63",
",",
"short",
"=",
"False",
")",
":",
"timestamp",
"=",
"sagemaker_short_timestamp",
"(",
")",
"if",
"short",
"else",
"sagemaker_timestamp",
"(",
")",
"trimmed_base",
"=",
"base",
"[",
":",
... | Append a timestamp to the provided string.
This function assures that the total length of the resulting string is not
longer than the specified max length, trimming the input parameter if necessary.
Args:
base (str): String used as prefix to generate the unique name.
max_length (int): Maxi... | [
"Append",
"a",
"timestamp",
"to",
"the",
"provided",
"string",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L46-L62 | train | Generate a unique name from a base string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | base_name_from_image | def base_name_from_image(image):
"""Extract the base name of the image to use as the 'algorithm name' for the job.
Args:
image (str): Image name.
Returns:
str: Algorithm name, as extracted from the image name.
"""
m = re.match("^(.+/)?([^:/]+)(:[^:]+)?$", image)
algo_name = m.g... | python | def base_name_from_image(image):
"""Extract the base name of the image to use as the 'algorithm name' for the job.
Args:
image (str): Image name.
Returns:
str: Algorithm name, as extracted from the image name.
"""
m = re.match("^(.+/)?([^:/]+)(:[^:]+)?$", image)
algo_name = m.g... | [
"def",
"base_name_from_image",
"(",
"image",
")",
":",
"m",
"=",
"re",
".",
"match",
"(",
"\"^(.+/)?([^:/]+)(:[^:]+)?$\"",
",",
"image",
")",
"algo_name",
"=",
"m",
".",
"group",
"(",
"2",
")",
"if",
"m",
"else",
"image",
"return",
"algo_name"
] | Extract the base name of the image to use as the 'algorithm name' for the job.
Args:
image (str): Image name.
Returns:
str: Algorithm name, as extracted from the image name. | [
"Extract",
"the",
"base",
"name",
"of",
"the",
"image",
"to",
"use",
"as",
"the",
"algorithm",
"name",
"for",
"the",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L73-L84 | train | Extract the base name of the image to use as the algorithm name for the job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | sagemaker_timestamp | def sagemaker_timestamp():
"""Return a timestamp with millisecond precision."""
moment = time.time()
moment_ms = repr(moment).split('.')[1][:3]
return time.strftime("%Y-%m-%d-%H-%M-%S-{}".format(moment_ms), time.gmtime(moment)) | python | def sagemaker_timestamp():
"""Return a timestamp with millisecond precision."""
moment = time.time()
moment_ms = repr(moment).split('.')[1][:3]
return time.strftime("%Y-%m-%d-%H-%M-%S-{}".format(moment_ms), time.gmtime(moment)) | [
"def",
"sagemaker_timestamp",
"(",
")",
":",
"moment",
"=",
"time",
".",
"time",
"(",
")",
"moment_ms",
"=",
"repr",
"(",
"moment",
")",
".",
"split",
"(",
"'.'",
")",
"[",
"1",
"]",
"[",
":",
"3",
"]",
"return",
"time",
".",
"strftime",
"(",
"\"... | Return a timestamp with millisecond precision. | [
"Return",
"a",
"timestamp",
"with",
"millisecond",
"precision",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L87-L91 | train | Return a timestamp with millisecond precision. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | debug | def debug(func):
"""Print the function name and arguments for debugging."""
@wraps(func)
def wrapper(*args, **kwargs):
print("{} args: {} kwargs: {}".format(func.__name__, args, kwargs))
return func(*args, **kwargs)
return wrapper | python | def debug(func):
"""Print the function name and arguments for debugging."""
@wraps(func)
def wrapper(*args, **kwargs):
print("{} args: {} kwargs: {}".format(func.__name__, args, kwargs))
return func(*args, **kwargs)
return wrapper | [
"def",
"debug",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"print",
"(",
"\"{} args: {} kwargs: {}\"",
".",
"format",
"(",
"func",
".",
"__name__",
",",
"args",
",",
... | Print the function name and arguments for debugging. | [
"Print",
"the",
"function",
"name",
"and",
"arguments",
"for",
"debugging",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L99-L106 | train | Print the function name and arguments for debugging. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | to_str | def to_str(value):
"""Convert the input to a string, unless it is a unicode string in Python 2.
Unicode strings are supported as native strings in Python 3, but ``str()`` cannot be
invoked on unicode strings in Python 2, so we need to check for that case when
converting user-specified values to strings... | python | def to_str(value):
"""Convert the input to a string, unless it is a unicode string in Python 2.
Unicode strings are supported as native strings in Python 3, but ``str()`` cannot be
invoked on unicode strings in Python 2, so we need to check for that case when
converting user-specified values to strings... | [
"def",
"to_str",
"(",
"value",
")",
":",
"if",
"sys",
".",
"version_info",
".",
"major",
"<",
"3",
"and",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
":",
"return",
"value",
"return",
"str",
"(",
"value",
")"
] | Convert the input to a string, unless it is a unicode string in Python 2.
Unicode strings are supported as native strings in Python 3, but ``str()`` cannot be
invoked on unicode strings in Python 2, so we need to check for that case when
converting user-specified values to strings.
Args:
value... | [
"Convert",
"the",
"input",
"to",
"a",
"string",
"unless",
"it",
"is",
"a",
"unicode",
"string",
"in",
"Python",
"2",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L123-L138 | train | Convert the input value to a string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | extract_name_from_job_arn | def extract_name_from_job_arn(arn):
"""Returns the name used in the API given a full ARN for a training job
or hyperparameter tuning job.
"""
slash_pos = arn.find('/')
if slash_pos == -1:
raise ValueError("Cannot parse invalid ARN: %s" % arn)
return arn[(slash_pos + 1):] | python | def extract_name_from_job_arn(arn):
"""Returns the name used in the API given a full ARN for a training job
or hyperparameter tuning job.
"""
slash_pos = arn.find('/')
if slash_pos == -1:
raise ValueError("Cannot parse invalid ARN: %s" % arn)
return arn[(slash_pos + 1):] | [
"def",
"extract_name_from_job_arn",
"(",
"arn",
")",
":",
"slash_pos",
"=",
"arn",
".",
"find",
"(",
"'/'",
")",
"if",
"slash_pos",
"==",
"-",
"1",
":",
"raise",
"ValueError",
"(",
"\"Cannot parse invalid ARN: %s\"",
"%",
"arn",
")",
"return",
"arn",
"[",
... | Returns the name used in the API given a full ARN for a training job
or hyperparameter tuning job. | [
"Returns",
"the",
"name",
"used",
"in",
"the",
"API",
"given",
"a",
"full",
"ARN",
"for",
"a",
"training",
"job",
"or",
"hyperparameter",
"tuning",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L141-L148 | train | Returns the name used in the API given a full ARN for a training job
or hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | secondary_training_status_message | def secondary_training_status_message(job_description, prev_description):
"""Returns a string contains last modified time and the secondary training job status message.
Args:
job_description: Returned response from DescribeTrainingJob call
prev_description: Previous job description from Describ... | python | def secondary_training_status_message(job_description, prev_description):
"""Returns a string contains last modified time and the secondary training job status message.
Args:
job_description: Returned response from DescribeTrainingJob call
prev_description: Previous job description from Describ... | [
"def",
"secondary_training_status_message",
"(",
"job_description",
",",
"prev_description",
")",
":",
"if",
"job_description",
"is",
"None",
"or",
"job_description",
".",
"get",
"(",
"'SecondaryStatusTransitions'",
")",
"is",
"None",
"or",
"len",
"(",
"job_descriptio... | Returns a string contains last modified time and the secondary training job status message.
Args:
job_description: Returned response from DescribeTrainingJob call
prev_description: Previous job description from DescribeTrainingJob call
Returns:
str: Job status string to be printed. | [
"Returns",
"a",
"string",
"contains",
"last",
"modified",
"time",
"and",
"the",
"secondary",
"training",
"job",
"status",
"message",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L177-L213 | train | Returns a string containing last modified time and the secondary training job status message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | download_folder | def download_folder(bucket_name, prefix, target, sagemaker_session):
"""Download a folder from S3 to a local path
Args:
bucket_name (str): S3 bucket name
prefix (str): S3 prefix within the bucket that will be downloaded. Can be a single file.
target (str): destination path where the dow... | python | def download_folder(bucket_name, prefix, target, sagemaker_session):
"""Download a folder from S3 to a local path
Args:
bucket_name (str): S3 bucket name
prefix (str): S3 prefix within the bucket that will be downloaded. Can be a single file.
target (str): destination path where the dow... | [
"def",
"download_folder",
"(",
"bucket_name",
",",
"prefix",
",",
"target",
",",
"sagemaker_session",
")",
":",
"boto_session",
"=",
"sagemaker_session",
".",
"boto_session",
"s3",
"=",
"boto_session",
".",
"resource",
"(",
"'s3'",
")",
"bucket",
"=",
"s3",
".... | Download a folder from S3 to a local path
Args:
bucket_name (str): S3 bucket name
prefix (str): S3 prefix within the bucket that will be downloaded. Can be a single file.
target (str): destination path where the downloaded items will be placed
sagemaker_session (:class:`sagemaker.se... | [
"Download",
"a",
"folder",
"from",
"S3",
"to",
"a",
"local",
"path"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L216-L256 | train | Download a folder from S3 to a local path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | create_tar_file | def create_tar_file(source_files, target=None):
"""Create a tar file containing all the source_files
Args:
source_files (List[str]): List of file paths that will be contained in the tar file
Returns:
(str): path to created tar file
"""
if target:
filename = target
els... | python | def create_tar_file(source_files, target=None):
"""Create a tar file containing all the source_files
Args:
source_files (List[str]): List of file paths that will be contained in the tar file
Returns:
(str): path to created tar file
"""
if target:
filename = target
els... | [
"def",
"create_tar_file",
"(",
"source_files",
",",
"target",
"=",
"None",
")",
":",
"if",
"target",
":",
"filename",
"=",
"target",
"else",
":",
"_",
",",
"filename",
"=",
"tempfile",
".",
"mkstemp",
"(",
")",
"with",
"tarfile",
".",
"open",
"(",
"fil... | Create a tar file containing all the source_files
Args:
source_files (List[str]): List of file paths that will be contained in the tar file
Returns:
(str): path to created tar file | [
"Create",
"a",
"tar",
"file",
"containing",
"all",
"the",
"source_files"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L259-L278 | train | Create a tar file containing all the source_files | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/utils.py | download_file | def download_file(bucket_name, path, target, sagemaker_session):
"""Download a Single File from S3 into a local path
Args:
bucket_name (str): S3 bucket name
path (str): file path within the bucket
target (str): destination directory for the downloaded file.
sagemaker_session (:c... | python | def download_file(bucket_name, path, target, sagemaker_session):
"""Download a Single File from S3 into a local path
Args:
bucket_name (str): S3 bucket name
path (str): file path within the bucket
target (str): destination directory for the downloaded file.
sagemaker_session (:c... | [
"def",
"download_file",
"(",
"bucket_name",
",",
"path",
",",
"target",
",",
"sagemaker_session",
")",
":",
"path",
"=",
"path",
".",
"lstrip",
"(",
"'/'",
")",
"boto_session",
"=",
"sagemaker_session",
".",
"boto_session",
"s3",
"=",
"boto_session",
".",
"r... | Download a Single File from S3 into a local path
Args:
bucket_name (str): S3 bucket name
path (str): file path within the bucket
target (str): destination directory for the downloaded file.
sagemaker_session (:class:`sagemaker.session.Session`): a sagemaker session to interact with ... | [
"Download",
"a",
"Single",
"File",
"from",
"S3",
"into",
"a",
"local",
"path"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/utils.py#L281-L295 | train | Download a Single File from S3 into a local path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | Tensorboard._sync_directories | def _sync_directories(from_directory, to_directory):
"""Sync to_directory with from_directory by copying each file in
to_directory with new contents. Files in to_directory will be
overwritten by files of the same name in from_directory. We need to
keep two copies of the log directory bec... | python | def _sync_directories(from_directory, to_directory):
"""Sync to_directory with from_directory by copying each file in
to_directory with new contents. Files in to_directory will be
overwritten by files of the same name in from_directory. We need to
keep two copies of the log directory bec... | [
"def",
"_sync_directories",
"(",
"from_directory",
",",
"to_directory",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"to_directory",
")",
":",
"os",
".",
"mkdir",
"(",
"to_directory",
")",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
... | Sync to_directory with from_directory by copying each file in
to_directory with new contents. Files in to_directory will be
overwritten by files of the same name in from_directory. We need to
keep two copies of the log directory because otherwise TensorBoard
picks up temp files from `aws... | [
"Sync",
"to_directory",
"with",
"from_directory",
"by",
"copying",
"each",
"file",
"in",
"to_directory",
"with",
"new",
"contents",
".",
"Files",
"in",
"to_directory",
"will",
"be",
"overwritten",
"by",
"files",
"of",
"the",
"same",
"name",
"in",
"from_directory... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L66-L92 | train | Syncs the contents of from_directory to to_directory by copying each file in from_directory with new contents. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | Tensorboard.create_tensorboard_process | def create_tensorboard_process(self):
"""Create a TensorBoard process.
Returns:
tuple: A tuple containing:
int: The port number.
process: The TensorBoard process.
Raises:
OSError: If no ports between 6006 and 6105 are available for starti... | python | def create_tensorboard_process(self):
"""Create a TensorBoard process.
Returns:
tuple: A tuple containing:
int: The port number.
process: The TensorBoard process.
Raises:
OSError: If no ports between 6006 and 6105 are available for starti... | [
"def",
"create_tensorboard_process",
"(",
"self",
")",
":",
"port",
"=",
"6006",
"for",
"_",
"in",
"range",
"(",
"100",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"\"tensorboard\"",
",",
"\"--logdir\"",
",",
"self",
".",
"logdir",
",",
"... | Create a TensorBoard process.
Returns:
tuple: A tuple containing:
int: The port number.
process: The TensorBoard process.
Raises:
OSError: If no ports between 6006 and 6105 are available for starting TensorBoard. | [
"Create",
"a",
"TensorBoard",
"process",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L124-L151 | train | Create a TensorBoard process. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | Tensorboard.run | def run(self):
"""Run TensorBoard process."""
port, tensorboard_process = self.create_tensorboard_process()
LOGGER.info('TensorBoard 0.1.7 at http://localhost:{}'.format(port))
while not self.estimator.checkpoint_path:
self.event.wait(1)
with self._temporary_director... | python | def run(self):
"""Run TensorBoard process."""
port, tensorboard_process = self.create_tensorboard_process()
LOGGER.info('TensorBoard 0.1.7 at http://localhost:{}'.format(port))
while not self.estimator.checkpoint_path:
self.event.wait(1)
with self._temporary_director... | [
"def",
"run",
"(",
"self",
")",
":",
"port",
",",
"tensorboard_process",
"=",
"self",
".",
"create_tensorboard_process",
"(",
")",
"LOGGER",
".",
"info",
"(",
"'TensorBoard 0.1.7 at http://localhost:{}'",
".",
"format",
"(",
"port",
")",
")",
"while",
"not",
"... | Run TensorBoard process. | [
"Run",
"TensorBoard",
"process",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L153-L166 | train | Run TensorBoard process. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | TensorFlow.fit | def fit(self, inputs=None, wait=True, logs=True, job_name=None, run_tensorboard_locally=False):
"""Train a model using the input training dataset.
See :func:`~sagemaker.estimator.EstimatorBase.fit` for more details.
Args:
inputs (str or dict or sagemaker.session.s3_input): Informat... | python | def fit(self, inputs=None, wait=True, logs=True, job_name=None, run_tensorboard_locally=False):
"""Train a model using the input training dataset.
See :func:`~sagemaker.estimator.EstimatorBase.fit` for more details.
Args:
inputs (str or dict or sagemaker.session.s3_input): Informat... | [
"def",
"fit",
"(",
"self",
",",
"inputs",
"=",
"None",
",",
"wait",
"=",
"True",
",",
"logs",
"=",
"True",
",",
"job_name",
"=",
"None",
",",
"run_tensorboard_locally",
"=",
"False",
")",
":",
"def",
"fit_super",
"(",
")",
":",
"super",
"(",
"TensorF... | Train a model using the input training dataset.
See :func:`~sagemaker.estimator.EstimatorBase.fit` for more details.
Args:
inputs (str or dict or sagemaker.session.s3_input): Information about the training data.
This can be one of three types:
* (str) - the... | [
"Train",
"a",
"model",
"using",
"the",
"input",
"training",
"dataset",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L289-L338 | train | Train a model using the input training dataset. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | TensorFlow._prepare_init_params_from_job_description | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
Returns:
... | python | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
Returns:
... | [
"def",
"_prepare_init_params_from_job_description",
"(",
"cls",
",",
"job_details",
",",
"model_channel_name",
"=",
"None",
")",
":",
"init_params",
"=",
"super",
"(",
"TensorFlow",
",",
"cls",
")",
".",
"_prepare_init_params_from_job_description",
"(",
"job_details",
... | Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
Returns:
dictionary: The transformed init_params | [
"Convert",
"the",
"job",
"description",
"to",
"init",
"params",
"that",
"can",
"be",
"handled",
"by",
"the",
"class",
"constructor"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L341-L385 | train | Convert the job description to init params that can be handled by the class constructor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | TensorFlow.create_model | def create_model(self, model_server_workers=None, role=None,
vpc_config_override=VPC_CONFIG_DEFAULT, endpoint_type=None):
"""Create a SageMaker ``TensorFlowModel`` object that can be deployed to an ``Endpoint``.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN fo... | python | def create_model(self, model_server_workers=None, role=None,
vpc_config_override=VPC_CONFIG_DEFAULT, endpoint_type=None):
"""Create a SageMaker ``TensorFlowModel`` object that can be deployed to an ``Endpoint``.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN fo... | [
"def",
"create_model",
"(",
"self",
",",
"model_server_workers",
"=",
"None",
",",
"role",
"=",
"None",
",",
"vpc_config_override",
"=",
"VPC_CONFIG_DEFAULT",
",",
"endpoint_type",
"=",
"None",
")",
":",
"role",
"=",
"role",
"or",
"self",
".",
"role",
"if",
... | Create a SageMaker ``TensorFlowModel`` object that can be deployed to an ``Endpoint``.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``, which is also used during
transform jobs. If not specified, the role from the Estimator will be used.
model_s... | [
"Create",
"a",
"SageMaker",
"TensorFlowModel",
"object",
"that",
"can",
"be",
"deployed",
"to",
"an",
"Endpoint",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L387-L415 | train | Create a SageMaker TensorFlowModel object that can be deployed to an Endpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tensorflow/estimator.py | TensorFlow.hyperparameters | def hyperparameters(self):
"""Return hyperparameters used by your custom TensorFlow code during model training."""
hyperparameters = super(TensorFlow, self).hyperparameters()
self.checkpoint_path = self.checkpoint_path or self._default_s3_path('checkpoints')
mpi_enabled = False
... | python | def hyperparameters(self):
"""Return hyperparameters used by your custom TensorFlow code during model training."""
hyperparameters = super(TensorFlow, self).hyperparameters()
self.checkpoint_path = self.checkpoint_path or self._default_s3_path('checkpoints')
mpi_enabled = False
... | [
"def",
"hyperparameters",
"(",
"self",
")",
":",
"hyperparameters",
"=",
"super",
"(",
"TensorFlow",
",",
"self",
")",
".",
"hyperparameters",
"(",
")",
"self",
".",
"checkpoint_path",
"=",
"self",
".",
"checkpoint_path",
"or",
"self",
".",
"_default_s3_path",... | Return hyperparameters used by your custom TensorFlow code during model training. | [
"Return",
"hyperparameters",
"used",
"by",
"your",
"custom",
"TensorFlow",
"code",
"during",
"model",
"training",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tensorflow/estimator.py#L442-L472 | train | Return hyperparameters used by your custom TensorFlow code during model training. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/vpc_utils.py | from_dict | def from_dict(vpc_config, do_sanitize=False):
"""
Extracts subnets and security group ids as lists from a VpcConfig dict
Args:
vpc_config (dict): a VpcConfig dict containing 'Subnets' and 'SecurityGroupIds'
do_sanitize (bool): whether to sanitize the VpcConfig dict before extracting values
... | python | def from_dict(vpc_config, do_sanitize=False):
"""
Extracts subnets and security group ids as lists from a VpcConfig dict
Args:
vpc_config (dict): a VpcConfig dict containing 'Subnets' and 'SecurityGroupIds'
do_sanitize (bool): whether to sanitize the VpcConfig dict before extracting values
... | [
"def",
"from_dict",
"(",
"vpc_config",
",",
"do_sanitize",
"=",
"False",
")",
":",
"if",
"do_sanitize",
":",
"vpc_config",
"=",
"sanitize",
"(",
"vpc_config",
")",
"if",
"vpc_config",
"is",
"None",
":",
"return",
"None",
",",
"None",
"return",
"vpc_config",
... | Extracts subnets and security group ids as lists from a VpcConfig dict
Args:
vpc_config (dict): a VpcConfig dict containing 'Subnets' and 'SecurityGroupIds'
do_sanitize (bool): whether to sanitize the VpcConfig dict before extracting values
Returns:
Tuple of lists as (subnets, security... | [
"Extracts",
"subnets",
"and",
"security",
"group",
"ids",
"as",
"lists",
"from",
"a",
"VpcConfig",
"dict"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/vpc_utils.py#L44-L64 | train | Extracts subnets and security group ids as lists from a VpcConfig dict containing SubnetIds and SecurityGroupId keys. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/vpc_utils.py | sanitize | def sanitize(vpc_config):
"""
Checks that an instance of VpcConfig has the expected keys and values, removes unexpected keys,
and raises ValueErrors if any expectations are violated
Args:
vpc_config (dict): a VpcConfig dict containing 'Subnets' and 'SecurityGroupIds'
Returns:
A val... | python | def sanitize(vpc_config):
"""
Checks that an instance of VpcConfig has the expected keys and values, removes unexpected keys,
and raises ValueErrors if any expectations are violated
Args:
vpc_config (dict): a VpcConfig dict containing 'Subnets' and 'SecurityGroupIds'
Returns:
A val... | [
"def",
"sanitize",
"(",
"vpc_config",
")",
":",
"if",
"vpc_config",
"is",
"None",
":",
"return",
"vpc_config",
"elif",
"type",
"(",
"vpc_config",
")",
"is",
"not",
"dict",
":",
"raise",
"ValueError",
"(",
"'vpc_config is not a dict: {}'",
".",
"format",
"(",
... | Checks that an instance of VpcConfig has the expected keys and values, removes unexpected keys,
and raises ValueErrors if any expectations are violated
Args:
vpc_config (dict): a VpcConfig dict containing 'Subnets' and 'SecurityGroupIds'
Returns:
A valid VpcConfig dict containing only 'Sub... | [
"Checks",
"that",
"an",
"instance",
"of",
"VpcConfig",
"has",
"the",
"expected",
"keys",
"and",
"values",
"removes",
"unexpected",
"keys",
"and",
"raises",
"ValueErrors",
"if",
"any",
"expectations",
"are",
"violated"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/vpc_utils.py#L67-L108 | train | Sanitize a VpcConfig dictionary to be used as a base for the cluster tree structure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/amazon/kmeans.py | KMeans.hyperparameters | def hyperparameters(self):
"""Return the SageMaker hyperparameters for training this KMeans Estimator"""
hp_dict = dict(force_dense='True') # KMeans requires this hp to fit on Record objects
hp_dict.update(super(KMeans, self).hyperparameters())
return hp_dict | python | def hyperparameters(self):
"""Return the SageMaker hyperparameters for training this KMeans Estimator"""
hp_dict = dict(force_dense='True') # KMeans requires this hp to fit on Record objects
hp_dict.update(super(KMeans, self).hyperparameters())
return hp_dict | [
"def",
"hyperparameters",
"(",
"self",
")",
":",
"hp_dict",
"=",
"dict",
"(",
"force_dense",
"=",
"'True'",
")",
"# KMeans requires this hp to fit on Record objects",
"hp_dict",
".",
"update",
"(",
"super",
"(",
"KMeans",
",",
"self",
")",
".",
"hyperparameters",
... | Return the SageMaker hyperparameters for training this KMeans Estimator | [
"Return",
"the",
"SageMaker",
"hyperparameters",
"for",
"training",
"this",
"KMeans",
"Estimator"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/kmeans.py#L122-L126 | train | Return the SageMaker hyperparameters for training this KMeans Estimator | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | create_identical_dataset_and_algorithm_tuner | def create_identical_dataset_and_algorithm_tuner(parent, additional_parents=None, sagemaker_session=None):
"""Creates a new tuner by copying the request fields from the provided parent to the new instance of
``HyperparameterTuner`` followed by addition of warm start configuration with the type as
"I... | python | def create_identical_dataset_and_algorithm_tuner(parent, additional_parents=None, sagemaker_session=None):
"""Creates a new tuner by copying the request fields from the provided parent to the new instance of
``HyperparameterTuner`` followed by addition of warm start configuration with the type as
"I... | [
"def",
"create_identical_dataset_and_algorithm_tuner",
"(",
"parent",
",",
"additional_parents",
"=",
"None",
",",
"sagemaker_session",
"=",
"None",
")",
":",
"parent_tuner",
"=",
"HyperparameterTuner",
".",
"attach",
"(",
"tuning_job_name",
"=",
"parent",
",",
"sagem... | Creates a new tuner by copying the request fields from the provided parent to the new instance of
``HyperparameterTuner`` followed by addition of warm start configuration with the type as
"IdenticalDataAndAlgorithm" and ``parents`` as the union of provided list of ``additional_parents`` and the
... | [
"Creates",
"a",
"new",
"tuner",
"by",
"copying",
"the",
"request",
"fields",
"from",
"the",
"provided",
"parent",
"to",
"the",
"new",
"instance",
"of",
"HyperparameterTuner",
"followed",
"by",
"addition",
"of",
"warm",
"start",
"configuration",
"with",
"the",
... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L663-L683 | train | Creates a new HyperparameterTuner object which is a copy of the request fields from the provided parent to the new instance of
IdenticalDataAndAlgorithm and additional_parents. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | create_transfer_learning_tuner | def create_transfer_learning_tuner(parent, additional_parents=None, estimator=None, sagemaker_session=None):
"""Creates a new ``HyperParameterTuner`` by copying the request fields from the provided parent to the new instance
of ``HyperparameterTuner`` followed by addition of warm start configuration with th... | python | def create_transfer_learning_tuner(parent, additional_parents=None, estimator=None, sagemaker_session=None):
"""Creates a new ``HyperParameterTuner`` by copying the request fields from the provided parent to the new instance
of ``HyperparameterTuner`` followed by addition of warm start configuration with th... | [
"def",
"create_transfer_learning_tuner",
"(",
"parent",
",",
"additional_parents",
"=",
"None",
",",
"estimator",
"=",
"None",
",",
"sagemaker_session",
"=",
"None",
")",
":",
"parent_tuner",
"=",
"HyperparameterTuner",
".",
"attach",
"(",
"tuning_job_name",
"=",
... | Creates a new ``HyperParameterTuner`` by copying the request fields from the provided parent to the new instance
of ``HyperparameterTuner`` followed by addition of warm start configuration with the type as "TransferLearning"
and ``parents`` as the union of provided list of ``additional_parents`` and the... | [
"Creates",
"a",
"new",
"HyperParameterTuner",
"by",
"copying",
"the",
"request",
"fields",
"from",
"the",
"provided",
"parent",
"to",
"the",
"new",
"instance",
"of",
"HyperparameterTuner",
"followed",
"by",
"addition",
"of",
"warm",
"start",
"configuration",
"with... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L686-L707 | train | Creates a new instance of HyperparameterTuner that is a copy of the request fields from the provided parent to the new instance of HyperparameterTuner. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | WarmStartConfig.from_job_desc | def from_job_desc(cls, warm_start_config):
"""Creates an instance of ``WarmStartConfig`` class, from warm start configuration response from
DescribeTrainingJob.
Args:
warm_start_config (dict): The expected format of the ``warm_start_config`` contains two first-class
fiel... | python | def from_job_desc(cls, warm_start_config):
"""Creates an instance of ``WarmStartConfig`` class, from warm start configuration response from
DescribeTrainingJob.
Args:
warm_start_config (dict): The expected format of the ``warm_start_config`` contains two first-class
fiel... | [
"def",
"from_job_desc",
"(",
"cls",
",",
"warm_start_config",
")",
":",
"if",
"not",
"warm_start_config",
"or",
"WARM_START_TYPE",
"not",
"in",
"warm_start_config",
"or",
"PARENT_HYPERPARAMETER_TUNING_JOBS",
"not",
"in",
"warm_start_config",
":",
"return",
"None",
"pa... | Creates an instance of ``WarmStartConfig`` class, from warm start configuration response from
DescribeTrainingJob.
Args:
warm_start_config (dict): The expected format of the ``warm_start_config`` contains two first-class
fields:
* "type": Type of warm start tuner... | [
"Creates",
"an",
"instance",
"of",
"WarmStartConfig",
"class",
"from",
"warm",
"start",
"configuration",
"response",
"from",
"DescribeTrainingJob",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L91-L129 | train | Creates an instance of this class from the given warm start configuration response. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | WarmStartConfig.to_input_req | def to_input_req(self):
"""Converts the ``self`` instance to the desired input request format.
Returns:
dict: Containing the "WarmStartType" and "ParentHyperParameterTuningJobs" as the first class fields.
Examples:
>>> warm_start_config = WarmStartConfig(warm_start_type... | python | def to_input_req(self):
"""Converts the ``self`` instance to the desired input request format.
Returns:
dict: Containing the "WarmStartType" and "ParentHyperParameterTuningJobs" as the first class fields.
Examples:
>>> warm_start_config = WarmStartConfig(warm_start_type... | [
"def",
"to_input_req",
"(",
"self",
")",
":",
"return",
"{",
"WARM_START_TYPE",
":",
"self",
".",
"type",
".",
"value",
",",
"PARENT_HYPERPARAMETER_TUNING_JOBS",
":",
"[",
"{",
"HYPERPARAMETER_TUNING_JOB_NAME",
":",
"parent",
"}",
"for",
"parent",
"in",
"self",
... | Converts the ``self`` instance to the desired input request format.
Returns:
dict: Containing the "WarmStartType" and "ParentHyperParameterTuningJobs" as the first class fields.
Examples:
>>> warm_start_config = WarmStartConfig(warm_start_type=WarmStartTypes.TransferLearning,pa... | [
"Converts",
"the",
"self",
"instance",
"to",
"the",
"desired",
"input",
"request",
"format",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L131-L151 | train | Converts the self instance to the desired input request format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.fit | def fit(self, inputs=None, job_name=None, include_cls_metadata=False, **kwargs):
"""Start a hyperparameter tuning job.
Args:
inputs: Information about the training data. Please refer to the ``fit()`` method of
the associated estimator, as this can take any of the following f... | python | def fit(self, inputs=None, job_name=None, include_cls_metadata=False, **kwargs):
"""Start a hyperparameter tuning job.
Args:
inputs: Information about the training data. Please refer to the ``fit()`` method of
the associated estimator, as this can take any of the following f... | [
"def",
"fit",
"(",
"self",
",",
"inputs",
"=",
"None",
",",
"job_name",
"=",
"None",
",",
"include_cls_metadata",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"inputs",
",",
"list",
")",
"or",
"isinstance",
"(",
"inputs",
... | Start a hyperparameter tuning job.
Args:
inputs: Information about the training data. Please refer to the ``fit()`` method of
the associated estimator, as this can take any of the following forms:
* (str) - The S3 location where training data is saved.
... | [
"Start",
"a",
"hyperparameter",
"tuning",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L240-L278 | train | Start a hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.attach | def attach(cls, tuning_job_name, sagemaker_session=None, job_details=None, estimator_cls=None):
"""Attach to an existing hyperparameter tuning job.
Create a HyperparameterTuner bound to an existing hyperparameter tuning job. After attaching, if there exists a
best training job (or any other com... | python | def attach(cls, tuning_job_name, sagemaker_session=None, job_details=None, estimator_cls=None):
"""Attach to an existing hyperparameter tuning job.
Create a HyperparameterTuner bound to an existing hyperparameter tuning job. After attaching, if there exists a
best training job (or any other com... | [
"def",
"attach",
"(",
"cls",
",",
"tuning_job_name",
",",
"sagemaker_session",
"=",
"None",
",",
"job_details",
"=",
"None",
",",
"estimator_cls",
"=",
"None",
")",
":",
"sagemaker_session",
"=",
"sagemaker_session",
"or",
"Session",
"(",
")",
"if",
"job_detai... | Attach to an existing hyperparameter tuning job.
Create a HyperparameterTuner bound to an existing hyperparameter tuning job. After attaching, if there exists a
best training job (or any other completed training job), that can be deployed to create
an Amazon SageMaker Endpoint and return a ``Pr... | [
"Attach",
"to",
"an",
"existing",
"hyperparameter",
"tuning",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L281-L325 | train | Attach to an existing hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.deploy | def deploy(self, initial_instance_count, instance_type, accelerator_type=None, endpoint_name=None, **kwargs):
"""Deploy the best trained or user specified model to an Amazon SageMaker endpoint and return a
``sagemaker.RealTimePredictor`` object.
For more information: http://docs.aws.amazon.com/... | python | def deploy(self, initial_instance_count, instance_type, accelerator_type=None, endpoint_name=None, **kwargs):
"""Deploy the best trained or user specified model to an Amazon SageMaker endpoint and return a
``sagemaker.RealTimePredictor`` object.
For more information: http://docs.aws.amazon.com/... | [
"def",
"deploy",
"(",
"self",
",",
"initial_instance_count",
",",
"instance_type",
",",
"accelerator_type",
"=",
"None",
",",
"endpoint_name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"endpoint_name",
"=",
"endpoint_name",
"or",
"self",
".",
"best_train... | Deploy the best trained or user specified model to an Amazon SageMaker endpoint and return a
``sagemaker.RealTimePredictor`` object.
For more information: http://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works-training.html
Args:
initial_instance_count (int): Minimum number of... | [
"Deploy",
"the",
"best",
"trained",
"or",
"user",
"specified",
"model",
"to",
"an",
"Amazon",
"SageMaker",
"endpoint",
"and",
"return",
"a",
"sagemaker",
".",
"RealTimePredictor",
"object",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L327-L355 | train | Deploy the best trained or user specified model to an Amazon SageMaker endpoint and return a SageMakerRealTimePredictor object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.best_training_job | def best_training_job(self):
"""Return name of the best training job for the latest hyperparameter tuning job.
Raises:
Exception: If there is no best training job available for the hyperparameter tuning job.
"""
self._ensure_last_tuning_job()
tuning_job_describe_res... | python | def best_training_job(self):
"""Return name of the best training job for the latest hyperparameter tuning job.
Raises:
Exception: If there is no best training job available for the hyperparameter tuning job.
"""
self._ensure_last_tuning_job()
tuning_job_describe_res... | [
"def",
"best_training_job",
"(",
"self",
")",
":",
"self",
".",
"_ensure_last_tuning_job",
"(",
")",
"tuning_job_describe_result",
"=",
"self",
".",
"estimator",
".",
"sagemaker_session",
".",
"sagemaker_client",
".",
"describe_hyper_parameter_tuning_job",
"(",
"HyperPa... | Return name of the best training job for the latest hyperparameter tuning job.
Raises:
Exception: If there is no best training job available for the hyperparameter tuning job. | [
"Return",
"name",
"of",
"the",
"best",
"training",
"job",
"for",
"the",
"latest",
"hyperparameter",
"tuning",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L369-L384 | train | Return name of the best training job for the latest hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.delete_endpoint | def delete_endpoint(self, endpoint_name=None):
"""Delete an Amazon SageMaker endpoint.
If an endpoint name is not specified, this defaults to looking for an endpoint that
shares a name with the best training job for deletion.
Args:
endpoint_name (str): Name of the endpoint ... | python | def delete_endpoint(self, endpoint_name=None):
"""Delete an Amazon SageMaker endpoint.
If an endpoint name is not specified, this defaults to looking for an endpoint that
shares a name with the best training job for deletion.
Args:
endpoint_name (str): Name of the endpoint ... | [
"def",
"delete_endpoint",
"(",
"self",
",",
"endpoint_name",
"=",
"None",
")",
":",
"endpoint_name",
"=",
"endpoint_name",
"or",
"self",
".",
"best_training_job",
"(",
")",
"self",
".",
"sagemaker_session",
".",
"delete_endpoint",
"(",
"endpoint_name",
")"
] | Delete an Amazon SageMaker endpoint.
If an endpoint name is not specified, this defaults to looking for an endpoint that
shares a name with the best training job for deletion.
Args:
endpoint_name (str): Name of the endpoint to delete | [
"Delete",
"an",
"Amazon",
"SageMaker",
"endpoint",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L386-L396 | train | Delete an Amazon SageMaker endpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.hyperparameter_ranges | def hyperparameter_ranges(self):
"""Return the hyperparameter ranges in a dictionary to be used as part of a request for creating a
hyperparameter tuning job.
"""
hyperparameter_ranges = dict()
for range_type in ParameterRange.__all_types__:
parameter_ranges = []
... | python | def hyperparameter_ranges(self):
"""Return the hyperparameter ranges in a dictionary to be used as part of a request for creating a
hyperparameter tuning job.
"""
hyperparameter_ranges = dict()
for range_type in ParameterRange.__all_types__:
parameter_ranges = []
... | [
"def",
"hyperparameter_ranges",
"(",
"self",
")",
":",
"hyperparameter_ranges",
"=",
"dict",
"(",
")",
"for",
"range_type",
"in",
"ParameterRange",
".",
"__all_types__",
":",
"parameter_ranges",
"=",
"[",
"]",
"for",
"parameter_name",
",",
"parameter",
"in",
"se... | Return the hyperparameter ranges in a dictionary to be used as part of a request for creating a
hyperparameter tuning job. | [
"Return",
"the",
"hyperparameter",
"ranges",
"in",
"a",
"dictionary",
"to",
"be",
"used",
"as",
"part",
"of",
"a",
"request",
"for",
"creating",
"a",
"hyperparameter",
"tuning",
"job",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L473-L489 | train | Return the hyperparameter ranges in a dictionary to be used as part of a request for creating a hyperparameter tuning job. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.transfer_learning_tuner | def transfer_learning_tuner(self, additional_parents=None, estimator=None):
"""Creates a new ``HyperparameterTuner`` by copying the request fields from the provided parent to the new
instance of ``HyperparameterTuner``. Followed by addition of warm start configuration with the type as
"TransferL... | python | def transfer_learning_tuner(self, additional_parents=None, estimator=None):
"""Creates a new ``HyperparameterTuner`` by copying the request fields from the provided parent to the new
instance of ``HyperparameterTuner``. Followed by addition of warm start configuration with the type as
"TransferL... | [
"def",
"transfer_learning_tuner",
"(",
"self",
",",
"additional_parents",
"=",
"None",
",",
"estimator",
"=",
"None",
")",
":",
"return",
"self",
".",
"_create_warm_start_tuner",
"(",
"additional_parents",
"=",
"additional_parents",
",",
"warm_start_type",
"=",
"War... | Creates a new ``HyperparameterTuner`` by copying the request fields from the provided parent to the new
instance of ``HyperparameterTuner``. Followed by addition of warm start configuration with the type as
"TransferLearning" and parents as the union of provided list of ``additional_parents`` and the ``... | [
"Creates",
"a",
"new",
"HyperparameterTuner",
"by",
"copying",
"the",
"request",
"fields",
"from",
"the",
"provided",
"parent",
"to",
"the",
"new",
"instance",
"of",
"HyperparameterTuner",
".",
"Followed",
"by",
"addition",
"of",
"warm",
"start",
"configuration",
... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L532-L557 | train | Creates a new instance of a new HyperparameterTuner that will be used to create a new TransferLearningTuner instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner.identical_dataset_and_algorithm_tuner | def identical_dataset_and_algorithm_tuner(self, additional_parents=None):
"""Creates a new ``HyperparameterTuner`` by copying the request fields from the provided parent to the new
instance of ``HyperparameterTuner``. Followed by addition of warm start configuration with the type as
"IdenticalDa... | python | def identical_dataset_and_algorithm_tuner(self, additional_parents=None):
"""Creates a new ``HyperparameterTuner`` by copying the request fields from the provided parent to the new
instance of ``HyperparameterTuner``. Followed by addition of warm start configuration with the type as
"IdenticalDa... | [
"def",
"identical_dataset_and_algorithm_tuner",
"(",
"self",
",",
"additional_parents",
"=",
"None",
")",
":",
"return",
"self",
".",
"_create_warm_start_tuner",
"(",
"additional_parents",
"=",
"additional_parents",
",",
"warm_start_type",
"=",
"WarmStartTypes",
".",
"I... | Creates a new ``HyperparameterTuner`` by copying the request fields from the provided parent to the new
instance of ``HyperparameterTuner``. Followed by addition of warm start configuration with the type as
"IdenticalDataAndAlgorithm" and parents as the union of provided list of ``additional_parents`` a... | [
"Creates",
"a",
"new",
"HyperparameterTuner",
"by",
"copying",
"the",
"request",
"fields",
"from",
"the",
"provided",
"parent",
"to",
"the",
"new",
"instance",
"of",
"HyperparameterTuner",
".",
"Followed",
"by",
"addition",
"of",
"warm",
"start",
"configuration",
... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L559-L581 | train | Creates a new HyperparameterTuner instance which can be used to launch an identical dataset and algorithm tuner. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | HyperparameterTuner._create_warm_start_tuner | def _create_warm_start_tuner(self, additional_parents, warm_start_type, estimator=None):
"""Creates a new ``HyperparameterTuner`` with ``WarmStartConfig``, where type will be equal to
``warm_start_type`` and``parents`` would be equal to union of ``additional_parents`` and self.
Args:
... | python | def _create_warm_start_tuner(self, additional_parents, warm_start_type, estimator=None):
"""Creates a new ``HyperparameterTuner`` with ``WarmStartConfig``, where type will be equal to
``warm_start_type`` and``parents`` would be equal to union of ``additional_parents`` and self.
Args:
... | [
"def",
"_create_warm_start_tuner",
"(",
"self",
",",
"additional_parents",
",",
"warm_start_type",
",",
"estimator",
"=",
"None",
")",
":",
"all_parents",
"=",
"{",
"self",
".",
"latest_tuning_job",
".",
"name",
"}",
"if",
"additional_parents",
":",
"all_parents",... | Creates a new ``HyperparameterTuner`` with ``WarmStartConfig``, where type will be equal to
``warm_start_type`` and``parents`` would be equal to union of ``additional_parents`` and self.
Args:
additional_parents (set{str}): Additional parents along with self, to be used for warm starting.
... | [
"Creates",
"a",
"new",
"HyperparameterTuner",
"with",
"WarmStartConfig",
"where",
"type",
"will",
"be",
"equal",
"to",
"warm_start_type",
"and",
"parents",
"would",
"be",
"equal",
"to",
"union",
"of",
"additional_parents",
"and",
"self",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L583-L606 | train | Create a new instance of type HyperparameterTuner with the request fields copied from self along with the warm start configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/tuner.py | _TuningJob.start_new | def start_new(cls, tuner, inputs):
"""Create a new Amazon SageMaker hyperparameter tuning job from the HyperparameterTuner.
Args:
tuner (sagemaker.tuner.HyperparameterTuner): HyperparameterTuner object created by the user.
inputs (str): Parameters used when called :meth:`~sagema... | python | def start_new(cls, tuner, inputs):
"""Create a new Amazon SageMaker hyperparameter tuning job from the HyperparameterTuner.
Args:
tuner (sagemaker.tuner.HyperparameterTuner): HyperparameterTuner object created by the user.
inputs (str): Parameters used when called :meth:`~sagema... | [
"def",
"start_new",
"(",
"cls",
",",
"tuner",
",",
"inputs",
")",
":",
"config",
"=",
"_Job",
".",
"_load_config",
"(",
"inputs",
",",
"tuner",
".",
"estimator",
")",
"warm_start_config_req",
"=",
"None",
"if",
"tuner",
".",
"warm_start_config",
":",
"warm... | Create a new Amazon SageMaker hyperparameter tuning job from the HyperparameterTuner.
Args:
tuner (sagemaker.tuner.HyperparameterTuner): HyperparameterTuner object created by the user.
inputs (str): Parameters used when called :meth:`~sagemaker.estimator.EstimatorBase.fit`.
Ret... | [
"Create",
"a",
"new",
"Amazon",
"SageMaker",
"hyperparameter",
"tuning",
"job",
"from",
"the",
"HyperparameterTuner",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/tuner.py#L611-L654 | train | Create a new Amazon SageMaker hyperparameter tuning job from the HyperparameterTuner. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/logs.py | some | def some(arr):
"""Return True iff there is an element, a, of arr such that a is not None"""
return functools.reduce(lambda x, y: x or (y is not None), arr, False) | python | def some(arr):
"""Return True iff there is an element, a, of arr such that a is not None"""
return functools.reduce(lambda x, y: x or (y is not None), arr, False) | [
"def",
"some",
"(",
"arr",
")",
":",
"return",
"functools",
".",
"reduce",
"(",
"lambda",
"x",
",",
"y",
":",
"x",
"or",
"(",
"y",
"is",
"not",
"None",
")",
",",
"arr",
",",
"False",
")"
] | Return True iff there is an element, a, of arr such that a is not None | [
"Return",
"True",
"iff",
"there",
"is",
"an",
"element",
"a",
"of",
"arr",
"such",
"that",
"a",
"is",
"not",
"None"
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/logs.py#L70-L72 | train | Return True iff there is an element a of arr such that a is not None | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/logs.py | multi_stream_iter | def multi_stream_iter(client, log_group, streams, positions=None):
"""Iterate over the available events coming from a set of log streams in a single log group
interleaving the events from each stream so they're yielded in timestamp order.
Args:
client (boto3 client): The boto client for logs.
... | python | def multi_stream_iter(client, log_group, streams, positions=None):
"""Iterate over the available events coming from a set of log streams in a single log group
interleaving the events from each stream so they're yielded in timestamp order.
Args:
client (boto3 client): The boto client for logs.
... | [
"def",
"multi_stream_iter",
"(",
"client",
",",
"log_group",
",",
"streams",
",",
"positions",
"=",
"None",
")",
":",
"positions",
"=",
"positions",
"or",
"{",
"s",
":",
"Position",
"(",
"timestamp",
"=",
"0",
",",
"skip",
"=",
"0",
")",
"for",
"s",
... | Iterate over the available events coming from a set of log streams in a single log group
interleaving the events from each stream so they're yielded in timestamp order.
Args:
client (boto3 client): The boto client for logs.
log_group (str): The name of the log group.
streams (list of st... | [
"Iterate",
"over",
"the",
"available",
"events",
"coming",
"from",
"a",
"set",
"of",
"log",
"streams",
"in",
"a",
"single",
"log",
"group",
"interleaving",
"the",
"events",
"from",
"each",
"stream",
"so",
"they",
"re",
"yielded",
"in",
"timestamp",
"order",
... | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/logs.py#L80-L113 | train | Iterate over the available events coming from a single log group in a single log group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/logs.py | log_stream | def log_stream(client, log_group, stream_name, start_time=0, skip=0):
"""A generator for log items in a single stream. This will yield all the
items that are available at the current moment.
Args:
client (boto3.CloudWatchLogs.Client): The Boto client for CloudWatch logs.
log_group (str): Th... | python | def log_stream(client, log_group, stream_name, start_time=0, skip=0):
"""A generator for log items in a single stream. This will yield all the
items that are available at the current moment.
Args:
client (boto3.CloudWatchLogs.Client): The Boto client for CloudWatch logs.
log_group (str): Th... | [
"def",
"log_stream",
"(",
"client",
",",
"log_group",
",",
"stream_name",
",",
"start_time",
"=",
"0",
",",
"skip",
"=",
"0",
")",
":",
"next_token",
"=",
"None",
"event_count",
"=",
"1",
"while",
"event_count",
">",
"0",
":",
"if",
"next_token",
"is",
... | A generator for log items in a single stream. This will yield all the
items that are available at the current moment.
Args:
client (boto3.CloudWatchLogs.Client): The Boto client for CloudWatch logs.
log_group (str): The name of the log group.
stream_name (str): The name of the specific ... | [
"A",
"generator",
"for",
"log",
"items",
"in",
"a",
"single",
"stream",
".",
"This",
"will",
"yield",
"all",
"the",
"items",
"that",
"are",
"available",
"at",
"the",
"current",
"moment",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/logs.py#L116-L156 | train | A generator for log items in a single stream. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/rl/estimator.py | RLEstimator.create_model | def create_model(self, role=None, vpc_config_override=VPC_CONFIG_DEFAULT,
entry_point=None, source_dir=None, dependencies=None):
"""Create a SageMaker ``RLEstimatorModel`` object that can be deployed to an Endpoint.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role AR... | python | def create_model(self, role=None, vpc_config_override=VPC_CONFIG_DEFAULT,
entry_point=None, source_dir=None, dependencies=None):
"""Create a SageMaker ``RLEstimatorModel`` object that can be deployed to an Endpoint.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role AR... | [
"def",
"create_model",
"(",
"self",
",",
"role",
"=",
"None",
",",
"vpc_config_override",
"=",
"VPC_CONFIG_DEFAULT",
",",
"entry_point",
"=",
"None",
",",
"source_dir",
"=",
"None",
",",
"dependencies",
"=",
"None",
")",
":",
"base_args",
"=",
"dict",
"(",
... | Create a SageMaker ``RLEstimatorModel`` object that can be deployed to an Endpoint.
Args:
role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``, which is also used
during transform jobs. If not specified, the role from the Estimator will be used.
vpc_config... | [
"Create",
"a",
"SageMaker",
"RLEstimatorModel",
"object",
"that",
"can",
"be",
"deployed",
"to",
"an",
"Endpoint",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/rl/estimator.py#L145-L219 | train | Create a SageMaker model object that can be deployed to an Endpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
aws/sagemaker-python-sdk | src/sagemaker/rl/estimator.py | RLEstimator.train_image | def train_image(self):
"""Return the Docker image to use for training.
The :meth:`~sagemaker.estimator.EstimatorBase.fit` method, which does the model training,
calls this method to find the image to use for model training.
Returns:
str: The URI of the Docker image.
... | python | def train_image(self):
"""Return the Docker image to use for training.
The :meth:`~sagemaker.estimator.EstimatorBase.fit` method, which does the model training,
calls this method to find the image to use for model training.
Returns:
str: The URI of the Docker image.
... | [
"def",
"train_image",
"(",
"self",
")",
":",
"if",
"self",
".",
"image_name",
":",
"return",
"self",
".",
"image_name",
"else",
":",
"return",
"fw_utils",
".",
"create_image_uri",
"(",
"self",
".",
"sagemaker_session",
".",
"boto_region_name",
",",
"self",
"... | Return the Docker image to use for training.
The :meth:`~sagemaker.estimator.EstimatorBase.fit` method, which does the model training,
calls this method to find the image to use for model training.
Returns:
str: The URI of the Docker image. | [
"Return",
"the",
"Docker",
"image",
"to",
"use",
"for",
"training",
"."
] | a9e724c7d3f5572b68c3903548c792a59d99799a | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/rl/estimator.py#L221-L237 | train | Returns the URI of the Docker image to use for training. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.