Fixed logistic_prime

This commit is contained in:
lluni 2023-02-04 20:22:00 +01:00
parent 9a88ef6071
commit e564f1de30
Signed by: lluni
GPG key ID: ACEEB468BC325D35

View file

@ -44,7 +44,7 @@ pub fn logistic(matrix: &Array1<f64>) -> Array1<f64> {
pub fn logistic_prime(matrix: &Array1<f64>) -> Array1<f64> { pub fn logistic_prime(matrix: &Array1<f64>) -> Array1<f64> {
let mut result = matrix.clone(); let mut result = matrix.clone();
result.mapv_inplace(|x| sigmoid(x * (1.0 - sigmoid(x)))); result.mapv_inplace(|x| sigmoid(x) * (1.0 - sigmoid(x)));
result result
} }