目录

 

What is a nerual network?

Supervised Learning with Neural Networks

Why deep learning taking off?

Binary Classification

Logistic Regression

Gradient Descent

Computation Graph

Vectorization

Broadcasting in Python


What is a nerual network?

A simple neural network:

neural networks and deep learning 笔记(一)

Stack for more complex networks

neural networks and deep learning 笔记(一)

每个隐藏层变量可能表示一个组合特征,比如size和# of bedroom可以组合成更抽象的特征famliy size.

neural networks and deep learning 笔记(一)

Supervised Learning with Neural Networks

例子:

neural networks and deep learning 笔记(一)

训练样本有输入和输出

对于广告点击、房价预测类似的任务,常使用标准的神经网络模型,图像任务常用模型为CNN,对于语音识别,机器翻译任务基本使用序列sequence模型RNN,自动驾驶任务则是自定义的深度神经网络。

neural networks and deep learning 笔记(一)

neural networks and deep learning 笔记(一)

在有结构的数据中,数据的每一维特征都具有特定的意义,而非结构的数据的特征可能是像素点,词,计算机更难理解这些特征而人能更好的理解。而神经网络的应用,使计算机能够更好的理解这些无结构的数据。

Why deep learning taking off?

neural networks and deep learning 笔记(一)

传统机器学习随着数据量的增长,模型的性能增长是有限的,但是神经网络随着数据量和模型的复杂度的增长,模型的性能提升是巨大的。在小数据量的情况下,图中的左侧,传统机器学习和神经网络的性能时不确定的,此时,模型的性能更多的取决于特征工程的好坏,而在大数据量,即图片的右端,深度神经网络会是更好的选择。

neural networks and deep learning 笔记(一)

 

在神经网络的早期,主要是靠数据量提高模型的性能,GPU和CPU提高了计算性能,最近算法层面的创新也提高了模型的计算速度,比如ReLU替代Sigmoid函数,可以加快模型的收敛速度,因为sigmoid的梯度在(0,0.25)之间,,参数的更新非常缓慢。这些方法的提升都有助于我们更快的将想法实现并获得实验结果,加快了实验迭代的速度。

 

Binary Classification

neural networks and deep learning 笔记(一)

注意训练样本的组织形式。

x.shape=(n,m)  n为特征数,m为样本数

y.shape=(1,m)

neural networks and deep learning 笔记(一)

在神经网络编程中,w和b 分开会更容易计算,所以不使用红色的标记

Logistic Regression

neural networks and deep learning 笔记(一)

平方损失函数在LR中是非凸的,梯度下降无法找到全局最优解,而log损失可以找到全局最优解。

Loss function计算一个单个样本的错误率,而cost function是所有样本的loss function的均值。

 

Gradient Descent

neural networks and deep learning 笔记(一)

neural networks and deep learning 笔记(一)

Computation Graph

neural networks and deep learning 笔记(一)

将计算的依赖关系以图表的形式表示,tensorflow也也是这种理念,可以优化并行计算。

neural networks and deep learning 笔记(一)

Vectorization

neural networks and deep learning 笔记(一)

向量化会加快计算速度。

GPU,CPU SIMD 调用内置包会并行化计算

尽量避免显示for循环来进行矩阵计算

neural networks and deep learning 笔记(一)

neural networks and deep learning 笔记(一)

Broadcasting in Python

neural networks and deep learning 笔记(一)

neural networks and deep learning 笔记(一)

 

 

 

 

相关文章: