损失函数
1 Square loss

2 Hinge loss
3 Logistic loss
4 Cross entropy loss
Using the alternative label convention
,so that
,
,so that
, the cross entropy loss is defined as
x = np.linspace(-3, 3, 1000)y_logit = np.log(1 + np.exp(-x)) / math.log(2)y_01 = x < 0y_hinge = 1 - xy_hinge[y_hinge < 0] = 0

浙公网安备 33010602011771号