#[non_exhaustive]pub struct ParameterSpec {
pub parameter_id: String,
pub scale_type: ScaleType,
pub conditional_parameter_specs: Vec<ConditionalParameterSpec>,
pub parameter_value_spec: Option<ParameterValueSpec>,
/* private fields */
}job-service or vizier-service only.Expand description
Represents a single parameter to optimize.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parameter_id: StringRequired. The ID of the parameter. Must not contain whitespaces and must be unique amongst all ParameterSpecs.
scale_type: ScaleTypeHow the parameter should be scaled.
Leave unset for CATEGORICAL parameters.
conditional_parameter_specs: Vec<ConditionalParameterSpec>A conditional parameter node is active if the parameter’s value matches the conditional node’s parent_value_condition.
If two items in conditional_parameter_specs have the same name, they must have disjoint parent_value_condition.
parameter_value_spec: Option<ParameterValueSpec>Implementations§
Source§impl ParameterSpec
impl ParameterSpec
pub fn new() -> Self
Sourcepub fn set_parameter_id<T: Into<String>>(self, v: T) -> Self
pub fn set_parameter_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_scale_type<T: Into<ScaleType>>(self, v: T) -> Self
pub fn set_scale_type<T: Into<ScaleType>>(self, v: T) -> Self
Sets the value of scale_type.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::ScaleType;
let x0 = ParameterSpec::new().set_scale_type(ScaleType::UnitLinearScale);
let x1 = ParameterSpec::new().set_scale_type(ScaleType::UnitLogScale);
let x2 = ParameterSpec::new().set_scale_type(ScaleType::UnitReverseLogScale);Sourcepub fn set_conditional_parameter_specs<T, V>(self, v: T) -> Self
pub fn set_conditional_parameter_specs<T, V>(self, v: T) -> Self
Sets the value of conditional_parameter_specs.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::ConditionalParameterSpec;
let x = ParameterSpec::new()
.set_conditional_parameter_specs([
ConditionalParameterSpec::default()/* use setters */,
ConditionalParameterSpec::default()/* use (different) setters */,
]);Sourcepub fn set_parameter_value_spec<T: Into<Option<ParameterValueSpec>>>(
self,
v: T,
) -> Self
pub fn set_parameter_value_spec<T: Into<Option<ParameterValueSpec>>>( self, v: T, ) -> Self
Sets the value of parameter_value_spec.
Note that all the setters affecting parameter_value_spec are mutually
exclusive.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::DoubleValueSpec;
let x = ParameterSpec::new().set_parameter_value_spec(Some(
google_cloud_aiplatform_v1::model::study_spec::parameter_spec::ParameterValueSpec::DoubleValueSpec(DoubleValueSpec::default().into())));Sourcepub fn double_value_spec(&self) -> Option<&Box<DoubleValueSpec>>
pub fn double_value_spec(&self) -> Option<&Box<DoubleValueSpec>>
The value of parameter_value_spec
if it holds a DoubleValueSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_double_value_spec<T: Into<Box<DoubleValueSpec>>>(self, v: T) -> Self
pub fn set_double_value_spec<T: Into<Box<DoubleValueSpec>>>(self, v: T) -> Self
Sets the value of parameter_value_spec
to hold a DoubleValueSpec.
Note that all the setters affecting parameter_value_spec are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::DoubleValueSpec;
let x = ParameterSpec::new().set_double_value_spec(DoubleValueSpec::default()/* use setters */);
assert!(x.double_value_spec().is_some());
assert!(x.integer_value_spec().is_none());
assert!(x.categorical_value_spec().is_none());
assert!(x.discrete_value_spec().is_none());Sourcepub fn integer_value_spec(&self) -> Option<&Box<IntegerValueSpec>>
pub fn integer_value_spec(&self) -> Option<&Box<IntegerValueSpec>>
The value of parameter_value_spec
if it holds a IntegerValueSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_integer_value_spec<T: Into<Box<IntegerValueSpec>>>(
self,
v: T,
) -> Self
pub fn set_integer_value_spec<T: Into<Box<IntegerValueSpec>>>( self, v: T, ) -> Self
Sets the value of parameter_value_spec
to hold a IntegerValueSpec.
Note that all the setters affecting parameter_value_spec are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::IntegerValueSpec;
let x = ParameterSpec::new().set_integer_value_spec(IntegerValueSpec::default()/* use setters */);
assert!(x.integer_value_spec().is_some());
assert!(x.double_value_spec().is_none());
assert!(x.categorical_value_spec().is_none());
assert!(x.discrete_value_spec().is_none());Sourcepub fn categorical_value_spec(&self) -> Option<&Box<CategoricalValueSpec>>
pub fn categorical_value_spec(&self) -> Option<&Box<CategoricalValueSpec>>
The value of parameter_value_spec
if it holds a CategoricalValueSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_categorical_value_spec<T: Into<Box<CategoricalValueSpec>>>(
self,
v: T,
) -> Self
pub fn set_categorical_value_spec<T: Into<Box<CategoricalValueSpec>>>( self, v: T, ) -> Self
Sets the value of parameter_value_spec
to hold a CategoricalValueSpec.
Note that all the setters affecting parameter_value_spec are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::CategoricalValueSpec;
let x = ParameterSpec::new().set_categorical_value_spec(CategoricalValueSpec::default()/* use setters */);
assert!(x.categorical_value_spec().is_some());
assert!(x.double_value_spec().is_none());
assert!(x.integer_value_spec().is_none());
assert!(x.discrete_value_spec().is_none());Sourcepub fn discrete_value_spec(&self) -> Option<&Box<DiscreteValueSpec>>
pub fn discrete_value_spec(&self) -> Option<&Box<DiscreteValueSpec>>
The value of parameter_value_spec
if it holds a DiscreteValueSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_discrete_value_spec<T: Into<Box<DiscreteValueSpec>>>(
self,
v: T,
) -> Self
pub fn set_discrete_value_spec<T: Into<Box<DiscreteValueSpec>>>( self, v: T, ) -> Self
Sets the value of parameter_value_spec
to hold a DiscreteValueSpec.
Note that all the setters affecting parameter_value_spec are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::study_spec::parameter_spec::DiscreteValueSpec;
let x = ParameterSpec::new().set_discrete_value_spec(DiscreteValueSpec::default()/* use setters */);
assert!(x.discrete_value_spec().is_some());
assert!(x.double_value_spec().is_none());
assert!(x.integer_value_spec().is_none());
assert!(x.categorical_value_spec().is_none());Trait Implementations§
Source§impl Clone for ParameterSpec
impl Clone for ParameterSpec
Source§fn clone(&self) -> ParameterSpec
fn clone(&self) -> ParameterSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more