native_neural_network 0.3.1

Lib no_std Rust for native neural network (.rnn)
Documentation
1
2
3
4
5
6
7
8
9
10
11
pub fn rope_angle_f32(position: usize, pair_index: usize, hidden_size: usize, theta: f32) -> f32 {
    let exp = (2.0 * pair_index as f32) / hidden_size as f32;
    let denom = crate::math::powf(theta, exp);
    (position as f32) / denom
}

pub fn rope_angle_f64(position: usize, pair_index: usize, hidden_size: usize, theta: f64) -> f64 {
    let exp = (2.0 * pair_index as f64) / hidden_size as f64;
    let denom = crate::math::powd(theta, exp);
    (position as f64) / denom
}