- 博客(1)
- 收藏
- 关注
原创 深度学习计算成本:cost = inf,RuntimeWarning: divide by zero encountered in log
"计算成本" def compute_cost(AL, Y): m = Y.shape[1] logprobs = np.multiply(np.log(AL), Y) + np.multiply(np.log(1-AL), (1-Y)) cost = (-1 / m) * np.sum(logprobs) cost = np.squeeze(cost) assert(cost.shape == ()) return cost #test compute.
2021-08-14 11:21:43 765
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人