pub struct TransferLearning<A: Float + Send + Sync> { /* private fields */ }Expand description
Transfer learning system: stores per-source-domain experiences and replays them into a target domain, weighted by measured domain similarity.
Implementations§
Source§impl<A: Float + Send + Sync + Clone> TransferLearning<A>
impl<A: Float + Send + Sync + Clone> TransferLearning<A>
Sourcepub fn set_strategies(
&mut self,
strategies: Vec<TransferStrategy>,
) -> Result<(), String>
pub fn set_strategies( &mut self, strategies: Vec<TransferStrategy>, ) -> Result<(), String>
Requests a specific set of transfer strategies.
Returns an error naming any strategy this crate cannot carry out, rather than accepting it and silently substituting instance transfer.
Sourcepub fn strategies(&self) -> &[TransferStrategy]
pub fn strategies(&self) -> &[TransferStrategy]
Strategies currently in force.
Sourcepub fn register_source(
&mut self,
source_id: String,
experiences: Vec<MetaExperience<A>>,
characteristics: Vec<A>,
)
pub fn register_source( &mut self, source_id: String, experiences: Vec<MetaExperience<A>>, characteristics: Vec<A>, )
Registers a source domain’s experiences and characteristic vector.
Sourcepub fn source_domain_count(&self) -> usize
pub fn source_domain_count(&self) -> usize
Number of registered source domains.
Sourcepub fn metrics(&self) -> &TransferMetrics<A>
pub fn metrics(&self) -> &TransferMetrics<A>
Measured transfer outcomes.
Sourcepub fn domain_similarity(&self) -> Option<A>
pub fn domain_similarity(&self) -> Option<A>
Similarity between the registered source and the last reported target.
Sourcepub fn select_transfer_batch(
&mut self,
target_characteristics: Vec<A>,
limit: usize,
) -> Vec<MetaExperience<A>>
pub fn select_transfer_batch( &mut self, target_characteristics: Vec<A>, limit: usize, ) -> Vec<MetaExperience<A>>
Selects source experiences to replay into a target domain described by
target_characteristics.
Returns an empty vector when there is no registered source, when the
domains are not similar enough (below MIN_TRANSFER_SIMILARITY), or
when the similarity cannot be computed — all of which are honest
“nothing to transfer” outcomes rather than errors.
Sourcepub fn record_transfer_outcome(&mut self, reward_before: A, reward_after: A)
pub fn record_transfer_outcome(&mut self, reward_before: A, reward_after: A)
Records the outcome of a completed transfer: the target’s reward before and after replaying the transferred experiences.
Trait Implementations§
Source§impl<A: Clone + Float + Send + Sync> Clone for TransferLearning<A>
impl<A: Clone + Float + Send + Sync> Clone for TransferLearning<A>
Source§fn clone(&self) -> TransferLearning<A>
fn clone(&self) -> TransferLearning<A>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<A> Freeze for TransferLearning<A>where
A: Freeze,
impl<A> RefUnwindSafe for TransferLearning<A>where
A: RefUnwindSafe,
impl<A> Send for TransferLearning<A>
impl<A> Sync for TransferLearning<A>
impl<A> Unpin for TransferLearning<A>where
A: Unpin,
impl<A> UnsafeUnpin for TransferLearning<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for TransferLearning<A>where
A: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.