Coursera-MachineLearning Note-Week 5

Posted zsytony

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Coursera-MachineLearning Note-Week 5相关的知识,希望对你有一定的参考价值。

MachineLearning Note-Week 5

Lecture 9-Neural Networks:Learning

1. Cost function (代价函数)

神经网络的基本结构
其中

  • 训练集是: (x(1),y(1)),...,(x(m),y(m))
  • L =神经网络的层数
  • sl=l()

对于一个分类问题有两种情况:
- Binary Classification : y = 0 or =1. Output Layer 有一个神经元
- Multi-Class Classificaiton:
神经网络的输出层上有K个输出单元

1.1 Cost function

Logistic Regression

J(θ)=1m[i=1my(i)log(hθ(x(i)))(1y(i))log(1hθ(x(i)))]+λ2mj=1nθ2j
向量化之后应为
Xn×(m+1)
yn×1
θ(m+1)×1

neural networks

神经网络中的输出层通常有多个输出,属于K维向量,cost function定义如下:

hΘ(x)Rk,hΘ(x)=ΘTX,(hΘ(x))i=ithoutput
J(Θ)=1m[i=1mk=1Ky(i)klog(hθ(x(i)))k(1y(i)k)log(1(hθ(x(i)))k

(c)2006-2019 SYSTEM All Rights Reserved IT常识