matrux 0.1.0

Neural network implementation in rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Scalar;

use super::LearningRate;

pub struct ExponentialLearningRate<I: Scalar> {
    initial: I,
    decay_steps: I,
    decay_rate: I,
}

impl<I: Scalar> LearningRate<I> for ExponentialLearningRate<I> {
    fn rate(&self, step: usize) -> I {
        self.initial * self.decay_rate.power(I::from_f64(step as f64) / self.decay_steps)
    }
}