之前的学习成果并不能解决复杂的非线性问题

Neural Networks

Sigmoid(logistic) activation function: activation function is another term for \(g(z) = \frac{1}{1+e^{-z}}\)

activation: the value that's computed by and as output by a specific

weights = parameters = \(\theta\)

input units: \(x_1,x_2, x_3,\dots, x_n\)

bias unit/ bias neuron: \(x_0\) 与 \(a_0^{(j)}\)

input units 和 hypothesis 之间的layer 由activation 构成

input wire/ output wire:input wire是指指向目标neuron的箭头,output wire是指从目标neuron指出的箭头

\(a_i^{(j)}\): "activation" of neuron \(i\) or of unit \(i\) in layer \(j\)

\(\Theta^{(j)}\): matrix of weights controlling the function mapping form layer \(j\) to layer \(j+1\)

(注意\(\Theta\)是大写的,因为它需要用到矩阵的形式了)

layer 1 == input layer

layer n == output layer (the last layer)

layer 2 ~ layer n-1 == hidden layer

for example:
\[
\begin{align}
\text{output of layer 1(a hidden lyer)}&\begin{cases}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)\end{cases}\\
\text{output layer}&\begin{cases}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)})\end{cases}
\end{align}
\]

直观点就是:
\[
\begin{align}
\text{output of layer 1(a hidden lyer)}
&\begin{cases}
a_1^{(2)} &= g(\Theta_{1}^{(1)}a^{(1)})\\
a_2^{(2)} &= g(\Theta_{2}^{(1)}a^{(1)})\\
a_3^{(2)} &= g(\Theta_{3}^{(1)}a^{(1)})
\end{cases}\\
\text{output layer}
&\begin{cases}
h_\Theta(x) = a_1^{(3)} = g(\Theta_{1}^{(2)}a^{(2)})
\end{cases}
\end{align}
\]

)generally, \(\Theta^{(j)}\) will be of dimension \(s_{j+1} \times (s_j+1)\), if network has \(s_j\) units in layer \(j\) and \(s_{j+1}\) units in layer \(j+1\). (\(s_j+1\)中的\(+1\) comes from the addition in \(\Theta^{(j)}\) of the "bias nodes," \(x_0\) and \(\Theta_0^{(j)}\) . In other words the output nodes will not include the bias nodes while the inputs will. )

定义 \(a^{(1)} = x\)

\(z^{j+1} = \Theta^{(j)}a^{(j)}\)

\(x_k^{(j+1)} = \Theta_{k,0}^{(j)}a_0^{(j)} + \Theta_{k,1}^{(j)}a_1^{(j)} + \dots + \Theta_{k,n^{(j)}}^{(j)}a_{n^{(j)}}^{(j)}\quad ,(n^{(j)} \text{ means layer j has } n^{(j)} \text{ activation})\)

\(a^{(j)} = g(z^{(j)}) = g(\Theta^{(j-1)}a^{(j-1)})\quad(j\ge2)\)

设有 \(n\) 个 layers, then the last matrix \(\Theta^{(n)}\) will have only one row which is multiplied by one column \(a^{(j)}\) so that our result is a single number:

​ \(h_\Theta(x) = a^{(n+1)}=g(z^{(n+1)})\)

Add \(a_0^{(j)}=1\)

Forward Propagation:向前传播

Neural Networks 实际上是使用\(a^{(n-1)}\)layer作为训练logistic regression的特征的,而非input layer,在\(\Theta^{(1)}\)中选择不同的参数可能得到一些复杂的特征,从而的到更好的hypothesis,这样做比直接用\(x_1,x_2,\dots ,x_n\)作为训练特征更好

architecture(架构):the way that neural networks are connected

逻辑表达式对应的\(\theta\):

  • \({\rm AND} = (x_1 \bigwedge x_2)\):

    • \(\Theta = \begin{bmatrix}-30 &20& 20 \end{bmatrix}\)
  • \({\rm NOR} = (\lnot x_1 \bigwedge \lnot x_2)\):
    • \(\Theta = \begin{bmatrix}10 & -20& -20 \end{bmatrix}\)
  • \({\rm OR} = (x_1 \bigvee x_2)\):
    • \(\Theta = \begin{bmatrix}-10 &20& 20 \end{bmatrix}\)
  • \({\rm NOT} = (\lnot x)\):
    • \(\Theta = \begin{bmatrix}-10 & 20\end{bmatrix}\)
  • \({\rm XNOR} = (\lnot x_1 \bigwedge \lnot x_2) \bigvee ( x_1 \bigwedge x_2)\)
    • 需要一个hidden layer: \(a_1^{(2)} == (\lnot x_1 \bigwedge \lnot x_2),\quad a_2^{(2)} == (x_1 \bigwedge x_2)\)
    • output layer: \(a^{(3)} == (a_1^{(2)} \bigvee a_2^{(2)})\)

逻辑表达式的实现:

​ 令\(x=\begin{bmatrix}1 \\ x_1\\x_2 \end{bmatrix}\), 则 \(a_i = g(\Theta_ix)\)就得到\(\Theta_i\)对应的逻辑运算符运算\(x_1,x_2\)的结果了

​ 比如 \(\Theta_i = \begin{bmatrix}-10 &20& 20 \end{bmatrix}\)那么\(a_i == x_1 \bigvee x_2\)

​ 像\({\rm XNOR}\)这种复杂的逻辑表达式需要借助hidden layer才能算出来

对于 multiclass Classification:

​ 用\(y = \begin{bmatrix}1\\0\\0\\0 \end{bmatrix}, \begin{bmatrix}0\\1\\0\\0 \end{bmatrix}, \begin{bmatrix}0\\0\\1\\0 \end{bmatrix}, \begin{bmatrix}0\\0\\0\\1 \end{bmatrix},\begin{bmatrix}0\\0\\0\\0 \end{bmatrix}\)来表示不同的class,

Machine Learning--week4 神经网络的基本概念的更多相关文章

  1. 【Machine Learning】机器学习及其基础概念简介

    机器学习及其基础概念简介 作者:白宁超 2016年12月23日21:24:51 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现的深入理解.本系列文章是作者结 ...

  2. Machine Learning 学习笔记1 - 基本概念以及各分类

    What is machine learning? 并没有广泛认可的定义来准确定义机器学习.以下定义均为译文,若以后有时间,将补充原英文...... 定义1.来自Arthur Samuel(上世纪50 ...

  3. [Machine Learning & Algorithm] 神经网络基础

    目前,深度学习(Deep Learning,简称DL)在算法领域可谓是大红大紫,现在不只是互联网.人工智能,生活中的各大领域都能反映出深度学习引领的巨大变革.要学习深度学习,那么首先要熟悉神经网络(N ...

  4. 【Machine Learning】KNN算法虹膜图片识别

    K-近邻算法虹膜图片识别实战 作者:白宁超 2017年1月3日18:26:33 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现的深入理解.本系列文章是作者结 ...

  5. 【Machine Learning】Python开发工具:Anaconda+Sublime

    Python开发工具:Anaconda+Sublime 作者:白宁超 2016年12月23日21:24:51 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现 ...

  6. 【Machine Learning】决策树案例:基于python的商品购买能力预测系统

    决策树在商品购买能力预测案例中的算法实现 作者:白宁超 2016年12月24日22:05:42 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现的深入理解.本 ...

  7. Coursera《machine learning》--(8)神经网络表述

    本笔记为Coursera在线课程<Machine Learning>中的神经网络章节的笔记. 八.神经网络:表述(Neural Networks: Representation) 本节主要 ...

  8. Andrew Ng 的 Machine Learning 课程学习 (week4) Multi-class Classification and Neural Networks

    这学期一直在跟进 Coursera上的 Machina Learning 公开课, 老师Andrew Ng是coursera的创始人之一,Machine Learning方面的大牛.这门课程对想要了解 ...

  9. Python -- machine learning, neural network -- PyBrain 机器学习 神经网络

    I am using pybrain on my Linuxmint 13 x86_64 PC. As what it is described: PyBrain is a modular Machi ...

  10. 【机器学习Machine Learning】资料大全

    昨天总结了深度学习的资料,今天把机器学习的资料也总结一下(友情提示:有些网站需要"科学上网"^_^) 推荐几本好书: 1.Pattern Recognition and Machi ...

随机推荐

  1. 剑指offer——python【第16题】合并两个有序链表

    题目描述 将两个有序链表合并为一个新的有序链表并返回.新链表是通过拼接给定的两个链表的所有节点组成的. 示例: 输入:1->2->4, 1->3->4 输出:1->1-& ...

  2. MySQL数据库导出

    因为业务需要,把MySQL查询的数据导出成csv文件,操作在Navicat中完成. 首选用SELECT语句查询数据,然后Navicat的导出,然后选csv,选路径,再加上首栏就可以了

  3. /编写一个函数,要求从给定的向量A中删除元素值在x到y之间的所有元素(向量要求各个元素之间不能有间断), 函数原型为int del(int A ,int n , int x , int y),其中n为输入向量的维数,返回值为删除元素后的维数

    /** * @author:(LiberHome) * @date:Created in 2019/2/28 19:39 * @description: * @version:$ */ /* 编写一个 ...

  4. CodeForces 733B Parade

    B. Parade time limit per test1 second memory limit per test256 megabytes inputstandard input outputs ...

  5. linux_vim_emmet插件的安装配置

    首先要去如下网址下载一个安装包(英文基础好的同学可以去github上搜他的开源,写的更加详细) https://www.vim.org/scripts/script.php?script_id=298 ...

  6. .net 平台 统计图表展示控件fusioncharts

    https://www.fusioncharts.com/javascript-chart-fiddles/

  7. python练习题-day15

    1.请利用filter()过滤出1~100中平方根是整数的数,即结果应该是: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] 2.列表按照其中每一个值的绝对值排序 li ...

  8. cherry-pick时的add by us / both modified / delete by us /delete by themk

    简单来说: us=into , them=from 比如你将test分支的某个提交cherry-pick到master分支上,那么us就是master分支,them 就是test分支 参考: http ...

  9. 8 . IO类-标准IO、文件IO、stringIO

    8.1 IO类 #include <iostream> //标准IO头文件  8.2 文件输入输出流 #include <fstream> //读写文件头文件 std::fst ...

  10. js 获取时区

    js的时区函数: 设datename为创建的一个Date对象 ====================datename.getTimezoneOffset()--取得当地时间和GMT时间(格林威治时间 ...