#[non_exhaustive]pub enum Transform {
None,
Log,
NegativeLog,
}Expand description
A transformation of the model’s values that the surrogate is fitted to (Jones et al. 1998, §3, p. 468 and §4.2, pp. 473–474; see the module’s page).
use hpr_analysis::optimize::ego::Transform;
// −ln(−y) pulls the values near Hartmann 6's minimum, −3.32237, together and pushes the
// flat region near zero far out.
let z = |y| Transform::NegativeLog.apply(y).unwrap();
assert!((z(-3.32237) - -1.2007).abs() < 1e-4);
assert!((z(-0.01) - 4.6052).abs() < 1e-4);
// Outside its domain: none.
assert_eq!(Transform::NegativeLog.apply(0.5), None);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.
None
The values as they are.
Log
z = ln y, for a model whose values are all positive: Jones et al.’s choice for
Goldstein–Price’s function.
NegativeLog
z = −ln(−y), for a model whose values are all negative: Jones et al.’s choice for
Hartmann’s six-variable function. It squeezes the values near the least together and
stretches those near zero.
Implementations§
Trait Implementations§
impl Copy for Transform
Source§impl<'de> Deserialize<'de> for Transform
impl<'de> Deserialize<'de> for Transform
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
impl Eq for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more