pub struct LifelongOptimizer<A: Float, D: Dimension> { /* private fields */ }
Expand description
Lifelong optimizer that learns continuously across tasks
Implementations§
Source§impl<A: Float + ScalarOperand + Debug + Sum, D: Dimension> LifelongOptimizer<A, D>
impl<A: Float + ScalarOperand + Debug + Sum, D: Dimension> LifelongOptimizer<A, D>
Sourcepub fn new(strategy: LifelongStrategy) -> Self
pub fn new(strategy: LifelongStrategy) -> Self
Create a new lifelong optimizer
Sourcepub fn start_task(
&mut self,
task_id: String,
initial_parameters: Array<A, D>,
) -> Result<()>
pub fn start_task( &mut self, task_id: String, initial_parameters: Array<A, D>, ) -> Result<()>
Start learning a new task
Sourcepub fn update_current_task(
&mut self,
gradient: &Array<A, D>,
loss: A,
) -> Result<()>
pub fn update_current_task( &mut self, gradient: &Array<A, D>, loss: A, ) -> Result<()>
Update current task with new data
Sourcepub fn compute_task_similarity(&self, task1: &str, task2: &str) -> f64
pub fn compute_task_similarity(&self, task1: &str, task2: &str) -> f64
Compute task similarity
Sourcepub fn get_lifelong_stats(&self) -> LifelongStats<A>
pub fn get_lifelong_stats(&self) -> LifelongStats<A>
Get lifelong learning statistics
Trait Implementations§
Auto Trait Implementations§
impl<A, D> Freeze for LifelongOptimizer<A, D>where
D: Freeze,
impl<A, D> RefUnwindSafe for LifelongOptimizer<A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, D> Send for LifelongOptimizer<A, D>where
A: Send,
impl<A, D> Sync for LifelongOptimizer<A, D>where
A: Sync,
impl<A, D> Unpin for LifelongOptimizer<A, D>
impl<A, D> UnwindSafe for LifelongOptimizer<A, D>
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