pub struct RandomArchSearch { /* private fields */ }Expand description
Random-search NAS: samples architectures uniformly at random, keeps track of the best seen so far.
Implementations§
Source§impl RandomArchSearch
impl RandomArchSearch
Sourcepub fn new(space: ArchSearchSpace, seed: u64) -> Self
pub fn new(space: ArchSearchSpace, seed: u64) -> Self
Create a new random architecture searcher.
§Arguments
space- Architecture search space to sample from.seed- RNG seed for reproducibility.
Sourcepub fn ask(&mut self) -> TrainResult<Architecture>
pub fn ask(&mut self) -> TrainResult<Architecture>
Ask for the next architecture to evaluate.
Always returns a fresh uniformly random architecture independent of previous results.
Sourcepub fn tell(&mut self, arch: Architecture, score: f64)
pub fn tell(&mut self, arch: Architecture, score: f64)
Tell the result of evaluating an architecture.
Updates the running best when score exceeds the current best.
Sourcepub fn best(&self) -> Option<&(Architecture, f64)>
pub fn best(&self) -> Option<&(Architecture, f64)>
Return a reference to the best (architecture, score) pair seen so far,
or None if no evaluations have been recorded.
Auto Trait Implementations§
impl Freeze for RandomArchSearch
impl RefUnwindSafe for RandomArchSearch
impl Send for RandomArchSearch
impl Sync for RandomArchSearch
impl Unpin for RandomArchSearch
impl UnsafeUnpin for RandomArchSearch
impl UnwindSafe for RandomArchSearch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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