public Matrix <double> Backward(Matrix <double> A_prev, Matrix <double> dA_next) { dZ = ElementWiseMultiply(dA_next, _activation.ActivateDerivative(Z)); dW = (1 / (double)BatchSize) * (dZ * A_prev.Transpose()); dB = (1 / (double)BatchSize) * BuildBiasMatrix(Matrix <double> .Build.DenseOfColumnVectors(dZ.RowSums())); dA = W.Transpose() * dZ; return(dA); }