|
1 |
| -# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 1 | +# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
2 | 2 | #
|
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You
|
4 | 4 | # may not use this file except in compliance with the License. A copy of
|
@@ -59,110 +59,72 @@ def __init__(
|
59 | 59 |
|
60 | 60 | Args:
|
61 | 61 | algorithm_arn (str): algorithm arn used for training. Can be just the name if your
|
62 |
| - account owns the algorithm. |
63 |
| -
|
64 |
| - role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker |
65 |
| - training jobs and APIsthat create Amazon SageMaker endpoints use this role to |
66 |
| - access training data and model artifacts. After the endpoint |
67 |
| - is created, the inference code might use the IAM role, if it |
68 |
| - needs to access an AWS resource. |
69 |
| -
|
70 |
| - train_instance_count (int): Number of Amazon EC2 instances to |
| 62 | + account owns the algorithm. |
| 63 | + role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker |
| 64 | + training jobs and APIsthat create Amazon SageMaker endpoints use this role to |
| 65 | + access training data and model artifacts. After the endpoint |
| 66 | + is created, the inference code might use the IAM role, if it |
| 67 | + needs to access an AWS resource. |
| 68 | + train_instance_count (int): Number of Amazon EC2 instances to |
71 | 69 | use for training. train_instance_type (str): Type of EC2
|
72 | 70 | instance to use for training, for example, 'ml.c4.xlarge'.
|
73 |
| - train_volume_size (int): Size in GB of the EBS volume to use for |
74 |
| - storing input data |
75 |
| -
|
76 |
| - during training (default: 30). Must be large enough to store |
77 |
| - training data if File Mode is used (which is the default). |
78 |
| -
|
79 |
| - train_volume_kms_key (str): Optional. KMS key ID for encrypting EBS volume attached |
80 |
| - to the training instance (default: None). |
81 |
| -
|
82 |
| - train_max_run (int): Timeout in seconds for training (default: 24 * 60 * 60). |
83 |
| - After this amount of time Amazon SageMaker terminates the |
84 |
| - job regardless of its current status. |
85 |
| -
|
86 |
| - input_mode (str): The input mode that the algorithm supports |
87 |
| - (default: 'File'). Valid modes: |
88 |
| -
|
89 |
| - * 'File' - Amazon SageMaker copies the training dataset from |
90 |
| - the S3 location to a local directory. |
91 |
| - * 'Pipe' - Amazon SageMaker streams data directly from S3 to |
92 |
| - the container via a Unix-named pipe. |
93 |
| -
|
94 |
| - This argument can be overriden on a per-channel basis using |
95 |
| - ``sagemaker.session.s3_input.input_mode``. |
96 |
| -
|
97 |
| - output_path (str): S3 location for saving the training result (model artifacts and |
98 |
| - output files). If not specified, results are stored to a default bucket. If |
99 |
| - the bucket with the specific name does not exist, the |
100 |
| - estimator creates the bucket during the |
101 |
| - :meth:`~sagemaker.estimator.EstimatorBase.fit` method |
102 |
| - execution. |
103 |
| -
|
104 |
| - output_kms_key (str): Optional. KMS key ID for encrypting the |
| 71 | + train_volume_size (int): Size in GB of the EBS volume to use for |
| 72 | + storing input data during training (default: 30). Must be large enough to store |
| 73 | + training data if File Mode is used (which is the default). |
| 74 | + train_volume_kms_key (str): Optional. KMS key ID for encrypting EBS volume attached |
| 75 | + to the training instance (default: None). |
| 76 | + train_max_run (int): Timeout in seconds for training (default: 24 * 60 * 60). |
| 77 | + After this amount of time Amazon SageMaker terminates the |
| 78 | + job regardless of its current status. |
| 79 | + input_mode (str): The input mode that the algorithm supports |
| 80 | + (default: 'File'). Valid modes: |
| 81 | +
|
| 82 | + * 'File' - Amazon SageMaker copies the training dataset from |
| 83 | + the S3 location to a local directory. |
| 84 | + * 'Pipe' - Amazon SageMaker streams data directly from S3 to |
| 85 | + the container via a Unix-named pipe. |
| 86 | +
|
| 87 | + This argument can be overriden on a per-channel basis using |
| 88 | + ``sagemaker.session.s3_input.input_mode``. |
| 89 | +
|
| 90 | + output_path (str): S3 location for saving the training result (model artifacts and |
| 91 | + output files). If not specified, results are stored to a default bucket. If |
| 92 | + the bucket with the specific name does not exist, the |
| 93 | + estimator creates the bucket during the |
| 94 | + :meth:`~sagemaker.estimator.EstimatorBase.fit` method |
| 95 | + execution. |
| 96 | + output_kms_key (str): Optional. KMS key ID for encrypting the |
105 | 97 | training output (default: None). base_job_name (str): Prefix for
|
106 | 98 | training job name when the
|
107 | 99 | :meth:`~sagemaker.estimator.EstimatorBase.fit`
|
108 |
| -
|
109 |
| - method launches. If not specified, the estimator generates a |
110 |
| - default job name, based on the training image name and |
111 |
| - current timestamp. |
112 |
| -
|
113 |
| - sagemaker_session (sagemaker.session.Session): Session object which manages |
114 |
| - interactions with Amazon SageMaker APIs and any other AWS services needed. If |
115 |
| - not specified, the estimator creates one using the default |
116 |
| - AWS configuration chain. |
117 |
| -
|
118 |
| - tags (list[dict]): List of tags for labeling a training job. For more, see |
119 |
| - https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html. |
120 |
| -
|
121 |
| - subnets (list[str]): List of subnet ids. If not specified |
| 100 | + method launches. If not specified, the estimator generates a |
| 101 | + default job name, based on the training image name and |
| 102 | + current timestamp. |
| 103 | + sagemaker_session (sagemaker.session.Session): Session object which manages |
| 104 | + interactions with Amazon SageMaker APIs and any other AWS services needed. If |
| 105 | + not specified, the estimator creates one using the default |
| 106 | + AWS configuration chain. |
| 107 | + tags (list[dict]): List of tags for labeling a training job. For more, see |
| 108 | + https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html. |
| 109 | + subnets (list[str]): List of subnet ids. If not specified |
122 | 110 | training job will be created without VPC config.
|
123 | 111 | security_group_ids (list[str]): List of security group ids. If
|
124 |
| - not specified training job will be created |
125 |
| -
|
126 |
| - without VPC config. |
127 |
| -
|
128 |
| - model_uri (str): URI where a pre-trained model is stored, either locally or in S3 |
129 |
| - (default: None). If specified, the estimator will create a channel pointing to |
130 |
| - the model so the training job can download it. This model |
131 |
| - can be a 'model.tar.gz' from a previous training job, or |
132 |
| - other artifacts coming from a different source. |
133 |
| - More information: |
134 |
| - https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization |
135 |
| -
|
136 |
| - model_channel_name (str): Name of the channel where 'model_uri' |
| 112 | + not specified training job will be created without VPC config. |
| 113 | + model_uri (str): URI where a pre-trained model is stored, either locally or in S3 |
| 114 | + (default: None). If specified, the estimator will create a channel pointing to |
| 115 | + the model so the training job can download it. This model |
| 116 | + can be a 'model.tar.gz' from a previous training job, or |
| 117 | + other artifacts coming from a different source. |
| 118 | + More information: |
| 119 | + https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization |
| 120 | + model_channel_name (str): Name of the channel where 'model_uri' |
137 | 121 | will be downloaded (default: 'model'). metric_definitions
|
138 | 122 | (list[dict]): A list of dictionaries that defines the metric(s)
|
139 |
| - used to evaluate the |
140 |
| -
|
141 |
| - training jobs. Each dictionary contains two keys: 'Name' for |
142 |
| - the name of the metric, and 'Regex' for the regular |
143 |
| - expression used to extract the metric from the logs. |
144 |
| -
|
145 |
| - encrypt_inter_container_traffic (bool): Specifies whether traffic between training |
146 |
| - containers is encrypted for the training job (default: ``False``). |
147 |
| - role: |
148 |
| - train_instance_count: |
149 |
| - train_instance_type: |
150 |
| - train_volume_size: |
151 |
| - train_volume_kms_key: |
152 |
| - train_max_run: |
153 |
| - input_mode: |
154 |
| - output_path: |
155 |
| - output_kms_key: |
156 |
| - base_job_name: |
157 |
| - sagemaker_session: |
158 |
| - hyperparameters: |
159 |
| - tags: |
160 |
| - subnets: |
161 |
| - security_group_ids: |
162 |
| - model_uri: |
163 |
| - model_channel_name: |
164 |
| - metric_definitions: |
165 |
| - encrypt_inter_container_traffic: |
| 123 | + used to evaluate the training jobs. Each dictionary contains two keys: 'Name' for |
| 124 | + the name of the metric, and 'Regex' for the regular |
| 125 | + expression used to extract the metric from the logs. |
| 126 | + encrypt_inter_container_traffic (bool): Specifies whether traffic between training |
| 127 | + containers is encrypted for the training job (default: ``False``). |
166 | 128 | **kwargs: Additional kwargs. This is unused. It's only added for AlgorithmEstimator
|
167 | 129 | to ignore the irrelevant arguments.
|
168 | 130 | """
|
@@ -309,7 +271,13 @@ def create_model(
|
309 | 271 | the model. Default: use subnets and security groups from this Estimator.
|
310 | 272 | * 'Subnets' (list[str]): List of subnet ids.
|
311 | 273 | * 'SecurityGroupIds' (list[str]): List of security group ids.
|
312 |
| - **kwargs: |
| 274 | + **kwargs: Additional arguments for creating a :class:`~sagemaker.model.ModelPackage`. |
| 275 | +
|
| 276 | + .. tip:: |
| 277 | +
|
| 278 | + You can find additional parameters for using this method at |
| 279 | + :class:`~sagemaker.model.ModelPackage` and |
| 280 | + :class:`~sagemaker.model.Model`. |
313 | 281 |
|
314 | 282 | Returns:
|
315 | 283 | a Model ready for deployment.
|
|
0 commit comments