繁体   English   中英

在TensorFlow中停止渐变优化器

[英]stopping gradient optimizer in TensorFlow

我正在尝试在Tensorflow中构建一个简单的神经网络,但我有一个关于梯度优化的问题。

这可能是一个天真的问题,但我是否必须设置条件来停止优化器? 下面是我的网络打印输出示例,您可以看到迭代后(所有数据的批量梯度下降)66,成本开始再次增加。 那么要确保优化器在此时停止吗? (注意:我没有在这里输出所有输出,但随着迭代次数的增加,成本开始呈指数级增长)。

谢谢你的指导。

iteration 64 with average cost of 654.621 and diff of 0.462708
iteration 65 with average cost of 654.364 and diff of 0.257202
iteration 66 with average cost of 654.36 and diff of 0.00384521 
iteration 67 with average cost of 654.663 and diff of -0.302368
iteration 68 with average cost of 655.328 and diff of -0.665161
iteration 69 with average cost of 656.423 and diff of -1.09497
iteration 70 with average cost of 658.011 and diff of -1.58826

这是正确的 - TensorFlow tf.train.Optimizer类公开了一个操作,你可以运行一个(梯度下降式)步骤 ,但它们不监视成本的当前值或决定何时停止,所以你可能会看到一旦网络开始过度增加,成本就会增加。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM