native_neural_network 0.1.6

Lib no_std Rust for native neural network (.rnn)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub fn reduce_sum(values: &[f32]) -> f32 {
    let mut acc = 0.0f32;
    for &v in values {
        acc += v;
    }
    acc
}

pub fn reduce_mean(values: &[f32]) -> Option<f32> {
    if values.is_empty() {
        return None;
    }
    Some(reduce_sum(values) / values.len() as f32)
}