pub struct TransferLearningOrchestrator<F: Float + Debug> { /* private fields */ }
Expand description
Advanced transfer learning orchestrator
Implementations§
Source§impl<F: Float + Debug + 'static + FromPrimitive + Clone + Zero + Add<Output = F> + Div<Output = F>> TransferLearningOrchestrator<F>
impl<F: Float + Debug + 'static + FromPrimitive + Clone + Zero + Add<Output = F> + Div<Output = F>> TransferLearningOrchestrator<F>
Sourcepub fn new(
strategy: TransferStrategy,
base_learning_rate: f64,
init_strategy: WeightInitStrategy,
) -> Result<Self>
pub fn new( strategy: TransferStrategy, base_learning_rate: f64, init_strategy: WeightInitStrategy, ) -> Result<Self>
Create new transfer learning orchestrator
Sourcepub fn with_domain_adaptation(&mut self, method: AdaptationMethod)
pub fn with_domain_adaptation(&mut self, method: AdaptationMethod)
Enable domain adaptation
Sourcepub fn with_model_surgery(&mut self, surgery: ModelSurgery)
pub fn with_model_surgery(&mut self, surgery: ModelSurgery)
Enable model surgery
Sourcepub fn load_pretrained_weights(
&mut self,
weights: HashMap<String, ArrayD<f32>>,
) -> Result<()>
pub fn load_pretrained_weights( &mut self, weights: HashMap<String, ArrayD<f32>>, ) -> Result<()>
Load pretrained weights
Sourcepub fn setup_transfer_learning(
&mut self,
layer_names: &[String],
expected_shapes: Option<&HashMap<String, Vec<usize>>>,
) -> Result<TransferLearningSetupReport>
pub fn setup_transfer_learning( &mut self, layer_names: &[String], expected_shapes: Option<&HashMap<String, Vec<usize>>>, ) -> Result<TransferLearningSetupReport>
Setup transfer learning for a model
Sourcepub fn get_effective_learning_rate(&self, layer_name: &str) -> F
pub fn get_effective_learning_rate(&self, layer_name: &str) -> F
Get effective learning rate for a layer considering all factors
Sourcepub fn adapt_features(
&self,
layer_name: &str,
features: &ArrayD<F>,
) -> Result<ArrayD<F>>
pub fn adapt_features( &self, layer_name: &str, features: &ArrayD<F>, ) -> Result<ArrayD<F>>
Apply domain adaptation to features
Sourcepub fn update_epoch(&mut self, epoch: usize) -> Result<()>
pub fn update_epoch(&mut self, epoch: usize) -> Result<()>
Update transfer learning state for new epoch
Auto Trait Implementations§
impl<F> Freeze for TransferLearningOrchestrator<F>where
F: Freeze,
impl<F> RefUnwindSafe for TransferLearningOrchestrator<F>where
F: RefUnwindSafe,
impl<F> Send for TransferLearningOrchestrator<F>
impl<F> Sync for TransferLearningOrchestrator<F>
impl<F> Unpin for TransferLearningOrchestrator<F>where
F: Unpin,
impl<F> UnwindSafe for TransferLearningOrchestrator<F>where
F: UnwindSafe + RefUnwindSafe,
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