Struct ritenn::Trainer [−][src]
Used to specify options that dictate how a network will be trained
Implementations
impl<'a, 'b> Trainer<'a, 'b>
[src]
Trainer
is used to chain together options that specify how to train a network.
All of the options are optional because the Trainer
struct
has default values built in for each option. The go()
method must
be called however or the network will not be trained.
pub fn rate(&mut self, rate: f64) -> &mut Trainer<'a, 'b>
[src]
Specifies the learning rate to be used when training (default is 0.3
)
This is the step size that is used in the backpropagation algorithm.
pub fn lambda(&mut self, lambda: f64) -> &mut Trainer<'a, 'b>
[src]
Specifies the lambda factor for L2 regularization used when training (default is 0.0)
pub fn momentum(&mut self, momentum: f64) -> &mut Trainer<'a, 'b>
[src]
Specifies the momentum to be used when training (default is 0.0
)
pub fn log_interval(
&mut self,
log_interval: Option<u32>
) -> &mut Trainer<'a, 'b>
[src]
&mut self,
log_interval: Option<u32>
) -> &mut Trainer<'a, 'b>
Specifies how often (measured in batches) to log the current error rate (mean squared error) during training.
Some(x)
means log after every x
batches and None
means never log
pub fn halt_condition(
&mut self,
halt_condition: HaltCondition
) -> &mut Trainer<'a, 'b>
[src]
&mut self,
halt_condition: HaltCondition
) -> &mut Trainer<'a, 'b>
Specifies when to stop training. Epochs(x)
will stop the training after
x
epochs (one epoch is one loop through all of the training examples)
while MSE(e)
will stop the training when the error rate
is at or below e
. Timer(d)
will halt after the duration d
has
elapsed.
pub fn learning_mode(
&mut self,
learning_mode: LearningMode
) -> &mut Trainer<'a, 'b>
[src]
&mut self,
learning_mode: LearningMode
) -> &mut Trainer<'a, 'b>
Specifies what mode to train the network in.
Incremental
means update the weights in the network after every example.
pub fn go(&mut self) -> f64
[src]
When go
is called, the network will begin training based on the
options specified. If go
does not get called, the network will not
get trained!
Trait Implementations
Auto Trait Implementations
impl<'a, 'b> RefUnwindSafe for Trainer<'a, 'b>
impl<'a, 'b> Send for Trainer<'a, 'b>
impl<'a, 'b> Sync for Trainer<'a, 'b>
impl<'a, 'b> Unpin for Trainer<'a, 'b>
impl<'a, 'b> !UnwindSafe for Trainer<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,