My output is showing infinity or negative infinity for loss function. It should be 0 or 1.
w = np.random.randn(6)
x = np.random.randn(6)
b =1
z = np.dot(w,x) + b
# a is sigmoid
a = 1/1+np.exp(-z)
loss_function = -(np.dot(a,np.log(y) + np.dot((1-a),np.log(1-y))))
in case of y when i am using any values for y. it shows
-inf
or
inf
Can Someone explain me this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…