pub struct UncertaintySampler {
pub strategy: UncertaintyStrategy,
}Fields§
§strategy: UncertaintyStrategyImplementations§
Source§impl UncertaintySampler
impl UncertaintySampler
pub fn new(strategy: UncertaintyStrategy) -> Self
Sourcepub fn score(&self, probs: &[f64]) -> f64
pub fn score(&self, probs: &[f64]) -> f64
Score a probability distribution (softmax output). Higher score = more uncertain.
Sourcepub fn select_query(&self, candidates: &[Vec<f64>]) -> usize
pub fn select_query(&self, candidates: &[Vec<f64>]) -> usize
Given a batch of probability distributions (one per candidate), return the index of the most uncertain candidate.
Trait Implementations§
Source§impl Clone for UncertaintySampler
impl Clone for UncertaintySampler
Source§fn clone(&self) -> UncertaintySampler
fn clone(&self) -> UncertaintySampler
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 UncertaintySampler
impl RefUnwindSafe for UncertaintySampler
impl Send for UncertaintySampler
impl Sync for UncertaintySampler
impl Unpin for UncertaintySampler
impl UnsafeUnpin for UncertaintySampler
impl UnwindSafe for UncertaintySampler
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