1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/// A sample of the given dataset

#[derive(Debug)]
pub struct Sample {
    pub inputs: Vec<f64>,
    pub outputs: Vec<f64>
}

impl Sample {
    pub fn new(inputs: Vec<f64>, outputs: Vec<f64>) -> Sample {
        Sample{
            inputs: inputs,
            outputs: outputs
        }
    }

    pub fn get_inputs_count(&self) -> usize {
        self.inputs.len()
    }

    pub fn get_outputs_count(&self) -> usize {
        self.outputs.len()
    }
}