MCPcopy Create free account
hub / github.com/daniel-e/rustml / test_set_params

Function test_set_params

src/nn.rs:299–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

set_paramsMethod · 0.80
add_layerMethod · 0.80

Tested by

no test coverage detected