Example #1
0
        public NDArray <Type> Loss(NDArray <Type> y, NDArray <Type> p)
        {
            var p0 = NumDN.Clamp(p, 1e-15, 1 - 1e-15);

            return(-y *NumDN.Log(p0) - (1 - y) * NumDN.Log(1 - p0));
        }