pub struct EpisodeSampler { /* private fields */ }Expand description
Episode sampler for N-way K-shot tasks.
Generates episodes for episodic training in few-shot learning.
Implementations§
Source§impl EpisodeSampler
impl EpisodeSampler
Sourcepub fn new(n_way: usize, shot_type: ShotType, n_query: usize) -> Self
pub fn new(n_way: usize, shot_type: ShotType, n_query: usize) -> Self
Create a new episode sampler.
§Arguments
n_way- Number of classes per episodeshot_type- Number of shots per classn_query- Number of query examples per class
Sourcepub fn support_size(&self) -> usize
pub fn support_size(&self) -> usize
Get total support examples per episode.
Sourcepub fn query_size(&self) -> usize
pub fn query_size(&self) -> usize
Get total query examples per episode.
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get episode description.
Trait Implementations§
Source§impl Clone for EpisodeSampler
impl Clone for EpisodeSampler
Source§fn clone(&self) -> EpisodeSampler
fn clone(&self) -> EpisodeSampler
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 EpisodeSampler
impl RefUnwindSafe for EpisodeSampler
impl Send for EpisodeSampler
impl Sync for EpisodeSampler
impl Unpin for EpisodeSampler
impl UnwindSafe for EpisodeSampler
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