#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParameterSpec
impl Debug for ParameterSpec
Source§impl Default for ParameterSpec
impl Default for ParameterSpec
Source§fn default() -> ParameterSpec
fn default() -> ParameterSpec
Source§impl Message for ParameterSpec
impl Message for ParameterSpec
Source§impl PartialEq for ParameterSpec
impl PartialEq for ParameterSpec
impl StructuralPartialEq for ParameterSpec
Auto Trait Implementations§
impl Freeze for ParameterSpec
impl RefUnwindSafe for ParameterSpec
impl Send for ParameterSpec
impl Sync for ParameterSpec
impl Unpin for ParameterSpec
impl UnsafeUnpin for ParameterSpec
impl UnwindSafe for ParameterSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request