pub struct DistillationConfigBuilder { /* private fields */ }Expand description
Builder for distillation configuration
Implementations§
Source§impl DistillationConfigBuilder
impl DistillationConfigBuilder
Sourcepub fn loss(self, loss: DistillationLoss) -> Self
pub fn loss(self, loss: DistillationLoss) -> Self
Sets the distillation loss
Sourcepub fn temperature(self, temp: f32) -> Self
pub fn temperature(self, temp: f32) -> Self
Sets the temperature
Sourcepub fn learning_rate(self, lr: f32) -> Self
pub fn learning_rate(self, lr: f32) -> Self
Sets the learning rate
Sourcepub fn batch_size(self, size: usize) -> Self
pub fn batch_size(self, size: usize) -> Self
Sets the batch size
Sourcepub fn optimizer(self, optimizer: OptimizerType) -> Self
pub fn optimizer(self, optimizer: OptimizerType) -> Self
Sets the optimizer type
Sourcepub fn lr_schedule(self, schedule: LearningRateSchedule) -> Self
pub fn lr_schedule(self, schedule: LearningRateSchedule) -> Self
Sets the learning rate schedule
Sourcepub fn early_stopping(self, early_stopping: Option<EarlyStopping>) -> Self
pub fn early_stopping(self, early_stopping: Option<EarlyStopping>) -> Self
Sets early stopping configuration
Sourcepub fn gradient_clip(self, clip: Option<f32>) -> Self
pub fn gradient_clip(self, clip: Option<f32>) -> Self
Sets gradient clipping threshold
Sourcepub fn validation_split(self, split: f32) -> Self
pub fn validation_split(self, split: f32) -> Self
Sets validation split ratio
Sourcepub fn num_classes(self, num: usize) -> Self
pub fn num_classes(self, num: usize) -> Self
Sets number of classes
Sourcepub fn build(self) -> DistillationConfig
pub fn build(self) -> DistillationConfig
Builds the configuration
Trait Implementations§
Source§impl Debug for DistillationConfigBuilder
impl Debug for DistillationConfigBuilder
Source§impl Default for DistillationConfigBuilder
impl Default for DistillationConfigBuilder
Source§fn default() -> DistillationConfigBuilder
fn default() -> DistillationConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DistillationConfigBuilder
impl RefUnwindSafe for DistillationConfigBuilder
impl Send for DistillationConfigBuilder
impl Sync for DistillationConfigBuilder
impl Unpin for DistillationConfigBuilder
impl UnsafeUnpin for DistillationConfigBuilder
impl UnwindSafe for DistillationConfigBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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