pub struct SampleQueue { /* private fields */ }Expand description
Active learning sample queue.
Implementations§
Source§impl SampleQueue
impl SampleQueue
Sourcepub fn new(strategy: SelectionStrategy) -> Self
pub fn new(strategy: SelectionStrategy) -> Self
Create a new sample queue.
Sourcepub fn with_max_pending(self, max: usize) -> Self
pub fn with_max_pending(self, max: usize) -> Self
Set maximum pending queue size.
Sourcepub fn strategy(&self) -> SelectionStrategy
pub fn strategy(&self) -> SelectionStrategy
Get selection strategy.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get pending count.
Sourcepub fn labeled_count(&self) -> usize
pub fn labeled_count(&self) -> usize
Get labeled count.
Sourcepub fn total_processed(&self) -> u64
pub fn total_processed(&self) -> u64
Get total processed.
Sourcepub fn enqueue(&mut self, sample: UncertainSample) -> u64
pub fn enqueue(&mut self, sample: UncertainSample) -> u64
Add an uncertain sample to the queue.
Sourcepub fn next_for_labeling(&mut self) -> Option<UncertainSample>
pub fn next_for_labeling(&mut self) -> Option<UncertainSample>
Get next sample for labeling (highest uncertainty).
Sourcepub fn peek_next(&self) -> Option<&UncertainSample>
pub fn peek_next(&self) -> Option<&UncertainSample>
Peek at next sample without removing.
Sourcepub fn batch_for_labeling(&mut self, n: usize) -> Vec<UncertainSample>
pub fn batch_for_labeling(&mut self, n: usize) -> Vec<UncertainSample>
Get top N samples for batch labeling.
Sourcepub fn submit_labeled(&mut self, sample: UncertainSample)
pub fn submit_labeled(&mut self, sample: UncertainSample)
Submit a labeled sample.
Sourcepub fn get_labeled_samples(&self) -> &[UncertainSample]
pub fn get_labeled_samples(&self) -> &[UncertainSample]
Get all labeled samples for training.
Sourcepub fn take_labeled_samples(&mut self) -> Vec<UncertainSample>
pub fn take_labeled_samples(&mut self) -> Vec<UncertainSample>
Take labeled samples (moves them out).
Sourcepub fn clear_pending(&mut self)
pub fn clear_pending(&mut self)
Clear all pending samples.
Sourcepub fn stats(&self) -> QueueStats
pub fn stats(&self) -> QueueStats
Get statistics.
Trait Implementations§
Source§impl Clone for SampleQueue
impl Clone for SampleQueue
Source§fn clone(&self) -> SampleQueue
fn clone(&self) -> SampleQueue
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 moreSource§impl Debug for SampleQueue
impl Debug for SampleQueue
Source§impl Default for SampleQueue
impl Default for SampleQueue
Source§impl<'de> Deserialize<'de> for SampleQueue
impl<'de> Deserialize<'de> for SampleQueue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SampleQueue
impl RefUnwindSafe for SampleQueue
impl Send for SampleQueue
impl Sync for SampleQueue
impl Unpin for SampleQueue
impl UnwindSafe for SampleQueue
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