Skip to main content

ProgressiveNAS

Struct ProgressiveNAS 

Source
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>

Source

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.

Source

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).

Source

pub fn complexity_limit(&self, generation: usize) -> Option<usize>

Maximum component count allowed in the stage generation falls into.

Source

pub fn stages(&self) -> &[ProgressiveStage<T>]

The stage schedule.

Source

pub fn current_stage(&self) -> usize

The stage the most recent filter_candidates call was in.

Source

pub fn stage_results(&self, stage: usize) -> &[SearchResult<T>]

Results recorded for stage.

Source

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.

Source

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§

Source§

impl<T: Debug + Float + Debug + Send + Sync + 'static> Debug for ProgressiveNAS<T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V