tensorflow-tutorial icon indicating copy to clipboard operation
tensorflow-tutorial copied to clipboard

第四章 4.2.2节自定义损失函数 示例代码运行结果和书上不一致

Open youlingwangzi opened this issue 6 years ago • 3 comments

What happened: 使用了相同的代码,但是代码运行结果不一致。 What you expected to happen: 我的代码如下:我的代码

代码运行结果: [[-0.81131774] [ 1.4845992 ]] [[-0.8106414] [ 1.485216 ]] [[-0.80985266] [ 1.4859272 ]] [[-0.80899984] [ 1.4866718 ]] [[-0.80812407] [ 1.4874339 ]] Final: [[-0.8072287] [ 1.4882191]]

书上预期的结果:

w1最终的值为: [1.01934695, 1.04280889] 在loss_more为10,loss_less为1的情况下,w1的值为: [0.95525807, 0.9813394]

youlingwangzi avatar Jun 24 '18 16:06 youlingwangzi

反向传播的优化方法不一致吧tf.train.AdamOptimizer

HenryChou0 avatar Aug 21 '18 13:08 HenryChou0

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

/lifecycle stale

caicloud-bot avatar Nov 19 '18 13:11 caicloud-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

caicloud-bot avatar Dec 19 '18 14:12 caicloud-bot