pub struct GradientEmbeddingMethods {
pub batch_size: usize,
pub embedding_dim: usize,
pub gradient_method: String,
pub similarity_threshold: f64,
pub learning_rate: f64,
pub max_iter: usize,
pub random_state: Option<u64>,
}Expand description
Gradient Embedding Methods for active learning
This method uses gradient information from the model to select informative batches. It considers both the gradients with respect to model parameters and embedding representations to identify samples that would provide maximum learning benefit.
Fields§
§batch_size: usizebatch_size
embedding_dim: usizeembedding_dim
gradient_method: Stringgradient_method
similarity_threshold: f64similarity_threshold
learning_rate: f64learning_rate
max_iter: usizemax_iter
random_state: Option<u64>random_state
Implementations§
Source§impl GradientEmbeddingMethods
impl GradientEmbeddingMethods
pub fn new() -> Self
pub fn batch_size(self, batch_size: usize) -> Result<Self>
pub fn embedding_dim(self, embedding_dim: usize) -> Self
pub fn gradient_method(self, gradient_method: String) -> Self
pub fn similarity_threshold(self, similarity_threshold: f64) -> Self
pub fn learning_rate(self, learning_rate: f64) -> Self
pub fn max_iter(self, max_iter: usize) -> Self
pub fn random_state(self, random_state: u64) -> Self
pub fn query( &self, X: &ArrayView2<'_, f64>, probabilities: &ArrayView2<'_, f64>, ) -> Result<Vec<usize>>
Trait Implementations§
Source§impl Clone for GradientEmbeddingMethods
impl Clone for GradientEmbeddingMethods
Source§fn clone(&self) -> GradientEmbeddingMethods
fn clone(&self) -> GradientEmbeddingMethods
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 GradientEmbeddingMethods
impl Debug for GradientEmbeddingMethods
Auto Trait Implementations§
impl Freeze for GradientEmbeddingMethods
impl RefUnwindSafe for GradientEmbeddingMethods
impl Send for GradientEmbeddingMethods
impl Sync for GradientEmbeddingMethods
impl Unpin for GradientEmbeddingMethods
impl UnwindSafe for GradientEmbeddingMethods
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