成本函数-Intuition ll

Cost Function - Intuition II

A contour plot is a graph that contains many contour lines. A contour line of a two variable function has a constant value at all points of the same line. An example of such a graph is the one to the right below.


Taking any color and going along the 'circle', one would expect to get the same value of the cost function. For example, the three green points found on the green line above have the same value forJ(θ0,θ1)and as a result, they are found along the same line. The circled x displays the value of the cost function for the graph on the left whenθ0= 800 andθ1= -0.15. Taking another h(x) and plotting its contour plot, one gets the following graphs:


Whenθ0= 360 andθ1= 0, the value ofJ(θ0,θ1)in the contour plot gets closer to the center thus reducing the cost function error. Now giving our hypothesis function a slightly positive slope results in a better fit of the data.


The graph above minimizes the cost function as much as possible and consequently, the result ofθ1andθ0tend to be around 0.12 and 250 respectively. Plotting those values on our graph to the right seems to put our point in the center of the inner most 'circle'.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 青春每个人都有说不完的话,就像一千个观众里面就有一千个哈姆雷特一样。现在我们所经历的这个阶段,被所有人称...
    我是小黄豆016阅读 294评论 0 0
  • 上周末,几个高中同学又叫我去聚会,说是再过几天,有人要离开这个城市,以后各奔东西,聚会的日子不多了。 我没有犹豫,...
    浪子不浪阅读 582评论 4 2
  • 记:怀念的春天,怀念的过去。 最喧哗的花,亦是被忽视的花。 ------我曾以为迎春花被置之不理。 陌生的野花,只...
    林袅衣阅读 162评论 3 3
  • CAE工程师的自我修养 一个应届大学毕业生在相关技术和职场人际方面的成长日记。 年轻的疆域1·日本 年轻,就是要去...
    历奇阅读 210评论 0 0