@@ -35,11 +35,11 @@ def __init__(
3535 self ,
3636 algorithm_arn ,
3737 role ,
38- train_instance_count ,
39- train_instance_type ,
40- train_volume_size = 30 ,
41- train_volume_kms_key = None ,
42- train_max_run = 24 * 60 * 60 ,
38+ instance_count ,
39+ instance_type ,
40+ volume_size = 30 ,
41+ volume_kms_key = None ,
42+ max_run = 24 * 60 * 60 ,
4343 input_mode = "File" ,
4444 output_path = None ,
4545 output_kms_key = None ,
@@ -65,15 +65,15 @@ def __init__(
6565 access training data and model artifacts. After the endpoint
6666 is created, the inference code might use the IAM role, if it
6767 needs to access an AWS resource.
68- train_instance_count (int): Number of Amazon EC2 instances to
69- use for training. train_instance_type (str): Type of EC2
68+ instance_count (int): Number of Amazon EC2 instances to
69+ use for training. instance_type (str): Type of EC2
7070 instance to use for training, for example, 'ml.c4.xlarge'.
71- train_volume_size (int): Size in GB of the EBS volume to use for
71+ volume_size (int): Size in GB of the EBS volume to use for
7272 storing input data during training (default: 30). Must be large enough to store
7373 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
74+ volume_kms_key (str): Optional. KMS key ID for encrypting EBS volume attached
7575 to the training instance (default: None).
76- train_max_run (int): Timeout in seconds for training (default: 24 * 60 * 60).
76+ max_run (int): Timeout in seconds for training (default: 24 * 60 * 60).
7777 After this amount of time Amazon SageMaker terminates the
7878 job regardless of its current status.
7979 input_mode (str): The input mode that the algorithm supports
@@ -131,11 +131,11 @@ def __init__(
131131 self .algorithm_arn = algorithm_arn
132132 super (AlgorithmEstimator , self ).__init__ (
133133 role ,
134- train_instance_count ,
135- train_instance_type ,
136- train_volume_size ,
137- train_volume_kms_key ,
138- train_max_run ,
134+ instance_count ,
135+ instance_type ,
136+ volume_size ,
137+ volume_kms_key ,
138+ max_run ,
139139 input_mode ,
140140 output_path ,
141141 output_kms_key ,
@@ -167,30 +167,30 @@ def validate_train_spec(self):
167167
168168 # Check that the input mode provided is compatible with the training input modes for the
169169 # algorithm.
170- train_input_modes = self ._algorithm_training_input_modes (train_spec ["TrainingChannels" ])
171- if self .input_mode not in train_input_modes :
170+ input_modes = self ._algorithm_training_input_modes (train_spec ["TrainingChannels" ])
171+ if self .input_mode not in input_modes :
172172 raise ValueError (
173173 "Invalid input mode: %s. %s only supports: %s"
174- % (self .input_mode , algorithm_name , train_input_modes )
174+ % (self .input_mode , algorithm_name , input_modes )
175175 )
176176
177177 # Check that the training instance type is compatible with the algorithm.
178178 supported_instances = train_spec ["SupportedTrainingInstanceTypes" ]
179- if self .train_instance_type not in supported_instances :
179+ if self .instance_type not in supported_instances :
180180 raise ValueError (
181- "Invalid train_instance_type : %s. %s supports the following instance types: %s"
182- % (self .train_instance_type , algorithm_name , supported_instances )
181+ "Invalid instance_type : %s. %s supports the following instance types: %s"
182+ % (self .instance_type , algorithm_name , supported_instances )
183183 )
184184
185185 # Verify if distributed training is supported by the algorithm
186186 if (
187- self .train_instance_count > 1
187+ self .instance_count > 1
188188 and "SupportsDistributedTraining" in train_spec
189189 and not train_spec ["SupportsDistributedTraining" ]
190190 ):
191191 raise ValueError (
192192 "Distributed training is not supported by %s. "
193- "Please set train_instance_count =1" % algorithm_name
193+ "Please set instance_count =1" % algorithm_name
194194 )
195195
196196 def set_hyperparameters (self , ** kwargs ):
0 commit comments