pub struct TransferLearningManager {
pub freezing_config: LayerFreezingConfig,
pub progressive_unfreezing: Option<ProgressiveUnfreezing>,
pub discriminative_finetuning: Option<DiscriminativeFineTuning>,
/* private fields */
}Expand description
Transfer learning strategy manager.
Fields§
§freezing_config: LayerFreezingConfigLayer freezing configuration.
progressive_unfreezing: Option<ProgressiveUnfreezing>Optional progressive unfreezing strategy.
discriminative_finetuning: Option<DiscriminativeFineTuning>Optional discriminative fine-tuning.
Implementations§
Source§impl TransferLearningManager
impl TransferLearningManager
Sourcepub fn with_progressive_unfreezing(
self,
strategy: ProgressiveUnfreezing,
) -> Self
pub fn with_progressive_unfreezing( self, strategy: ProgressiveUnfreezing, ) -> Self
Sourcepub fn with_discriminative_finetuning(
self,
config: DiscriminativeFineTuning,
) -> Self
pub fn with_discriminative_finetuning( self, config: DiscriminativeFineTuning, ) -> Self
Sourcepub fn with_feature_extraction(
self,
mode: FeatureExtractorMode,
all_layers: &[String],
) -> Self
pub fn with_feature_extraction( self, mode: FeatureExtractorMode, all_layers: &[String], ) -> Self
Set feature extraction mode.
§Arguments
mode- Feature extraction configurationall_layers- All layer names in the model
Sourcepub fn on_epoch_begin(&mut self, epoch: usize)
pub fn on_epoch_begin(&mut self, epoch: usize)
Sourcepub fn should_update_layer(&self, layer_name: &str) -> bool
pub fn should_update_layer(&self, layer_name: &str) -> bool
Sourcepub fn get_layer_lr(&self, layer_name: &str, base_lr: f64) -> f64
pub fn get_layer_lr(&self, layer_name: &str, base_lr: f64) -> f64
Sourcepub fn current_epoch(&self) -> usize
pub fn current_epoch(&self) -> usize
Get current epoch.
Trait Implementations§
Source§impl Debug for TransferLearningManager
impl Debug for TransferLearningManager
Auto Trait Implementations§
impl Freeze for TransferLearningManager
impl RefUnwindSafe for TransferLearningManager
impl Send for TransferLearningManager
impl Sync for TransferLearningManager
impl Unpin for TransferLearningManager
impl UnwindSafe for TransferLearningManager
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> 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