xsin/
xsin.rs

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