1. 均方误差MSE
2. 交叉熵损失Cross Entropy Loss
2.1. 信息熵/信息增益
2.2. Cross Entropy
2.3. Classification
2.4. Why not MSE?
2.5. svm损失函数Hinge Loss
3. logits→CrossEntropy
4. Numerical Stability
import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
x = tf.random.normal([1,784])
w = tf.random.normal([784,2])
b = tf.zeros(2)
logits = x@w+b
print("前向传播结果:",logits.numpy())
prob = tf.math.softmax(logits, axis=1)
print("经过softmax数值为:",prob.numpy())
loss = tf.losses.categorical_crossentropy([0,1],logits,from_logits=True)
print("交叉熵数值为:{0}".format(loss))
5. 需要全套课程视频+PPT+代码资源可以私聊我
- 方式1:
CSDN
私信我! - 方式2:
QQ邮箱
:594042358@qq.com
或者直接加我QQ
:594042358
!