mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 22:40:00 +00:00
Compare commits
1 Commits
0814ef9afe
...
274483c0e4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
274483c0e4 |
@ -242,22 +242,6 @@ mod tests {
|
|||||||
assert_eq!(preds.cols(), 1);
|
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]
|
#[test]
|
||||||
fn test_train_no_epochs_does_nothing() {
|
fn test_train_no_epochs_does_nothing() {
|
||||||
let config = DenseNNConfig {
|
let config = DenseNNConfig {
|
||||||
@ -512,6 +496,7 @@ mod tests {
|
|||||||
// Verify that weights and biases of both layers have changed,
|
// Verify that weights and biases of both layers have changed,
|
||||||
// implying delta propagation occurred for l > 0
|
// implying delta propagation occurred for l > 0
|
||||||
|
|
||||||
|
|
||||||
// Weights of first layer did not change, delta propagation might not have occurred
|
// Weights of first layer did not change, delta propagation might not have occurred
|
||||||
assert!(model.weights[0] != initial_weights_l0);
|
assert!(model.weights[0] != initial_weights_l0);
|
||||||
// Biases of first layer did not change, delta propagation might not have occurred
|
// Biases of first layer did not change, delta propagation might not have occurred
|
||||||
|
Loading…
x
Reference in New Issue
Block a user