pub struct ExponentialStochasticDepth {
pub num_layers: usize,
pub drop_prob_min: f64,
pub drop_prob_max: f64,
}Expand description
Exponential stochastic depth scheduler.
Exponentially increases drop probability across network depth. Provides more aggressive regularization in deeper layers.
Fields§
§num_layers: usizeTotal number of layers/blocks.
drop_prob_min: f64Drop probability for first layer.
drop_prob_max: f64Drop probability for last layer.
Implementations§
Source§impl ExponentialStochasticDepth
impl ExponentialStochasticDepth
Sourcepub fn new(
num_layers: usize,
drop_prob_min: f64,
drop_prob_max: f64,
) -> TrainResult<Self>
pub fn new( num_layers: usize, drop_prob_min: f64, drop_prob_max: f64, ) -> TrainResult<Self>
Create a new exponential stochastic depth scheduler.
Sourcepub fn get_drop_prob(&self, layer_idx: usize) -> f64
pub fn get_drop_prob(&self, layer_idx: usize) -> f64
Get drop probability for a specific layer using exponential interpolation.
Sourcepub fn create_drop_paths(&self) -> TrainResult<Vec<DropPath>>
pub fn create_drop_paths(&self) -> TrainResult<Vec<DropPath>>
Create DropPath instances for all layers.
Trait Implementations§
Source§impl Clone for ExponentialStochasticDepth
impl Clone for ExponentialStochasticDepth
Source§fn clone(&self) -> ExponentialStochasticDepth
fn clone(&self) -> ExponentialStochasticDepth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExponentialStochasticDepth
impl RefUnwindSafe for ExponentialStochasticDepth
impl Send for ExponentialStochasticDepth
impl Sync for ExponentialStochasticDepth
impl Unpin for ExponentialStochasticDepth
impl UnwindSafe for ExponentialStochasticDepth
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
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>
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