pub struct ProgressiveNAS<T: Float + Debug + Send + Sync + 'static> {
pub current_phase: SearchPhase,
pub progression_strategy: ProgressionStrategy,
pub complexity_scheduler: ComplexityScheduler<T>,
pub architecture_progression: ArchitectureProgression<T>,
/* private fields */
}Expand description
Progressive NAS configuration
Fields§
§current_phase: SearchPhaseCurrent search phase
progression_strategy: ProgressionStrategyPhase progression strategy
complexity_scheduler: ComplexityScheduler<T>Complexity scheduler
architecture_progression: ArchitectureProgression<T>Architecture progression tracker
Implementations§
Source§impl<T: Float + Debug + Send + Sync + Sum> ProgressiveNAS<T>
impl<T: Float + Debug + Send + Sync + Sum> ProgressiveNAS<T>
Sourcepub fn new(config: &NASConfig<T>) -> Result<Self>
pub fn new(config: &NASConfig<T>) -> Result<Self>
Create new progressive NAS.
The budget-derived phase length is floored at one: search_budget / 4 is
0 for any budget under four, and the previous code then divided by it on
the first ProgressiveNAS::update_search_phase call.
Sourcepub fn is_search_complete(&self) -> bool
pub fn is_search_complete(&self) -> bool
Whether the schedule has been exhausted.
Set once the search is in SearchPhase::Final and a further advance is
requested. Recording and phase updates keep working afterwards, so a caller
that ignores this still gets valid bookkeeping.
Sourcepub fn update_search_phase(&mut self, generation: usize) -> Result<()>
pub fn update_search_phase(&mut self, generation: usize) -> Result<()>
Update search phase based on progress.
Phases never move backwards: the budget- and time-based rules compute the
phase the elapsed budget/time implies and take the later of that and the
current phase. Recomputing unconditionally, as this used to, let a caller
passing a smaller generation — or a clock that had not yet crossed the
next boundary after an adaptive advance — walk the search back into an
earlier phase and re-lower the complexity budget.
Sourcepub fn get_current_search_config(&self) -> SearchPhaseConfig<T>
pub fn get_current_search_config(&self) -> SearchPhaseConfig<T>
Get current search configuration based on phase
Sourcepub fn record_architecture_evaluation(
&mut self,
architecture_id: String,
performance: T,
complexity: T,
) -> Result<()>
pub fn record_architecture_evaluation( &mut self, architecture_id: String, performance: T, complexity: T, ) -> Result<()>
Record an architecture evaluation, crediting it to the phase the search is in and to the architecture that produced it.
An empty architecture_id is rejected: an unidentified result cannot be
credited to anything, and the previous code stored it anyway, so
get_best_for_phase handed back an empty string as a “best architecture”.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ProgressiveNAS<T>
impl<T> RefUnwindSafe for ProgressiveNAS<T>
impl<T> Send for ProgressiveNAS<T>
impl<T> Sync for ProgressiveNAS<T>
impl<T> Unpin for ProgressiveNAS<T>
impl<T> UnsafeUnpin for ProgressiveNAS<T>
impl<T> UnwindSafe for ProgressiveNAS<T>
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,
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> ⓘ
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> ⓘ
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