第一节-机器学习基本概念

machine learning ≈ looking for function

Different types of functions:

Regression(回归): The function outputs a scalar

Classification(分类): Given options(classes),the function outputs the correct one

structured learning(产生结构,创造)

How to find a function?

1.Function with unknown parameters

Model  : y = b + \omega{x{1}}

y是要预测的,x是已知的,b和w是要去寻找的(learn from data)

2.Define Loss from Training Data
Loss is a function of parameters ( L(b,w) )

Loss: how good a set of value is.

{​{e}_n}表示每组数据预测跟真实数据之间的误差 |{y}_n-\hat{y}|

Loss:L = {\frac{1}{N}}{} \sum_{n}^{}{​{e}_n}

Label 是正确的数值

3.Optimization(最优解) 

找到{w}^*,{b}^* = argminL

Gradient descent(梯度下降法)

1.(Randomly)Pick an inital value w^0

2.Compute  \frac{\partial L }{\partial w} |_w = w^0   

Negative -- increase w

Positive -- decrease w

\eta \frac{\partial L }{\partial w} |_w = w^0      (步长)

\eta: learning rate

整个过程中自己设定的东西叫hyperparameter

3. Update w iteratively

Linear models have severe limitation : Model Bias

激活函数

Sigmoid Function: y = csigmoid(b+w{x{1}})

ReLU

New Model : More Features

  y = b + w{x}_1 \rightarrow y = b + \sum_{i}{c}_i sigmoid({b}_i+{w}_i{x}_1)

y = b + \sum_{j}w_j{x}_j \rightarrow y = b + \sum_{i}{c}_i sigmoid({b}_i+\sum \sum_{j}{w}_i_j{x}_j)

1.Function with unknown

 y = b + c^T\sigma (b+Wx)

2.Define loss from training data 

Loss :  L(\theta )

3.Optimization

\theta ^* = arg min L                 \theta = \begin{bmatrix} \theta_1 & \theta_2 & \theta_3 ...\end{bmatrix}^T

1.(Randomly)Pick initial values \theta ^0

2.Compute gradient g

g = \begin{bmatrix} \frac{\partial L }{\partial \theta_1}| \theta = \theta^0 & \frac{\partial L }{\partial \theta_2 }|\theta = \theta^0... \end{bmatrix}^T  (gradient)

简写为 \theta^1 \leftarrow \theta^0 - \eta g

Batch : 将一组数据分成很多个batch,它的size自己决定

这样可以得到L1, 根据L1计算 \theta^1 .....

1 epotch = see all the batches once

Rectified Linear Unit(ReLU) :  cmax(0,b + wx1)

Sigmoid \rightarrow ReLU

y = b + \sum_{2i}{c}_i max({b}_i+\sum \sum_{j}{w}_i_j{x}_j)

只要够多的激活函数就可以逼近任何function

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值