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 has_nan(values: &[f32]) -> bool {
    values.iter().any(|v| v.is_nan())
}

pub fn has_inf(values: &[f32]) -> bool {
    values.iter().any(|v| !v.is_finite())
}

pub fn within_abs_bound(values: &[f32], bound: f32) -> bool {
    if !bound.is_finite() || bound < 0.0 {
        return false;
    }
    values.iter().all(|v| v.abs() <= bound)
}