mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 07:40:00 +00:00
Compare commits
2 Commits
274483c0e4
...
0814ef9afe
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0814ef9afe | ||
![]() |
eebe772da6 |
@ -242,6 +242,22 @@ mod tests {
|
||||
assert_eq!(preds.cols(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Number of activation functions must match number of layers")]
|
||||
fn test_invalid_activation_count() {
|
||||
let config = DenseNNConfig {
|
||||
input_size: 2,
|
||||
hidden_layers: vec![3],
|
||||
activations: vec![ActivationKind::Relu], // Only one activation for two layers
|
||||
output_size: 1,
|
||||
initializer: InitializerKind::Uniform(0.1),
|
||||
loss: LossKind::MSE,
|
||||
learning_rate: 0.01,
|
||||
epochs: 0,
|
||||
};
|
||||
let _model = DenseNN::new(config);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_train_no_epochs_does_nothing() {
|
||||
let config = DenseNNConfig {
|
||||
@ -496,7 +512,6 @@ mod tests {
|
||||
// Verify that weights and biases of both layers have changed,
|
||||
// implying delta propagation occurred for l > 0
|
||||
|
||||
|
||||
// Weights of first layer did not change, delta propagation might not have occurred
|
||||
assert!(model.weights[0] != initial_weights_l0);
|
||||
// Biases of first layer did not change, delta propagation might not have occurred
|
||||
|
Loading…
x
Reference in New Issue
Block a user