mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:19:59 +00:00
applied formatting
This commit is contained in:
parent
75d07371b2
commit
46abeb12a7
@ -1,5 +1,5 @@
|
|||||||
|
use crate::compute::activations::{drelu, relu, sigmoid};
|
||||||
use crate::matrix::{Matrix, SeriesOps};
|
use crate::matrix::{Matrix, SeriesOps};
|
||||||
use crate::compute::activations::{relu, drelu, sigmoid};
|
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
|
|
||||||
/// Supported activation functions
|
/// Supported activation functions
|
||||||
@ -167,7 +167,11 @@ impl DenseNN {
|
|||||||
LossKind::BCE => self.loss.gradient(&y_hat, y),
|
LossKind::BCE => self.loss.gradient(&y_hat, y),
|
||||||
LossKind::MSE => {
|
LossKind::MSE => {
|
||||||
let grad = self.loss.gradient(&y_hat, y);
|
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)
|
grad.zip(&dz, |g, da| g * da)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user