其他分享
首页 > 其他分享> > CS224n Lecture11:Convolutional Networks for NLP

CS224n Lecture11:Convolutional Networks for NLP

作者:互联网

在这里插入图片描述

Lecture Plan

  1. Announcements
  2. Intro to CNNs
  3. Simple CNN for Sentence Classification: Yoon (2014)
  4. CNN potpourri
  5. Deep CNN for Sentence Classification: Conneauet al. (2017)
  6. Quasi-recurrent Neural Networks

Welcome to the second half of the course!

Wanna read a book?

在这里插入图片描述

2. From RNNs to Convolutional Neural Nets

From RNNs to Convolutional Neural Nets

What is a convolution anyway?

A 1D convolution for text

在这里插入图片描述

1D convolution for text with padding

在这里插入图片描述

3 channel 1D convolution with padding = 1

在这里插入图片描述

conv1d, padded with max pooling over time

在这里插入图片描述

conv1d, padded with avepooling over time

在这里插入图片描述

In PyTorch

batch_size= 16
word_embed_size= 4
seq_len= 7
input = torch.randn(batch_size, word_embed_size, seq_len)
conv1 = Conv1d(in_channels=word_embed_size, out_channels=3, kernel_size=3)
# can add: padding=1
hidden1 = conv1(input)
hidden2 = torch.max(hidden1, dim=2) # max pool

Other less useful notions: stride = 2

在这里插入图片描述

Less useful: local max pool, stride = 2

在这里插入图片描述

conv1d, k-max pooling over time, k= 2

在这里插入图片描述

Other somewhat useful notions: dilation = 2

在这里插入图片描述

Summary

3. Single Layer CNN for Sentence Classification

Single layer CNN

Pooling and channels

Multi-channel input idea

Classification after one CNN layer

Regularization

Problem with comparison?

4. Model comparison: Our growing toolkit

Gated units used vertically

Batch Normalization (BatchNorm)

1 x 1 Convolutions

CNN application: Translation

在这里插入图片描述

Learning Character-level Representations for Part-of-Speech Tagging

在这里插入图片描述

Character-Aware Neural Language Models在这里插入图片描述

5. Very Deep Convolutional Networks for Text Classification

Convolutional block in VD-CNN

在这里插入图片描述

Experiments

6. RNNs are Slow …

Quasi-Recurrent Neural Network

Q-RNN Experiments: Language Modeling

在这里插入图片描述

Q-RNNs for Sentiment Analysis

QRNN limitations

码文不易,如果觉得对你有用的话,点个赞再走吧,谢谢宁!

(才疏学浅,如果有什么说的不对的地方,欢迎大家在评论区或者私信进行指正。)

标签:Convolutional,卷积,max,filter,CNN,Lecture11,CS224n,向量,size
来源: https://blog.csdn.net/weixin_44857688/article/details/113776302