blib/lib/Paws/SageMaker/CreateHyperParameterTuningJob.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 17 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::SageMaker::CreateHyperParameterTuningJob;
3 use Moose;
4 has HyperParameterTuningJobConfig => (is => 'ro', isa => 'Paws::SageMaker::HyperParameterTuningJobConfig', required => 1);
5 has HyperParameterTuningJobName => (is => 'ro', isa => 'Str', required => 1);
6 has Tags => (is => 'ro', isa => 'ArrayRef[Paws::SageMaker::Tag]');
7 has TrainingJobDefinition => (is => 'ro', isa => 'Paws::SageMaker::HyperParameterTrainingJobDefinition');
8 has TrainingJobDefinitions => (is => 'ro', isa => 'ArrayRef[Paws::SageMaker::HyperParameterTrainingJobDefinition]');
9 has WarmStartConfig => (is => 'ro', isa => 'Paws::SageMaker::HyperParameterTuningJobWarmStartConfig');
10  
11 use MooseX::ClassAttribute;
12  
13 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateHyperParameterTuningJob');
14 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SageMaker::CreateHyperParameterTuningJobResponse');
15 class_has _result_key => (isa => 'Str', is => 'ro');
16 1;
17  
18 ### main pod documentation begin ###
19  
20 =head1 NAME
21  
22 Paws::SageMaker::CreateHyperParameterTuningJob - Arguments for method CreateHyperParameterTuningJob on L<Paws::SageMaker>
23  
24 =head1 DESCRIPTION
25  
26 This class represents the parameters used for calling the method CreateHyperParameterTuningJob on the
27 L<Amazon SageMaker Service|Paws::SageMaker> service. Use the attributes of this class
28 as arguments to method CreateHyperParameterTuningJob.
29  
30 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateHyperParameterTuningJob.
31  
32 =head1 SYNOPSIS
33  
34 my $api.sagemaker = Paws->service('SageMaker');
35 my $CreateHyperParameterTuningJobResponse =
36 $api . sagemaker->CreateHyperParameterTuningJob(
37 HyperParameterTuningJobConfig => {
38 ResourceLimits => {
39 MaxNumberOfTrainingJobs => 1, # min: 1
40 MaxParallelTrainingJobs => 1, # min: 1
41  
42 },
43 Strategy => 'Bayesian', # values: Bayesian, Random
44 HyperParameterTuningJobObjective => {
45 MetricName => 'MyMetricName', # min: 1, max: 255
46 Type => 'Maximize', # values: Maximize, Minimize
47  
48 }, # OPTIONAL
49 ParameterRanges => {
50 CategoricalParameterRanges => [
51 {
52 Name => 'MyParameterKey', # max: 256
53 Values => [
54 'MyParameterValue', ... # max: 256
55 ], # min: 1, max: 20
56  
57 },
58 ...
59 ], # max: 20; OPTIONAL
60 ContinuousParameterRanges => [
61 {
62 MaxValue => 'MyParameterValue', # max: 256
63 MinValue => 'MyParameterValue', # max: 256
64 Name => 'MyParameterKey', # max: 256
65 ScalingType => 'Auto'
66 , # values: Auto, Linear, Logarithmic, ReverseLogarithmic; OPTIONAL
67 },
68 ...
69 ], # max: 20; OPTIONAL
70 IntegerParameterRanges => [
71 {
72 MaxValue => 'MyParameterValue', # max: 256
73 MinValue => 'MyParameterValue', # max: 256
74 Name => 'MyParameterKey', # max: 256
75 ScalingType => 'Auto'
76 , # values: Auto, Linear, Logarithmic, ReverseLogarithmic; OPTIONAL
77 },
78 ...
79 ], # max: 20; OPTIONAL
80 }, # OPTIONAL
81 TrainingJobEarlyStoppingType => 'Off', # values: Off, Auto; OPTIONAL
82 TuningJobCompletionCriteria => {
83 TargetObjectiveMetricValue => 1.0,
84  
85 }, # OPTIONAL
86 },
87 HyperParameterTuningJobName => 'MyHyperParameterTuningJobName',
88 Tags => [
89 {
90 Key => 'MyTagKey', # min: 1, max: 128
91 Value => 'MyTagValue', # max: 256
92  
93 },
94 ...
95 ], # OPTIONAL
96 TrainingJobDefinition => {
97 AlgorithmSpecification => {
98 TrainingInputMode => 'Pipe', # values: Pipe, File
99 AlgorithmName => 'MyArnOrName', # min: 1, max: 170; OPTIONAL
100 MetricDefinitions => [
101 {
102 Name => 'MyMetricName', # min: 1, max: 255
103 Regex => 'MyMetricRegex', # min: 1, max: 500
104  
105 },
106 ...
107 ], # max: 40; OPTIONAL
108 TrainingImage => 'MyAlgorithmImage', # max: 255; OPTIONAL
109 },
110 OutputDataConfig => {
111 S3OutputPath => 'MyS3Uri', # max: 1024
112 KmsKeyId => 'MyKmsKeyId', # max: 2048; OPTIONAL
113 },
114 ResourceConfig => {
115 InstanceCount => 1, # min: 1
116 InstanceType => 'ml.m4.xlarge'
117 , # values: ml.m4.xlarge, ml.m4.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.g4dn.xlarge, ml.g4dn.2xlarge, ml.g4dn.4xlarge, ml.g4dn.8xlarge, ml.g4dn.12xlarge, ml.g4dn.16xlarge, ml.m5.large, ml.m5.xlarge, ml.m5.2xlarge, ml.m5.4xlarge, ml.m5.12xlarge, ml.m5.24xlarge, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.4xlarge, ml.c4.8xlarge, ml.p2.xlarge, ml.p2.8xlarge, ml.p2.16xlarge, ml.p3.2xlarge, ml.p3.8xlarge, ml.p3.16xlarge, ml.p3dn.24xlarge, ml.p4d.24xlarge, ml.c5.xlarge, ml.c5.2xlarge, ml.c5.4xlarge, ml.c5.9xlarge, ml.c5.18xlarge, ml.c5n.xlarge, ml.c5n.2xlarge, ml.c5n.4xlarge, ml.c5n.9xlarge, ml.c5n.18xlarge
118 VolumeSizeInGB => 1, # min: 1
119 VolumeKmsKeyId => 'MyKmsKeyId', # max: 2048; OPTIONAL
120 },
121 RoleArn => 'MyRoleArn', # min: 20, max: 2048
122 StoppingCondition => {
123 MaxRuntimeInSeconds => 1, # min: 1; OPTIONAL
124 MaxWaitTimeInSeconds => 1, # min: 1; OPTIONAL
125 },
126 CheckpointConfig => {
127 S3Uri => 'MyS3Uri', # max: 1024
128 LocalPath => 'MyDirectoryPath', # max: 4096; OPTIONAL
129 }, # OPTIONAL
130 DefinitionName => 'MyHyperParameterTrainingJobDefinitionName'
131 , # min: 1, max: 64; OPTIONAL
132 EnableInterContainerTrafficEncryption => 1, # OPTIONAL
133 EnableManagedSpotTraining => 1, # OPTIONAL
134 EnableNetworkIsolation => 1, # OPTIONAL
135 HyperParameterRanges => {
136 CategoricalParameterRanges => [
137 {
138 Name => 'MyParameterKey', # max: 256
139 Values => [
140 'MyParameterValue', ... # max: 256
141 ], # min: 1, max: 20
142  
143 },
144 ...
145 ], # max: 20; OPTIONAL
146 ContinuousParameterRanges => [
147 {
148 MaxValue => 'MyParameterValue', # max: 256
149 MinValue => 'MyParameterValue', # max: 256
150 Name => 'MyParameterKey', # max: 256
151 ScalingType => 'Auto'
152 , # values: Auto, Linear, Logarithmic, ReverseLogarithmic; OPTIONAL
153 },
154 ...
155 ], # max: 20; OPTIONAL
156 IntegerParameterRanges => [
157 {
158 MaxValue => 'MyParameterValue', # max: 256
159 MinValue => 'MyParameterValue', # max: 256
160 Name => 'MyParameterKey', # max: 256
161 ScalingType => 'Auto'
162 , # values: Auto, Linear, Logarithmic, ReverseLogarithmic; OPTIONAL
163 },
164 ...
165 ], # max: 20; OPTIONAL
166 }, # OPTIONAL
167 InputDataConfig => [
168 {
169 ChannelName => 'MyChannelName', # min: 1, max: 64
170 DataSource => {
171 FileSystemDataSource => {
172 DirectoryPath => 'MyDirectoryPath', # max: 4096; OPTIONAL
173 FileSystemAccessMode => 'rw', # values: rw, ro
174 FileSystemId => 'MyFileSystemId', # min: 11
175 FileSystemType => 'EFS', # values: EFS, FSxLustre
176  
177 }, # OPTIONAL
178 S3DataSource => {
179 S3DataType => 'ManifestFile'
180 , # values: ManifestFile, S3Prefix, AugmentedManifestFile
181 S3Uri => 'MyS3Uri', # max: 1024
182 AttributeNames => [
183 'MyAttributeName', ... # min: 1, max: 256
184 ], # max: 16; OPTIONAL
185 S3DataDistributionType => 'FullyReplicated'
186 , # values: FullyReplicated, ShardedByS3Key; OPTIONAL
187 }, # OPTIONAL
188 },
189 CompressionType => 'None', # values: None, Gzip; OPTIONAL
190 ContentType => 'MyContentType', # max: 256; OPTIONAL
191 InputMode => 'Pipe', # values: Pipe, File
192 RecordWrapperType => 'None', # values: None, RecordIO; OPTIONAL
193 ShuffleConfig => {
194 Seed => 1,
195  
196 }, # OPTIONAL
197 },
198 ...
199 ], # min: 1, max: 20; OPTIONAL
200 RetryStrategy => {
201 MaximumRetryAttempts => 1, # min: 1, max: 30
202  
203 }, # OPTIONAL
204 StaticHyperParameters => {
205 'MyHyperParameterKey' =>
206 'MyHyperParameterValue', # key: max: 256, value: max: 2500
207 }, # max: 100; OPTIONAL
208 TuningObjective => {
209 MetricName => 'MyMetricName', # min: 1, max: 255
210 Type => 'Maximize', # values: Maximize, Minimize
211  
212 }, # OPTIONAL
213 VpcConfig => {
214 SecurityGroupIds => [
215 'MySecurityGroupId', ... # max: 32
216 ], # min: 1, max: 5
217 Subnets => [
218 'MySubnetId', ... # max: 32
219 ], # min: 1, max: 16
220  
221 }, # OPTIONAL
222 }, # OPTIONAL
223 TrainingJobDefinitions => [
224 {
225 AlgorithmSpecification => {
226 TrainingInputMode => 'Pipe', # values: Pipe, File
227 AlgorithmName => 'MyArnOrName', # min: 1, max: 170; OPTIONAL
228 MetricDefinitions => [
229 {
230 Name => 'MyMetricName', # min: 1, max: 255
231 Regex => 'MyMetricRegex', # min: 1, max: 500
232  
233 },
234 ...
235 ], # max: 40; OPTIONAL
236 TrainingImage => 'MyAlgorithmImage', # max: 255; OPTIONAL
237 },
238 OutputDataConfig => {
239 S3OutputPath => 'MyS3Uri', # max: 1024
240 KmsKeyId => 'MyKmsKeyId', # max: 2048; OPTIONAL
241 },
242 ResourceConfig => {
243 InstanceCount => 1, # min: 1
244 InstanceType => 'ml.m4.xlarge'
245 , # values: ml.m4.xlarge, ml.m4.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.g4dn.xlarge, ml.g4dn.2xlarge, ml.g4dn.4xlarge, ml.g4dn.8xlarge, ml.g4dn.12xlarge, ml.g4dn.16xlarge, ml.m5.large, ml.m5.xlarge, ml.m5.2xlarge, ml.m5.4xlarge, ml.m5.12xlarge, ml.m5.24xlarge, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.4xlarge, ml.c4.8xlarge, ml.p2.xlarge, ml.p2.8xlarge, ml.p2.16xlarge, ml.p3.2xlarge, ml.p3.8xlarge, ml.p3.16xlarge, ml.p3dn.24xlarge, ml.p4d.24xlarge, ml.c5.xlarge, ml.c5.2xlarge, ml.c5.4xlarge, ml.c5.9xlarge, ml.c5.18xlarge, ml.c5n.xlarge, ml.c5n.2xlarge, ml.c5n.4xlarge, ml.c5n.9xlarge, ml.c5n.18xlarge
246 VolumeSizeInGB => 1, # min: 1
247 VolumeKmsKeyId => 'MyKmsKeyId', # max: 2048; OPTIONAL
248 },
249 RoleArn => 'MyRoleArn', # min: 20, max: 2048
250 StoppingCondition => {
251 MaxRuntimeInSeconds => 1, # min: 1; OPTIONAL
252 MaxWaitTimeInSeconds => 1, # min: 1; OPTIONAL
253 },
254 CheckpointConfig => {
255 S3Uri => 'MyS3Uri', # max: 1024
256 LocalPath => 'MyDirectoryPath', # max: 4096; OPTIONAL
257 }, # OPTIONAL
258 DefinitionName => 'MyHyperParameterTrainingJobDefinitionName'
259 , # min: 1, max: 64; OPTIONAL
260 EnableInterContainerTrafficEncryption => 1, # OPTIONAL
261 EnableManagedSpotTraining => 1, # OPTIONAL
262 EnableNetworkIsolation => 1, # OPTIONAL
263 HyperParameterRanges => {
264 CategoricalParameterRanges => [
265 {
266 Name => 'MyParameterKey', # max: 256
267 Values => [
268 'MyParameterValue', ... # max: 256
269 ], # min: 1, max: 20
270  
271 },
272 ...
273 ], # max: 20; OPTIONAL
274 ContinuousParameterRanges => [
275 {
276 MaxValue => 'MyParameterValue', # max: 256
277 MinValue => 'MyParameterValue', # max: 256
278 Name => 'MyParameterKey', # max: 256
279 ScalingType => 'Auto'
280 , # values: Auto, Linear, Logarithmic, ReverseLogarithmic; OPTIONAL
281 },
282 ...
283 ], # max: 20; OPTIONAL
284 IntegerParameterRanges => [
285 {
286 MaxValue => 'MyParameterValue', # max: 256
287 MinValue => 'MyParameterValue', # max: 256
288 Name => 'MyParameterKey', # max: 256
289 ScalingType => 'Auto'
290 , # values: Auto, Linear, Logarithmic, ReverseLogarithmic; OPTIONAL
291 },
292 ...
293 ], # max: 20; OPTIONAL
294 }, # OPTIONAL
295 InputDataConfig => [
296 {
297 ChannelName => 'MyChannelName', # min: 1, max: 64
298 DataSource => {
299 FileSystemDataSource => {
300 DirectoryPath => 'MyDirectoryPath', # max: 4096; OPTIONAL
301 FileSystemAccessMode => 'rw', # values: rw, ro
302 FileSystemId => 'MyFileSystemId', # min: 11
303 FileSystemType => 'EFS', # values: EFS, FSxLustre
304  
305 }, # OPTIONAL
306 S3DataSource => {
307 S3DataType => 'ManifestFile'
308 , # values: ManifestFile, S3Prefix, AugmentedManifestFile
309 S3Uri => 'MyS3Uri', # max: 1024
310 AttributeNames => [
311 'MyAttributeName', ... # min: 1, max: 256
312 ], # max: 16; OPTIONAL
313 S3DataDistributionType => 'FullyReplicated'
314 , # values: FullyReplicated, ShardedByS3Key; OPTIONAL
315 }, # OPTIONAL
316 },
317 CompressionType => 'None', # values: None, Gzip; OPTIONAL
318 ContentType => 'MyContentType', # max: 256; OPTIONAL
319 InputMode => 'Pipe', # values: Pipe, File
320 RecordWrapperType => 'None', # values: None, RecordIO; OPTIONAL
321 ShuffleConfig => {
322 Seed => 1,
323  
324 }, # OPTIONAL
325 },
326 ...
327 ], # min: 1, max: 20; OPTIONAL
328 RetryStrategy => {
329 MaximumRetryAttempts => 1, # min: 1, max: 30
330  
331 }, # OPTIONAL
332 StaticHyperParameters => {
333 'MyHyperParameterKey' =>
334 'MyHyperParameterValue', # key: max: 256, value: max: 2500
335 }, # max: 100; OPTIONAL
336 TuningObjective => {
337 MetricName => 'MyMetricName', # min: 1, max: 255
338 Type => 'Maximize', # values: Maximize, Minimize
339  
340 }, # OPTIONAL
341 VpcConfig => {
342 SecurityGroupIds => [
343 'MySecurityGroupId', ... # max: 32
344 ], # min: 1, max: 5
345 Subnets => [
346 'MySubnetId', ... # max: 32
347 ], # min: 1, max: 16
348  
349 }, # OPTIONAL
350 },
351 ...
352 ], # OPTIONAL
353 WarmStartConfig => {
354 ParentHyperParameterTuningJobs => [
355 {
356 HyperParameterTuningJobName =>
357 'MyHyperParameterTuningJobName', # min: 1, max: 32
358 },
359 ...
360 ], # min: 1, max: 5
361 WarmStartType => 'IdenticalDataAndAlgorithm'
362 , # values: IdenticalDataAndAlgorithm, TransferLearning
363  
364 }, # OPTIONAL
365 );
366  
367 # Results:
368 my $HyperParameterTuningJobArn =
369 $CreateHyperParameterTuningJobResponse->HyperParameterTuningJobArn;
370  
371 # Returns a L<Paws::SageMaker::CreateHyperParameterTuningJobResponse> object.
372  
373 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
374 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/api.sagemaker/CreateHyperParameterTuningJob>
375  
376 =head1 ATTRIBUTES
377  
378  
379 =head2 B<REQUIRED> HyperParameterTuningJobConfig => L<Paws::SageMaker::HyperParameterTuningJobConfig>
380  
381 The HyperParameterTuningJobConfig object that describes the tuning job,
382 including the search strategy, the objective metric used to evaluate
383 training jobs, ranges of parameters to search, and resource limits for
384 the tuning job. For more information, see How Hyperparameter Tuning
385 Works
386 (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html).
387  
388  
389  
390 =head2 B<REQUIRED> HyperParameterTuningJobName => Str
391  
392 The name of the tuning job. This name is the prefix for the names of
393 all training jobs that this tuning job launches. The name must be
394 unique within the same Amazon Web Services account and Amazon Web
395 Services Region. The name must have 1 to 32 characters. Valid
396 characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name is
397 not case sensitive.
398  
399  
400  
401 =head2 Tags => ArrayRef[L<Paws::SageMaker::Tag>]
402  
403 An array of key-value pairs. You can use tags to categorize your Amazon
404 Web Services resources in different ways, for example, by purpose,
405 owner, or environment. For more information, see Tagging Amazon Web
406 Services Resources
407 (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html).
408  
409 Tags that you specify for the tuning job are also added to all training
410 jobs that the tuning job launches.
411  
412  
413  
414 =head2 TrainingJobDefinition => L<Paws::SageMaker::HyperParameterTrainingJobDefinition>
415  
416 The HyperParameterTrainingJobDefinition object that describes the
417 training jobs that this tuning job launches, including static
418 hyperparameters, input data configuration, output data configuration,
419 resource configuration, and stopping condition.
420  
421  
422  
423 =head2 TrainingJobDefinitions => ArrayRef[L<Paws::SageMaker::HyperParameterTrainingJobDefinition>]
424  
425 A list of the HyperParameterTrainingJobDefinition objects launched for
426 this tuning job.
427  
428  
429  
430 =head2 WarmStartConfig => L<Paws::SageMaker::HyperParameterTuningJobWarmStartConfig>
431  
432 Specifies the configuration for starting the hyperparameter tuning job
433 using one or more previous tuning jobs as a starting point. The results
434 of previous tuning jobs are used to inform which combinations of
435 hyperparameters to search over in the new tuning job.
436  
437 All training jobs launched by the new hyperparameter tuning job are
438 evaluated by using the objective metric. If you specify
439 C<IDENTICAL_DATA_AND_ALGORITHM> as the C<WarmStartType> value for the
440 warm start configuration, the training job that performs the best in
441 the new tuning job is compared to the best training jobs from the
442 parent tuning jobs. From these, the training job that performs the best
443 as measured by the objective metric is returned as the overall best
444 training job.
445  
446 All training jobs launched by parent hyperparameter tuning jobs and the
447 new hyperparameter tuning jobs count against the limit of training jobs
448 for the tuning job.
449  
450  
451  
452  
453 =head1 SEE ALSO
454  
455 This class forms part of L<Paws>, documenting arguments for method CreateHyperParameterTuningJob in L<Paws::SageMaker>
456  
457 =head1 BUGS and CONTRIBUTIONS
458  
459 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
460  
461 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
462  
463 =cut
464