cost function

上节回顾

Hypothesis:

Parameters:

Cost Function:

Simplified:

Cost function intuition Ⅰ

$h_{theta}(x)$ ——假设函数 $J(theta_{1})$ ——代价函数
(对固定的 $theta_{1}$ ,这是 $x$ 的函数)——hypothesis function ($theta_{1}$ 的函数)——cost function
$theta_{1} = 1$ , $h = x$ $J(1) = 0$
$theta_{1} = 0.5$ , $h = 0.5 x$ $J(0.5) = 0.58$
$theta_{1} = 0$ , $h = 0$ $J(0) = 2.3$

$J(theta_{1})$

Cost function intuition Ⅱ

Hypothesis:

Parameters:

Cost Function:

Simplified:

在含有两个参数的情况下, 代价函数(cost function)变为更加复杂.

3D_J

为了更方便的展示上图, 运用轮廓图.

countor_plot

通过将轮廓图展现的代价函数与原始的假设函数对应, 可以直观的了解代价函数.

contrast_between_h_and_J