Basics of Neural Network

Basics of Neural Network

1. Binary classification——logistic regression

Logistic regression model:

  • Problems: Given x, want \(\hat{y}=P \left\{y=1|x\right\} (0 \leq \hat{y} \leq 1)\)
  • Parameters: \(\omega\in R^{n_x},b \in R\)
  • Output: \(\hat{y}=sigmoid(\omega^Tx+b)\)

Training sets:(\(m\) is the number of training sets)

\(\left\{(x^{(1)},y^{(1)}),(x^{(2)},y^{(2)}),…,(x^{(m)},y^{(m)})\right\}\)

​ the i_th sample input vector: \(x^{(i)}\) is a (\(n_x\),1) vector

​ the input matrix : \(X=[x^{(1)},x^{(2)},…,x^{(m)}]\)

​ the output matrix : \(Y=[y^{(1)},y^{(2)},…,y^{(m)}]\)

2.Cost function——to train parameters \(\omega\) and \(b\)

loss function : \(L(\hat y,y)=-(ylog(\hat y)+(1-y)log(1-\hat y))\)

cost function : \(J(\omega,b)=\frac{1}{m}\sum\limits_{k=1}^m{L(\hat y^{i},y^i)}=-\frac{1}{m}\sum\limits_{k=1}^m{[y^ilog \hat y^i +(1-y^i)log(1-log \hat y^i)}\)

Cost function is used to measure how well you're doing an entire training set.

Note : \(L(\hat y,y)=\frac{1}{2}{(\hat y-y)}^2\) this form is not a good choice, when using gradient descent, the problem will be non-convex.

3.Gradient descent——to make the cost function \(J\) as small as possible

Repeat : \(\omega =\omega - \alpha \frac{dJ(\omega)}{d\omega}\)

(\(\alpha\) is the learning rate)

转载于:https://www.cnblogs.com/mticket/p/9177734.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值