In error() function, why are we returning -err/m. Why not err/m?
Why are we returning -err/m?
It is because formula for binary cross entropy is -y(log2(y_)) - (1-y) log2(1-y_) but in for loop we added the terms, so we introduced this negative sign while returning it .
Hope this cleared your doubt. 