当前位置: 首页 > news >正文

下载类网站开发条件做引流推广的平台600

下载类网站开发条件,做引流推广的平台600,优秀设计赏析网站,做网站时量宽度的尺子工具title: 第三周 浅层神经网络 date: 2017-10-18 09:58:33 tags: - 深度学习 - deeplearning.ai 《神经网络与深度学习 -- 神经网络基础》 by Andrew Ng 本周介绍了浅层神经网络,所谓浅层主要是单隐层的神经网络。 介绍了神经网络的表示,向量化方法&#x…

title: 第三周 浅层神经网络
date: 2017-10-18 09:58:33
tags:
- 深度学习

- deeplearning.ai

《神经网络与深度学习 -- 神经网络基础》 by Andrew Ng

本周介绍了浅层神经网络,所谓浅层主要是单隐层的神经网络。
介绍了神经网络的表示,向量化方法,激活函数(不同激活函数的表达和导数),最后讲了神经网络的梯度下降(前向传播和后向传播)。
基本还是在week2的基础上,进行了一些扩展。

3_2神经网络表示

最简单的神经网络,由输入层,一个隐藏层,输出层组成,一般不算入输入层,称为2层的神经网络。
\(a^{[0]}\)表示输入层,\(a^{[1]}\)表示隐藏层,\(a^{[2]}\)表示输出层。
\(a_2^{[1]}\)表示第1层第2个单元
这里输入层是3个变量,第1层的\(\omega\)是(4, 3)的,\(\omega\)的第1个值表示当前层有多少个隐藏单元,第2个值表示上一层有多少输入变量。

同理,\(\omega\)和\(b\)也是一样。以\(\omega^{[1]}\)为例,他是一个4 x 3的矩阵,4表示有4个隐藏单元(\(a^{[1]}_1, a^{[1]}_2, a^{[1]}_3, a^{[1]}_4\)),每个隐藏单元有自己的一套\(\omega\),3表示输入层有3个变量,所以每个隐藏单元需要3个参数。

3_3神经网络的输出

这里就可以看到,虽然\(\omega^{[1]}\)是(4,3)的,但是\(\omega_1^{[1]}\)却是(3,1)的。所以最终是要\(\omega_1^{[1]T}x\),也就是(1,3) * (3,1)。
向量化的表示方法,跟前面逻辑回归基本一致。

3_5向量化实现的解释

这里详细且直观的解释了向量化的实现。

3_6激活函数

这里介绍了常见的几种激活函数。并且说,除了逻辑回归的最终输出用sigmoid函数外,多数情况下,tanh函数总比sigmoid函数表现好。
ReLU(rectified linear function 修正线性单元)简单有效。

3_7为什么需要非线性激活函数

\(\color{maroon}{为什么我们需要非线性激活函数?}\)

因为神经网络本身就是上一层节点的线性组合,如果我们还用线性激活函数的话,那么其实就没必要多层神经网络,直接可以通过线性关系,做一层神经网络就可以了。图中右边解释了为什么不用线性激活函数,如果是线性激活函数,那么下一层节点的权重就只是\(\omega^{[1]} \times \omega^{[2]}\),那我们只需要一层网络,让他的\(\omega = \omega^{[1]} \times \omega^{[2]}\)即可。

3_8激活函数的导数1

3_8激活函数的导数2

3_8激活函数的导数3

3_9神经网络的梯度下降

反向传播总结:

\(\frac{\partial \mathcal{J} }{ \partial z_{2}^{(i)} } = \frac{1}{m} (a^{[2](i)} - y^{(i)})\)

\(\frac{\partial \mathcal{J} }{ \partial W_2 } = \frac{\partial \mathcal{J} }{ \partial z_{2}^{(i)} } a^{[1] (i) T} \)

\(\frac{\partial \mathcal{J} }{ \partial b_2 } = \sum_i{\frac{\partial \mathcal{J} }{ \partial z_{2}^{(i)}}}\)

\(\frac{\partial \mathcal{J} }{ \partial z_{1}^{(i)} } = W_2^T \frac{\partial \mathcal{J} }{ \partial z_{2}^{(i)} } * ( 1 - a^{[1] (i) 2}) \)

\(\frac{\partial \mathcal{J} }{ \partial W_1 } = \frac{\partial \mathcal{J} }{ \partial z_{1}^{(i)} } X^T \)

\(\frac{\partial \mathcal{J} _i }{ \partial b_1 } = \sum_i{\frac{\partial \mathcal{J} }{ \partial z_{1}^{(i)}}}\)

  • Note that \(*\) denotes elementwise multiplication.
  • The notation you will use is common in deep learning coding:
    • dW1 = \(\frac{\partial \mathcal{J} }{ \partial W_1 }\)
    • db1 = \(\frac{\partial \mathcal{J} }{ \partial b_1 }\)
    • dW2 = \(\frac{\partial \mathcal{J} }{ \partial W_2 }\)
    • db2 = \(\frac{\partial \mathcal{J} }{ \partial b_2 }\)

课后习题:

  1. A:为什么tanh大多数情况下比sigmoid好?
    Q: 因为tanh的输出的平均值更集中在0附近,因此对于下一层来说,他的数据集中化程度更高。

  2. A: Suppose you have built a neural network. You decide to initialize the weights and biases to be zero. Which of the following statements is true?
    Q: Each neuron in the first hidden layer will perform the same computation. So even after multiple iterations of gradient descent each neuron in the layer will be computing the same thing as other neurons.(这句话为什么是对的,没想通)

  3. Logistic regression’s weights w should be initialized randomly rather than to all zeros, because if
    you initialize to all zeros, then logistic regression will fail to learn a useful decision boundary
    because it will fail to “break symmetry”, True or False?
    A: False. Logistic Regression doesn't have a hidden layer. If you initialize the weights to zeros,
    the first example x fed in the logistic regression will output zero but the derivatives of the
    Logistic Regression depend on the input x (because there's no hidden layer) which is not
    zero. So at the second iteration, the weights values follow x's distribution and are
    different from each other if x is not a constant vector.

  4. You have built a network using the tanh activation for all the hidden units. You initialize the
    weights to relative large values, using np.random.randn(..,..)*1000. What will happen?

A: This will cause the inputs of the tanh to also be very large, thus causing gradients to be
close to zero. The optimization algorithm will thus become slow.(Yes. tanh becomes ?at for large values, this leads its gradient to be close to zero. This
slows down the optimization algorithm.)

转载于:https://www.cnblogs.com/luffy-hz/p/8313525.html

http://www.lbrq.cn/news/2555407.html

相关文章:

  • 网站的友情链接做多少个比较合适网站排名优化师
  • 如何做网站水晶头上海外贸seo公司
  • 做视频网站需要哪些技术指标广告营销推广
  • 物流公司图片南宁百度快速优化
  • 网站如何快速被百度收录广州外贸推广
  • 绵阳网站建设推广百度的首页
  • 营销网点机构号seo推广计划
  • 微信网站开发用什么语言新闻头条今日要闻最新
  • 在国外做h网站怎么样唐山seo优化
  • 淘客网站怎么做啊成都网络推广哪家好
  • 建设部网站资质公示网络推广经验
  • 百度做的网站后台怎么更新查询网138网站域名
  • 济南网站建设流程江苏seo哪家好
  • 做网站模板的软件市场推广方案和思路
  • 益阳网站制作公司平台推广渠道
  • .电子商务网站建设的核心百度关键词优化专家
  • web程序设计与实践做网站网站手机优化
  • 手机网站开发 1433端口错误互联网营销推广公司
  • 原创小说手机网站制作需要多少钱潍坊做网站公司
  • 制作网页网站杭州seo全网营销
  • 做网站的价格代运营一般收费
  • 建设淘宝网站需要多少钱营销的方法手段有哪些
  • 做决定网站网络seo是什么
  • 创建软件网站seo的优化策略有哪些
  • 手机网站设计作品欣赏搜狗seo
  • 房屋网站模板购物网站大全
  • 兰州企业网站网络公司网站
  • 提供邯郸做移动网站seo教程
  • 学校网站建设调查报告软件开发外包公司
  • 无锡商城网站建设哈尔滨网络推广
  • 十、SpringBootWeb快速入门-入门案例
  • flutter release调试插件
  • 2025年Python Web框架之争:Django、Flask还是FastAPI,谁将主宰未来?
  • ABS系统专用磁阻式汽车轮速传感器
  • 基于 Amazon Nova Sonic 和 MCP 构建语音交互 Agent
  • ECMAScript2024(ES15)新特性