Skip to content
Yongrae Jo edited this page Jan 25, 2018 · 18 revisions

lstm 에서 속도를 높인 모델

RNN 특히 LSTM 은 문서 분류나 언어 번역처럼 굉장히 긴 sequence도 학습할 수 있습니다. CNN 은 주로 이미지 처리에 쓰이지만 filter function 을 통해서 sequence가 있는 task에도 적용할 수 있습니다. 하지만 RNN 모델과 함꼐 쓸 떄 그 능력은 배가 됩니다.

이 논문에서는 nearal sequnce modeling 을 위한 QRNN의 개념을 제시했는데 내용은 아래와 같습니다. QRNN 은 CNN에서의 병렬처리 개념과 순서를 잘 반영하는 RNN의 개념을 이용하였씁니다. 그래서 LSTM 같은 좋은 모델보다도 계산 능력을 향상 시켰습니다.

Model

Quasi Recurrent Neural Networks The Neural Perspective 2018 01 24 23 26 14

QRNN 의 각각의 layer는 CNN 에서의 convolution과 pooling layer 이 두개의 subcomponents로 구성되어 있습니다.

  • Convolution layer - allows fully parallel computation across both minibatches and sequence dimension

  • pooling layer - lacks trainable parameters and allows fully parallel computation across minibatch and feature dimensions like pooling layers in CNNs

image

input X 는 x1, ... xT 까지 n차원 벡터를 timestep T 만큼 정렬해놓은 sequence입니다.

QRNN은 m 개의 filters를 가지고 timestep dimesion 내에서 convolutioning을 합니다.

image

그럼 T timesteps 와 m차원을 가진 sequence Z가 생깁니다.

다음 token을 예측하는 모델을 만드려면 filter는 다음 timestep들의 정보에 접근하면 안됩니다. -- 즉 미래를 맞추는데에 미래의 정보에 의존하면 안 된다!!

image

위의 그림에서 보듯이 넓이 k짜리 필터로 convolutioning을 하면서 각 Zt는 x(t-k+1) through xt 에만 의존 합니다. 이 개념을 masked convolution(van den Oord et al., 2016) 이라고 합니다.

  • masked convolution - padding the input to the left by the convolution’s filter size minus one

image

* 는 masked convolution를 의미하며 W 는 모두 k x n x m 차원입니다.

예를 들어, k (filter의 width)가 2 면, lstm 같은 식을 갖게 됩니다.

image

pooling

image

Variants

regularization

zone out : RNN regularizing method

image

Densely-Connected Layers

  • “dense convolution” by Huang et al. (2016) skip connection : a DenseNet with L layers has feed-forward or convolutional connections between every pair of layers, for a total of L(L−1)

3 EXPERIMENTS

Sentiment Classification

image

  • iDMB Movie Dataset
  • Best Result : 300 차원의 Glove, a four-layer denselyconnected QRNN with 256 units per layer, Dropout 0.3 and L2 regularization

lstm보다 3배 더 빨랐음

Language Modeling

image

  • Penn Treebank Dataset
  • a gated QRNN model with medium hidden size: 2 layers with 640 units in each layer

deep voice http://research.baidu.com/deep-voice-production-quality-text-speech-system-constructed-entirely-deep-neural-networks/

이미지 참고자료 https://theneuralperspective.com/2016/12/16/quasi-recurrent-neural-networks/

Presentation Note

  • Pooling 도표에서 첫 셀이 g_{t-1}이 아닌 h_{t-1}이다.
Clone this wiki locally