第二周:神经网络基础

logistic函数

预测概率yhat = w^t * x +b,为了保证概率为1,使用sigmoid函数进行修正,
yhat = 1/(1+e-z)(wt+b)

损失函数和成本函数

利用loss function和cost function 可以来体现预测效果
(how well your parameters w and b are doing on the training set.)
loss function是单个的y的预测效果
公式: 损失函数
cost fuction 是对整体的预测情况进行表示,公式如下:
成本函数

w和b的调试(梯度下降法)

在这里插入图片描述成本函数J(w,b)是一个凸函数,要调w和b使成本函数达到最小值

在这里插入图片描述

反向传播和正向传播(导数)

一个数学公式,从左到右的进行计算即为正向传播,从右向左来求导数,为反向传播。
在程序中,也许关注的使f的最终的导数,用dvar表示。

广播

广播听起来感觉很高大上,但其实是一种矩阵的扩展。
例如,在计算矩阵A[1,2,3,4]*100时,是将100展开为【100,100,100,100】来计算
另外,在python中要尽量减少for循环,使用np.来计算矩阵。

具体实现

1、数据预处理
-Figure out the dimensions and shapes of the problem (m_train, m_test, num_px, …)
-Reshape the datasets such that each example is now a vector of size (num_px * num_px * 3, 1)
-“Standardize” the data
2、神经网络学习

  • Initialize the parameters of the model
  • Learn the parameters for the model by minimizing the cost
  • Use the learned parameters to make predictions (on the test set)
  • Analyse the results and conclude
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值