diff --git a/02.recognize_digits/README.cn.md b/02.recognize_digits/README.cn.md index 110ee1219903f867199ee4115583db2c7b7aca7d..01a5c6e7e5a3f0be4bce5c0786e9927dc5a74932 100644 --- a/02.recognize_digits/README.cn.md +++ b/02.recognize_digits/README.cn.md @@ -38,9 +38,9 @@ $$ y_i = \text{softmax}(\sum_j W_{i,j}x_j + b_i) $$ 对于有 $N$ 个类别的多分类问题,指定 $N$ 个输出节点,$N$ 维结果向量经过softmax将归一化为 $N$ 个[0,1]范围内的实数值,分别表示该样本属于这 $N$ 个类别的概率。此处的 $y_i$ 即对应该图片为数字 $i$ 的预测概率。 -在分类问题中,我们一般采用交叉熵代价损失函数(cross entropy),公式如下: +在分类问题中,我们一般采用交叉熵代价损失函数(cross entropy loss),公式如下: -$$ \text{crossentropy}(label, y) = -\sum_i label_ilog(y_i) $$ +$$ \text{_L_cross-entropy}(label, y) = -\sum_i label_ilog(y_i) $$ 图2为softmax回归的网络图,图中权重用蓝线表示、偏置用红线表示、+1代表偏置参数的系数为1。 @@ -419,7 +419,7 @@ img = load_image(cur_dir + '/image/infer_3.png') ```python results = inferencer.infer({'img': img}) lab = np.argsort(results) # probs and lab are the results of one batch data -print "Label of image/infer_3.png is: %d" % lab[0][0][-1] +print "Inference result of image/infer_3.png is: %d" % lab[0][0][-1] ``` ## 总结 diff --git a/02.recognize_digits/index.cn.html b/02.recognize_digits/index.cn.html index 6a7e018ce26d66cffe5676381cb37e551fe44adc..da3ea3c51fa5d47e4c1841658a42b91d22a48ee1 100644 --- a/02.recognize_digits/index.cn.html +++ b/02.recognize_digits/index.cn.html @@ -80,9 +80,9 @@ $$ y_i = \text{softmax}(\sum_j W_{i,j}x_j + b_i) $$ 对于有 $N$ 个类别的多分类问题,指定 $N$ 个输出节点,$N$ 维结果向量经过softmax将归一化为 $N$ 个[0,1]范围内的实数值,分别表示该样本属于这 $N$ 个类别的概率。此处的 $y_i$ 即对应该图片为数字 $i$ 的预测概率。 -在分类问题中,我们一般采用交叉熵代价损失函数(cross entropy),公式如下: +在分类问题中,我们一般采用交叉熵代价损失函数(cross entropy loss),公式如下: -$$ \text{crossentropy}(label, y) = -\sum_i label_ilog(y_i) $$ +$$ \text{_L_cross-entropy}(label, y) = -\sum_i label_ilog(y_i) $$ 图2为softmax回归的网络图,图中权重用蓝线表示、偏置用红线表示、+1代表偏置参数的系数为1。 @@ -461,7 +461,7 @@ img = load_image(cur_dir + '/image/infer_3.png') ```python results = inferencer.infer({'img': img}) lab = np.argsort(results) # probs and lab are the results of one batch data -print "Label of image/infer_3.png is: %d" % lab[0][0][-1] +print "Inference result of image/infer_3.png is: %d" % lab[0][0][-1] ``` ## 总结