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

Function test_params

src/nn.rs:521–536  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

519
520 #[test]
521 fn test_params() {
522
523 let params1 = mat![ 0.1, 0.2, 0.4; 0.2, 0.1, 2.0 ];
524 let params2 = mat![ 0.8, 1.2, 0.6; 0.4, 0.5, 0.8;
525 1.4, 1.5, 2.0
526 ];
527 let n = NeuralNetwork::new()
528 .add_layer(3)
529 .add_layer(2)
530 .add_layer(3)
531 .set_params(0, params1.clone())
532 .set_params(1, params2.clone());
533 let p = n.params();
534 assert!(p[0].eq(&params1));
535 assert!(p[1].eq(&params2));
536 }
537}
538

Callers

nothing calls this directly

Calls 3

set_paramsMethod · 0.80
add_layerMethod · 0.80
paramsMethod · 0.45

Tested by

no test coverage detected