snowkylin / tensorflow-handbook

简单粗暴 TensorFlow 2 | A Concise Handbook of TensorFlow 2 | 一本简明的 TensorFlow 2 入门指导教程
https://tf.wiki
3.94k stars 841 forks source link

chapter basic 中的均方差损失函数是不是有问题? #23

Closed nu007a closed 4 years ago

nu007a commented 4 years ago

原文中是1/2,应该是1/n吧

snowkylin commented 4 years ago

1/2 is for the convenience of derivation (so f'(x) have a factor of 1/2 * 2 = 1). 1/n is okay but does not affect the optimization when n is fixed.