![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度学习
kkkmmmsss123456s
长风直挂
展开
-
Jupyter notebook中运行代码,代码运行没问题却出现警告。
源码: #阶跃函数 import numpy as np import matplotlib.pylab as plt def step_function(x): return np.array(x > 0, dtype = np.int) #重点关注 x = np.arange(-5.0, 5.0, 0.1) y = step_function(x) plt.plot(x, y) plt.ylim(-0.1, 1.1) plt.show() 警告: <ipyt.原创 2021-10-16 20:15:55 · 1350 阅读 · 0 评论 -
交叉熵误差中delta = 1e-7格式错误将导致代码运行失败
源代码(有错误): #交叉熵误差 #设“2”为正确解 t = [0, 0, 1, 0, 0, 0, 0, 0, 0, 0] #定义mse函数 def cross_entropy_error(y, t): delta = 1e- 7 return -np.sum(t * np.log(y + delta)) #例1:”2“的概率最高的情况(0.6) y = [0.1, 0.05, 0.6, 0.0, 0.05, 0.1, 0.0, 0.1, 0.0, 0.0] mse_1=cros原创 2021-10-16 19:52:14 · 1006 阅读 · 1 评论