We need to remember this:
1、Understand the cost functionIn order to simplify:
Use h θ ( x ) = θ 1 x h_theta(x)=theta_1x hθ(x)=θ1x
Each value of theta one corresponds to a different hypothesis(不同的 θ 1 theta_1 θ1对应不同的假设函数) .And for each value of theta one( θ 1 theta_1 θ1), We could then derive a different value of J of theta one( J ( θ 1 ) J(theta_1) J(θ1))
For example: Here are a data set, include three point(1, 1)、point(2, 2)、point(3, 3).
2、What the cost function is doingHere is the training set of housing prices:
Let’s make some hypothesis:
Such as: θ 1 = 0.06 , θ 0 = 50 theta_1 = 0.06,quad theta_0=50 θ1=0.06,θ0=50… We can also draw the corresponding J ( θ 0 , θ 1 ) J(theta_0,theta_1) J(θ0,θ1), and the figure is shown below:
the axes are labeled θ 0 theta_0 θ0 and θ 1 theta_1 θ1 , As we vary θ 0 theta_0 θ0 and θ 1 theta_1 θ1, the two parameters, we get different values of the cost function J ( θ 0 , θ 1 ) J(theta_0,theta_1) J(θ0,θ1), and the height of the surface of the points indicates the value of J J J of θ 0 theta_0 θ0 and θ 1 theta_1 θ1
NOW for the purpose of illustration in the rest of this note, we are not actually going to use these sort of 3D surfaces to show the cost function J, instead we are going to use contour plots(等高线,越靠近圆心值越小), for example:
As is shown above, each of these ovals, what each of these ellipses shows is a set of points that takes on the same value for J ( θ 0 , θ 1 ) J(theta_0,theta_1) J(θ0,θ1). Think about the values of of the cost function J , how that corresponds to different hypothesis, as how better hypothesis may corresponds to points that are closer to the minimum of this cost function J.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)