Skip to main content

Tpe

Struct Tpe 

Source
pub struct Tpe {
    pub goal: Goal,
    pub startup: usize,
    pub candidates: usize,
    pub quantile: f64,
    pub seed: u64,
}
Expand description

Tree-structured Parzen Estimator: model what the good trials did, model what the bad ones did, and propose where the first is likely and the second is not.

The one that looks at what already happened, which is also its one honest cost: it cannot derive trial 7 from the seed and the index alone, so a study spread over a folder gets a different search than one in a single process. That is what being guided means, not a bug to fix.

Fields§

§goal: Goal

Which way is better.

§startup: usize

Draw at random until this many trials have finished. Below two there is nothing to split into good and bad, so two is the floor whatever is said.

§candidates: usize

How many places to consider before proposing one. More is a better proposal and costs nothing but arithmetic — no trial is run for it.

§quantile: f64

What share of the finished trials counts as good. 0.25 keeps the best quarter as the thing to imitate.

§seed: u64

The seed of the draws.

Implementations§

Source§

impl Tpe

Source

pub fn ask( &self, space: &Space, trial: usize, seen: &[(Point, Option<f64>)], ) -> Option<Point>

The trial-th point. Random until startup, guided after.

Trait Implementations§

Source§

impl Clone for Tpe

Source§

fn clone(&self) -> Tpe

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tpe

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Tpe> for Sampler

Source§

fn from(how: Tpe) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Tpe

Source§

fn eq(&self, other: &Tpe) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Tpe

Auto Trait Implementations§

§

impl Freeze for Tpe

§

impl RefUnwindSafe for Tpe

§

impl Send for Tpe

§

impl Sync for Tpe

§

impl Unpin for Tpe

§

impl UnsafeUnpin for Tpe

§

impl UnwindSafe for Tpe

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.