()
| 297 | |
| 298 | #[test] |
| 299 | fn test_set_params() { |
| 300 | |
| 301 | let m = mat![ |
| 302 | 0.1, 0.2, 0.4; |
| 303 | 0.5, 2.0, 0.2 |
| 304 | ]; |
| 305 | |
| 306 | let n = NeuralNetwork::new() |
| 307 | .add_layer(3) |
| 308 | .add_layer(2) |
| 309 | .set_params(0, m.clone()); |
| 310 | |
| 311 | assert_eq!(n.layers(), 2); |
| 312 | assert_eq!(n.input_size(), 3); |
| 313 | assert_eq!(n.output_size(), 2); |
| 314 | |
| 315 | assert!(n.params[0].eq(&m)); |
| 316 | } |
| 317 | |
| 318 | #[test] |
| 319 | fn test_predict_two_layer() { |
nothing calls this directly
no test coverage detected