一、Non-linear Hypotheses

线性回归和逻辑回归在特征很多时,计算量会很大。

一个简单的三层神经网络模型:

\[a_i^{(j)} = \text{"activation" of unit $i$ in layer $j$}$$$$\Theta^{(j)} = \text{matrix of weights controlling function mapping from layer $j$ to layer $j+1$}
\]



其中:$$a_1^{(2)} = g(\Theta_{10}^{(1)}x_0 + \Theta_{11}^{(1)}x_1 + \Theta_{12}^{(1)}x_2 + \Theta_{13}{(1)}x_3)$$$$a_2{(2)} = g(\Theta_{20}^{(1)}x_0 + \Theta_{21}^{(1)}x_1 + \Theta_{22}^{(1)}x_2 + \Theta_{23}{(1)}x_3)$$$$a_3{(2)} = g(\Theta_{30}^{(1)}x_0 + \Theta_{31}^{(1)}x_1 + \Theta_{32}^{(1)}x_2 + \Theta_{33}^{(1)}x_3)$$$$h_\Theta(x) = a_1^{(3)} = g(\Theta_{10}{(2)}a_0{(2)} + \Theta_{11}{(2)}a_1{(2)} + \Theta_{12}{(2)}a_2{(2)} + \Theta_{13}{(2)}a_3{(2)})$$

二、vectorized implementation

将上面公式中函数\(g\)中的东西用\(z\)代替:

\[a_1^{(2)} = g(z_1^{(2)})$$$$a_2^{(2)} = g(z_2^{(2)})$$$$a_3^{(2)} = g(z_3^{(2)})
\]

令\(x=a^{(1)}\):

\[z^{(j)} = \Theta^{(j-1)}a^{(j-1)}
\]

得到:

\[\begin{aligned}z^{(j)} = \begin{bmatrix}z_1^{(j)} \\ z_2^{(j)} \\ \cdots \\z_n^{(j)}\end{bmatrix}\end{aligned}
\]

这块的记号比较多,用例子梳理下:

实现一个逻辑与的神经网络:



那么:





所以有:



再来一个多层的,实现XNOR功能(两输入都为0或都为1,输出才为1):



基本的神经元:

  • 逻辑与

  • 逻辑或

  • 逻辑非



    先构造一个表示后半部分的神经元:

    这样的:



    接着将前半部分组合起来:

三、Multiclass Classification

#Week6 Neural Networks : Representation的更多相关文章

  1. Machine Learning - 第4周(Neural Networks: Representation)

    Neural networks is a model inspired by how the brain works. It is widely used today in many applicat ...

  2. (原创)Stanford Machine Learning (by Andrew NG) --- (week 4) Neural Networks Representation

    Andrew NG的Machine learning课程地址为:https://www.coursera.org/course/ml 神经网络一直被认为是比较难懂的问题,NG将神经网络部分的课程分为了 ...

  3. Stanford机器学习---第四讲. 神经网络的表示 Neural Networks representation

    原文 http://blog.csdn.net/abcjennifer/article/details/7749309 本栏目(Machine learning)包括单参数的线性回归.多参数的线性回归 ...

  4. 机器学习之神经网络模型-下(Neural Networks: Representation)

    3. Model Representation I 1 神经网络是在模仿大脑中的神经元或者神经网络时发明的.因此,要解释如何表示模型假设,我们不妨先来看单个神经元在大脑中是什么样的. 我们的大脑中充满 ...

  5. 机器学习之神经网络模型-上(Neural Networks: Representation)

    在这篇文章中,我们一起来讨论一种叫作"神经网络"(Neural Network)的机器学习算法,这也是我硕士阶段的研究方向.我们将首先讨论神经网络的表层结构,在之后再具体讨论神经网 ...

  6. Coursera, Machine Learning, Neural Networks: Representation - week4/5

    Neural Network Motivations 想要拟合一条曲线,在feature 很多的情况下,feature的组合也很多,在现实中不适用,比如在computer vision问题中featu ...

  7. Ng第八课:神经网络表述(Neural Networks: Representation)

    8.1  非线性假设 8.2  神经元和大脑 8.3  模型表示 1 8.4  模型表示 2 8.5  特征和直观理解 1 8.6  样本和直观理解 II 8.7  多类分类 8.1  非线性假设 无 ...

  8. 8、神经网络:表述(Neural Networks: Representation)

    8.1 非线性假设 我们之前学的,无论是线性回归还是逻辑回归都有这样一个缺点,即:当特征太多时,计算的负荷会非常大. 下面是一个例子: 当我们使用x1, x2 的多次项式进行预测时,我们可以应用的很好 ...

  9. (原创)Stanford Machine Learning (by Andrew NG) --- (week 5) Neural Networks Learning

    本栏目内容来自Andrew NG老师的公开课:https://class.coursera.org/ml/class/index 一般而言, 人工神经网络与经典计算方法相比并非优越, 只有当常规方法解 ...

随机推荐

  1. scratch算立方根

    10((1/3)lgx)=x(1/3)也就是立方根

  2. Python常见数据结构-Set集合

    集合基本特点 集合是无序的,且集合内无重复值. 集合不支持索引和切片 集合常见操作及方法 s1 = {1,2,3} s2 = {2,3,4} s1.add(4) #.add()方法添加一个元素 s1. ...

  3. csdn的垃圾体验

    微信扫码登录网页csdn,每次扫码都是csdn有关的不同的公众号,必须关注才可以登录,为了推广公众号真是简直了 无法修改id 注销也需要扫码,这次是必须下载csdn的app才能注销,我真是服了,我都要 ...

  4. 最长上升子序列 HDU 1025 Constructing Roads In JGShining's Kingdom

    最长上升子序列o(nlongn)写法 dp[]=a[]; ; ;i<=n;i++){ if(a[i]>dp[len]) dp[++len]=a[i]; ,dp++len,a[i])=a[i ...

  5. C - Battle City BFS+优先队列

    Many of us had played the game "Battle city" in our childhood, and some people (like me) e ...

  6. 原创Pig0.16.0安装搭建

    tar -zxvf pig-0.16.0.tar.gz -C ~   vi ~/.bash_profile export PIG_HOME=/home/hadoop/pig-0.16.0 export ...

  7. Linux protobuf

    生成C# protobuf 最终文件Net.cs .protoc --descriptor_set_out=a.protobin a.proto .mono protogen.exe -i:Net.p ...

  8. 【WPF学习】第六十七章 创建自定义面板

    前面两个章节分别介绍了两个自定义控件:自定义的ColorPicker和FlipPanel控件.接下来介绍派生自定义面板以及构建自定义绘图控件. 创建自定义面板是一种特殊但较常见的自定义控件开发子集.前 ...

  9. selenium获取多窗口句柄并一切换至原窗口句柄(三个窗口)

    网上有很多是selenium基于python来获取两个窗口句柄与切换,本文实现用python+selenium获取多窗口句柄并一一切换至原窗口句柄(三个窗口),且在每个窗口下进行一个搜索或翻译,然后截 ...

  10. 实例讲解Springboot以Repository方式整合Redis

    1 简介 Redis是高性能的NoSQL数据库,经常作为缓存流行于各大互联网架构中.本文将介绍如何在Springboot中整合Spring Data Redis,使用Repository的方式操作. ...