Maison >développement back-end >Tutoriel Python >python实现梯度下降代码问题?
1. epsilon = 0.0001在此段代码中的作用是什么?在Minimize(Jtheta)以及Cost Function的公式用,都没有看到一个叫epsilon标识
<code class="language-python"><span class="k">if</span> <span class="nb">abs</span><span class="p">(</span><span class="n">error1</span><span class="o">-</span><span class="n">error0</span><span class="p">)</span> <span class="o"> <span class="n">epsilon</span><span class="p">:</span>
<span class="k">break</span>
</span></code>
epsilon就是收敛条件