浅谈deep stacking network --- 一种比较实用的deep learning算法

原地址:http://www.dataguru.cn/article-3361-1.html


摘要: deep stacking network 是 Li Deng 提出的一种判别模型。现在的应用主要在于CTR IR和语言以及图像的分类和回归。
分享一下组会的讲稿。
附组会的ppt
http://vdisk.weibo.com/s/zfic-IP2yagqu
涉及到的原论文大概10几篇,我打印出来看的,有人需要的话我回去好好对着打印出的论文再打出来标题。。。。大概就是DEEP STACKING NETWORKS FOR INFORMATION RETRIEVAL这样的

正文
deep stacking network 是 Li Deng 提出的一种判别模型。现在的应用主要在于CTR IR和语言以及图像的分类和回归。
大体的结构如下图


1.简要介绍

Why dsn
话说 dnn 已经比较好用了,各种包也很多了,那为什么还要用 dsn 呢?
很大一个原因是因为 dnn 在 fine tuning phase 用的是 stochastic gradient descent, 对其做 parallelize across machines 比较困难。
而 dsn 却 attacks the learning scalability problem

Central Idea - Stacking
由 dsn 的命名可以看到 dsn 的核心思想是做 stacking。这源自于 Wolpert 在1992年提出的 stacked generalization 的思想。
如下图

Level-0 models are based on different learning models and use original data (level-0 data)
Level-1 models are based on results of level-0 models (level-1 data are outputs of level-0 models) -- also called “generalizer”
其作为一种 ensemble method 而广为使用。

Central Idea - DCN VS DSN
比较有意思的是dsn最初提出名字是叫做dcn的,也就是Deep Convex Network
Deng 老师的解释是这样的:两个名字强调的地方不同
Deep Convex Network------accentuates the role of convex optimization
Deep Stacking Network----the key operation of stacking is emphasized


2.算法细节
在算法细节没有太多公式推导,一方面是因为公式实在比较简单,另一方面则是想讲工程中实践更看重的东西,比如超参数的选择,weight初始化之类的。
主要为下面这些部分input output, W&U, fine-tuning, hyper-parameter, regularization, over-fitting

Input
对于 dsn 结构来说是如下图红圈圈出来的地方


主要的输入以 image speech 以及 Semantic utterance classification 这三个方面的应用为例说明。

对于有些时候我们不需要做 feature selection 的情况:
对于 Image 来说可以是 a number of pixels or extracted features,或者是 values based at least in part upon intensity values, RGB values (or the like corresponding to the respective pixels)
对Speech来说可以是samples of speech waveform或者是the extracted features from speech waveforms(such as power spectra or cepstral coefficients)
Note the use of speech waveform as the raw features to a speech recognizer isnot a crazy idea

对于有些情况我们需要做feature selection:
比如说如下
对于 Acoustic models 其具有 9 standard MFCC features 和 millions of frames as training samples 当然就不需要做 feature selection
而 Semantic utterance classification 有 as many as 125,000 unique trigrams as potential features
却只有 16,000 utterances 这样形成了一个sparse space,就需要做feature selection

具体来说用什么 feature selection 的算法区别不大,这里说下用 boosting classifier 的方法
Semantic Classification
-The input feature space is shrunk using the n-grams selected by the Boosting classifier.
-The weights coming with the decision stump are ignored, only binary features indicating absence or presence are used.(decision stump, which is a single node decision tree)

Output


根据需要解决的问题定义来定
-representative of the values
        0, 1, 2, 3, and so forth up to
        9 with a 0-1 coding scheme
-representative of phones,
-HMM states of phones
-context-dependent HMM states of phones.
等等

Learning
先以下图所示的最底层讲述如何 learning

(豆瓣编辑太麻烦 直接帖图好了)
单层计算便是如此,其实挺简单的


但是具体计算的时候涉及到很多问题
1.W 怎么初始化
2.超参数怎么调
3.什么时候需要做 regularization
4.解剧透问题的时候 overfitting 的情况

Setting Weight Matrices W
在前面说了单层的计算方法,对于多层来说计算结构如下

如同整体的结构图可以看到,把 output 是加入了下一层的 input里面了的。其余计算步骤和单层一样。
但是对于 W 的初始化其实还是挺有趣的,有如下4种方法:
1.Take the same W from the immediately lower module already adjusted via fine tuning.
2.Take a copy of the RBM that initialized W at bottom module.
3.Use random numbers, making the full W maximally random before fine tuning.
4.Mix the above three choices with various weighting and with randomized order or otherwise.
当然要注意的是the sub-matrix of W corresponding to the output units from the lower modules is always initialized with random numbers.

大家可能发现这4种方法差别还挺大的,但是有趣的是 with sufficient efforts put to adjust all other hyper-parameters, all four strategies above eventually gave similar classification accuracy。
正所谓调得一手好参数,再烂的结构也不怕。不过对于随机赋值的策略来说虽然在 classification accuracy 没有什么损失,但是 it takes many more modules and fine-tuning iterations than other strategies.

尤其要注意的是对于最底层的那个 module 不能随机赋值,还是要上 RBM


Fine-tuning
用 batch-mode gradient descent,没什么好说的,直接帖公式



Regularization
在做图片和语言的时候不需要做 regularization,在做IR的时候需要做。这是因为 IR 的 output 比较少,一般都是二分类问题,减轻了 stacking 的传递效应。
做法为对 U 做 L2 regularization,给 W 加个 data reconstruction error term

Hyper-parameter
算法的超参数在于隐层选择多少个神经元。
这个是靠把数据集分为 train data、 test data 以及 development data 来做实验的。看着差不多就行了,一般大于 input 几倍就好。
大体的感觉如下:

相当于是input 784个 feature,hidden 3000,output 10的节奏。

Over-fitting
最后说下到底要 stacking 几层的问题。
层数少了效果差,层数多了 over fitting。
一般来说是这样的,如果你的特征选的比较好,参数初始化比较巧妙,超参数调的也比较好,那么层数就需要少一点;如果你上面这些东西都做的不好,那么层数就需要的多一些。(想象一下极端情况,特征非常巧妙,那一层就够了)
调层数也是靠比较 train error 和 test error 来实现。
一般来说,层数越多 train error 越小,但是多到一定程度的时候 test error 反而会增加,这时候我们就认为出现了 over fitting,把结构的层数定义在拐点处,如下图,分别是两个应用场景,其实用的层数都不多。


3.总结
其实 dsn 对于大 input 大 output 的分类问题效果挺好的,而且比很多 state of art 的方法做分类略好一点点。最重要的是比 dnn 好调,工程实践起来方便。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值