aws_sdk_sagemaker/types/_parameter_ranges.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the combination of values that result in the training job with the best performance as measured by the objective metric of the hyperparameter tuning job.</p><note>
4/// <p>The maximum number of items specified for <code>Array Members</code> refers to the maximum number of hyperparameters for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of hyperparameters for all the ranges can't exceed the maximum number specified.</p>
5/// </note>
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct ParameterRanges {
9 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_IntegerParameterRange.html">IntegerParameterRange</a> objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.</p>
10 pub integer_parameter_ranges: ::std::option::Option<::std::vec::Vec<crate::types::IntegerParameterRange>>,
11 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContinuousParameterRange.html">ContinuousParameterRange</a> objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.</p>
12 pub continuous_parameter_ranges: ::std::option::Option<::std::vec::Vec<crate::types::ContinuousParameterRange>>,
13 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CategoricalParameterRange.html">CategoricalParameterRange</a> objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.</p>
14 pub categorical_parameter_ranges: ::std::option::Option<::std::vec::Vec<crate::types::CategoricalParameterRange>>,
15 /// <p>A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for your tuning job.</p>
16 pub auto_parameters: ::std::option::Option<::std::vec::Vec<crate::types::AutoParameter>>,
17}
18impl ParameterRanges {
19 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_IntegerParameterRange.html">IntegerParameterRange</a> objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.integer_parameter_ranges.is_none()`.
22 pub fn integer_parameter_ranges(&self) -> &[crate::types::IntegerParameterRange] {
23 self.integer_parameter_ranges.as_deref().unwrap_or_default()
24 }
25 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContinuousParameterRange.html">ContinuousParameterRange</a> objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.</p>
26 ///
27 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.continuous_parameter_ranges.is_none()`.
28 pub fn continuous_parameter_ranges(&self) -> &[crate::types::ContinuousParameterRange] {
29 self.continuous_parameter_ranges.as_deref().unwrap_or_default()
30 }
31 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CategoricalParameterRange.html">CategoricalParameterRange</a> objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.</p>
32 ///
33 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.categorical_parameter_ranges.is_none()`.
34 pub fn categorical_parameter_ranges(&self) -> &[crate::types::CategoricalParameterRange] {
35 self.categorical_parameter_ranges.as_deref().unwrap_or_default()
36 }
37 /// <p>A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for your tuning job.</p>
38 ///
39 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.auto_parameters.is_none()`.
40 pub fn auto_parameters(&self) -> &[crate::types::AutoParameter] {
41 self.auto_parameters.as_deref().unwrap_or_default()
42 }
43}
44impl ParameterRanges {
45 /// Creates a new builder-style object to manufacture [`ParameterRanges`](crate::types::ParameterRanges).
46 pub fn builder() -> crate::types::builders::ParameterRangesBuilder {
47 crate::types::builders::ParameterRangesBuilder::default()
48 }
49}
50
51/// A builder for [`ParameterRanges`](crate::types::ParameterRanges).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct ParameterRangesBuilder {
55 pub(crate) integer_parameter_ranges: ::std::option::Option<::std::vec::Vec<crate::types::IntegerParameterRange>>,
56 pub(crate) continuous_parameter_ranges: ::std::option::Option<::std::vec::Vec<crate::types::ContinuousParameterRange>>,
57 pub(crate) categorical_parameter_ranges: ::std::option::Option<::std::vec::Vec<crate::types::CategoricalParameterRange>>,
58 pub(crate) auto_parameters: ::std::option::Option<::std::vec::Vec<crate::types::AutoParameter>>,
59}
60impl ParameterRangesBuilder {
61 /// Appends an item to `integer_parameter_ranges`.
62 ///
63 /// To override the contents of this collection use [`set_integer_parameter_ranges`](Self::set_integer_parameter_ranges).
64 ///
65 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_IntegerParameterRange.html">IntegerParameterRange</a> objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.</p>
66 pub fn integer_parameter_ranges(mut self, input: crate::types::IntegerParameterRange) -> Self {
67 let mut v = self.integer_parameter_ranges.unwrap_or_default();
68 v.push(input);
69 self.integer_parameter_ranges = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_IntegerParameterRange.html">IntegerParameterRange</a> objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.</p>
73 pub fn set_integer_parameter_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IntegerParameterRange>>) -> Self {
74 self.integer_parameter_ranges = input;
75 self
76 }
77 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_IntegerParameterRange.html">IntegerParameterRange</a> objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.</p>
78 pub fn get_integer_parameter_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IntegerParameterRange>> {
79 &self.integer_parameter_ranges
80 }
81 /// Appends an item to `continuous_parameter_ranges`.
82 ///
83 /// To override the contents of this collection use [`set_continuous_parameter_ranges`](Self::set_continuous_parameter_ranges).
84 ///
85 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContinuousParameterRange.html">ContinuousParameterRange</a> objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.</p>
86 pub fn continuous_parameter_ranges(mut self, input: crate::types::ContinuousParameterRange) -> Self {
87 let mut v = self.continuous_parameter_ranges.unwrap_or_default();
88 v.push(input);
89 self.continuous_parameter_ranges = ::std::option::Option::Some(v);
90 self
91 }
92 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContinuousParameterRange.html">ContinuousParameterRange</a> objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.</p>
93 pub fn set_continuous_parameter_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContinuousParameterRange>>) -> Self {
94 self.continuous_parameter_ranges = input;
95 self
96 }
97 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContinuousParameterRange.html">ContinuousParameterRange</a> objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.</p>
98 pub fn get_continuous_parameter_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContinuousParameterRange>> {
99 &self.continuous_parameter_ranges
100 }
101 /// Appends an item to `categorical_parameter_ranges`.
102 ///
103 /// To override the contents of this collection use [`set_categorical_parameter_ranges`](Self::set_categorical_parameter_ranges).
104 ///
105 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CategoricalParameterRange.html">CategoricalParameterRange</a> objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.</p>
106 pub fn categorical_parameter_ranges(mut self, input: crate::types::CategoricalParameterRange) -> Self {
107 let mut v = self.categorical_parameter_ranges.unwrap_or_default();
108 v.push(input);
109 self.categorical_parameter_ranges = ::std::option::Option::Some(v);
110 self
111 }
112 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CategoricalParameterRange.html">CategoricalParameterRange</a> objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.</p>
113 pub fn set_categorical_parameter_ranges(
114 mut self,
115 input: ::std::option::Option<::std::vec::Vec<crate::types::CategoricalParameterRange>>,
116 ) -> Self {
117 self.categorical_parameter_ranges = input;
118 self
119 }
120 /// <p>The array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CategoricalParameterRange.html">CategoricalParameterRange</a> objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.</p>
121 pub fn get_categorical_parameter_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CategoricalParameterRange>> {
122 &self.categorical_parameter_ranges
123 }
124 /// Appends an item to `auto_parameters`.
125 ///
126 /// To override the contents of this collection use [`set_auto_parameters`](Self::set_auto_parameters).
127 ///
128 /// <p>A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for your tuning job.</p>
129 pub fn auto_parameters(mut self, input: crate::types::AutoParameter) -> Self {
130 let mut v = self.auto_parameters.unwrap_or_default();
131 v.push(input);
132 self.auto_parameters = ::std::option::Option::Some(v);
133 self
134 }
135 /// <p>A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for your tuning job.</p>
136 pub fn set_auto_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AutoParameter>>) -> Self {
137 self.auto_parameters = input;
138 self
139 }
140 /// <p>A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for your tuning job.</p>
141 pub fn get_auto_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AutoParameter>> {
142 &self.auto_parameters
143 }
144 /// Consumes the builder and constructs a [`ParameterRanges`](crate::types::ParameterRanges).
145 pub fn build(self) -> crate::types::ParameterRanges {
146 crate::types::ParameterRanges {
147 integer_parameter_ranges: self.integer_parameter_ranges,
148 continuous_parameter_ranges: self.continuous_parameter_ranges,
149 categorical_parameter_ranges: self.categorical_parameter_ranges,
150 auto_parameters: self.auto_parameters,
151 }
152 }
153}