lin/
lin.rs

1use error_predictive_learning::*;
2
3pub fn lin(ws: &[f64]) -> f64 {
4    utils::cmp(20, 0.0, 10.0,
5        |x| 0.12345678987654321 - 9.876543210123456789 * x,
6        |x| ws[0] + ws[1] * x)
7}
8
9fn main() {
10    let settings = TrainingSettings {
11        accuracy_error: 0.0,
12        step: 0.0000000000000000000000000001,
13        max_iterations: 1000000000000,
14        error_predictions: 3,
15        reset_interval: 40200,
16        elasticity: 1.55,
17        debug: true,
18    };
19    let weights = [0.12345678970668006, -9.876543207050862];
20    println!("{:?}", train(settings, &weights, lin));
21}