quad/
quad.rs

1use error_predictive_learning::*;
2
3pub fn lin(ws: &[f64]) -> f64 {
4    utils::cmp(20, 0.0, 10.0,
5        |x| 0.123456789 - 9.87654321 * x + 0.123456789 * x * x,
6        |x| ws[0] + ws[1] * x + ws[2] * x * 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.12345666679385302, -9.876543156097174, 0.12345678422789191];
20    println!("{:?}", train(settings, &weights, lin));
21}