pub struct Rprop<T: Float + Send + Default> { /* private fields */ }Expand description
RPROP (Resilient Propagation) trainer An adaptive learning algorithm that only uses the sign of the gradient
Implementations§
Source§impl<T: Float + Send + Default> Rprop<T>
impl<T: Float + Send + Default> Rprop<T>
pub fn new() -> Self
pub fn with_parameters( self, increase_factor: T, decrease_factor: T, delta_min: T, delta_max: T, delta_zero: T, ) -> Self
pub fn with_error_function( self, error_function: Box<dyn ErrorFunction<T>>, ) -> Self
Trait Implementations§
Source§impl<T: Float + Send + Default> TrainingAlgorithm<T> for Rprop<T>
impl<T: Float + Send + Default> TrainingAlgorithm<T> for Rprop<T>
Source§fn train_epoch(
&mut self,
network: &mut Network<T>,
data: &TrainingData<T>,
) -> Result<T, TrainingError>
fn train_epoch( &mut self, network: &mut Network<T>, data: &TrainingData<T>, ) -> Result<T, TrainingError>
Train for one epoch
Source§fn calculate_error(&self, network: &Network<T>, data: &TrainingData<T>) -> T
fn calculate_error(&self, network: &Network<T>, data: &TrainingData<T>) -> T
Calculate the current error
Source§fn count_bit_fails(
&self,
network: &Network<T>,
data: &TrainingData<T>,
bit_fail_limit: T,
) -> usize
fn count_bit_fails( &self, network: &Network<T>, data: &TrainingData<T>, bit_fail_limit: T, ) -> usize
Count bit fails
Source§fn save_state(&self) -> TrainingState<T>
fn save_state(&self) -> TrainingState<T>
Save training state
Source§fn restore_state(&mut self, state: TrainingState<T>)
fn restore_state(&mut self, state: TrainingState<T>)
Restore training state
Source§fn set_callback(&mut self, callback: TrainingCallback<T>)
fn set_callback(&mut self, callback: TrainingCallback<T>)
Set a callback function
Source§fn call_callback(
&mut self,
epoch: usize,
network: &Network<T>,
data: &TrainingData<T>,
) -> bool
fn call_callback( &mut self, epoch: usize, network: &Network<T>, data: &TrainingData<T>, ) -> bool
Call the callback if set
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Rprop<T>
impl<T> !Sync for Rprop<T>
impl<T> !UnwindSafe for Rprop<T>
impl<T> Freeze for Rprop<T>where
T: Freeze,
impl<T> Send for Rprop<T>
impl<T> Unpin for Rprop<T>where
T: Unpin,
impl<T> UnsafeUnpin for Rprop<T>where
T: UnsafeUnpin,
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> 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