pub struct ProgressiveNAS<T: Float + Debug + Send + Sync + 'static> { /* private fields */ }Expand description
Engine-side progressive search: a staged complexity schedule that constrains which candidates may be evaluated in each phase of the run.
This complements crate::search_strategies::ProgressiveNAS, which generates
progressively more complex architectures: whatever strategy the engine is
configured with, this filter enforces the schedule on the candidates that
actually reach the evaluator, so NASConfig::progressive_search means
something for every strategy.
It used to mean nothing at all. new built an empty stages vector and
filter_candidates was Ok(candidates) — the input returned verbatim — while
current_stage stayed 0 and stage_history was never written. Enabling
progressive_search therefore changed no behaviour whatsoever, even though the
engine reports it among the run’s key hyperparameters.
Implementations§
Source§impl<T: Float + Debug + Default + Clone + Send + Sync + 'static> ProgressiveNAS<T>
impl<T: Float + Debug + Default + Clone + Send + Sync + 'static> ProgressiveNAS<T>
Sourcepub fn new(config: &NASConfig<T>) -> Result<Self>
pub fn new(config: &NASConfig<T>) -> Result<Self>
Build the stage schedule from the configuration.
One stage per allowed component count between
SearchSpaceConfig::min_components and max_components, each stage holding
a narrowed copy of the search space (its own max_components) so the stage
configuration describes exactly what that stage may explore. The generation
budget is split evenly across the stages, which is
TimeBudgetAllocation::Uniform applied to the generation axis.
Sourcepub fn stage_for_generation(&self, generation: usize) -> usize
pub fn stage_for_generation(&self, generation: usize) -> usize
The stage generation falls into, clamped to the last stage once the
schedule is exhausted (the search may legitimately run longer than the
budget the stages were sized from).
Sourcepub fn complexity_limit(&self, generation: usize) -> Option<usize>
pub fn complexity_limit(&self, generation: usize) -> Option<usize>
Maximum component count allowed in the stage generation falls into.
Sourcepub fn stages(&self) -> &[ProgressiveStage<T>]
pub fn stages(&self) -> &[ProgressiveStage<T>]
The stage schedule.
Sourcepub fn current_stage(&self) -> usize
pub fn current_stage(&self) -> usize
The stage the most recent filter_candidates call was in.
Sourcepub fn stage_results(&self, stage: usize) -> &[SearchResult<T>]
pub fn stage_results(&self, stage: usize) -> &[SearchResult<T>]
Results recorded for stage.
Sourcepub fn filter_candidates(
&mut self,
candidates: Vec<OptimizerArchitecture<T>>,
generation: usize,
) -> Result<Vec<OptimizerArchitecture<T>>>
pub fn filter_candidates( &mut self, candidates: Vec<OptimizerArchitecture<T>>, generation: usize, ) -> Result<Vec<OptimizerArchitecture<T>>>
Restrict candidates to the complexity the current stage allows.
Candidates over the limit are held back rather than evaluated early — that is the whole point of a progressive schedule. If every candidate exceeds the limit the simplest ones are kept anyway: returning an empty list would stall the search, and a stalled generation is a worse answer than evaluating the closest candidates available.
Sourcepub fn record_stage_results(
&mut self,
generation: usize,
results: &[SearchResult<T>],
)
pub fn record_stage_results( &mut self, generation: usize, results: &[SearchResult<T>], )
Record results against the stage they were produced in, so the stage
history describes what each stage actually achieved.
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> 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