mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-10-04 13:19:25 +00:00
applied formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::compute::activations::{drelu, relu, sigmoid};
|
||||
use crate::matrix::{Matrix, SeriesOps};
|
||||
use crate::compute::activations::{relu, drelu, sigmoid};
|
||||
use rand::prelude::*;
|
||||
|
||||
/// Supported activation functions
|
||||
@@ -167,7 +167,11 @@ impl DenseNN {
|
||||
LossKind::BCE => self.loss.gradient(&y_hat, y),
|
||||
LossKind::MSE => {
|
||||
let grad = self.loss.gradient(&y_hat, y);
|
||||
let dz = self.activations.last().unwrap().derivative(zs.last().unwrap());
|
||||
let dz = self
|
||||
.activations
|
||||
.last()
|
||||
.unwrap()
|
||||
.derivative(zs.last().unwrap());
|
||||
grad.zip(&dz, |g, da| g * da)
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user