This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use ndarray::prelude::*; | |
| use ndarray_rand::RandomExt; | |
| use ndarray_rand::rand::distributions::Uniform; | |
| fn sigmoid(x: &Array2<f64>) -> Array2<f64> { | |
| x.mapv(|v| 1.0 / (1.0 + (-v).exp())) | |
| } | |
| // Pretrained weights | |
| struct Model { |