#[non_exhaustive]pub enum SearchDimension {
Float {
name: String,
low: f64,
high: f64,
scale: Scale,
default: Option<f64>,
},
Int {
name: String,
low: i64,
high: i64,
scale: Scale,
},
Categorical {
name: String,
choices: Vec<Value>,
},
Conditional {
name: String,
parent: String,
parent_values: Vec<Value>,
dimension: Box<SearchDimension>,
},
}Expand description
A single searchable parameter dimension.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Float
Continuous range (f64)
Fields
Int
Integer range
Fields
Categorical
Discrete set of choices
Fields
Conditional
Active only when parent parameter has specific values
Fields
§
parent: StringName of the parameter this dimension depends on. Prefixed
alongside name in SearchSpace::merge_with_prefix, so
the link survives merging.
§
parent_values: Vec<Value>Parent values that activate this dimension; for any other parent value the dimension is skipped.
§
dimension: Box<SearchDimension>The dimension to sample when active.
Implementations§
Source§impl SearchDimension
impl SearchDimension
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The parameter name, whichever variant this is. This is the key
trial params are stored under and the handle SearchSpace::freeze
matches on.
Trait Implementations§
Source§impl Clone for SearchDimension
impl Clone for SearchDimension
Source§fn clone(&self) -> SearchDimension
fn clone(&self) -> SearchDimension
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchDimension
impl Debug for SearchDimension
Source§impl<'de> Deserialize<'de> for SearchDimension
impl<'de> Deserialize<'de> for SearchDimension
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SearchDimension
impl Display for SearchDimension
Source§impl PartialEq for SearchDimension
impl PartialEq for SearchDimension
Source§fn eq(&self, other: &SearchDimension) -> bool
fn eq(&self, other: &SearchDimension) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SearchDimension
impl Serialize for SearchDimension
impl StructuralPartialEq for SearchDimension
Auto Trait Implementations§
impl Freeze for SearchDimension
impl RefUnwindSafe for SearchDimension
impl Send for SearchDimension
impl Sync for SearchDimension
impl Unpin for SearchDimension
impl UnsafeUnpin for SearchDimension
impl UnwindSafe for SearchDimension
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
Mutably borrows from an owned value. Read more