Understanding Convolutional Neural Networks for NLP
November 7, 2015
When we hear about Convolutional Neural Network (CNNs), we typically think of Computer Vision. CNNs were responsible for major breakthroughs in Image Classification and are the core of most Computer Vision systems today, from Facebook’s automated photo tagging to self-driving cars.
More recently we’ve also started to apply CNNs to problems in Natural Language Processing and gotten some interesting results. In this post I’ll try to summarize what CNNs are, and how they’re used in NLP. The intuitions behind CNNs are somewhat easier to understand for the Computer Vision use case, so I’ll start there, and then slowly move towards NLP.
What is Convolution?
The for me easiest way to understand a convolution is by thinking of it as a sliding window function applied to a matrix. That’s a mouthful, but it becomes quite clear looking at a visualization:
Convolution with 3×3 Filter. Source: HYPERLINK /wiki/index.php/Feature_extraction_using_convolution /wiki/index.php/Feature_extraction_using_convolution
Imagine that the matrix on the left represents an black and white image. Each entry corresponds to one pixel, 0 for black and 1 for white (typically it’s between 0 and 255 for grayscale images). The sliding window is called a kernel, filter, or feature detector. Here we use a 3×3 filter, multiply its values element-wise with the original matrix, then sum them up. To get the full convolution we do this for each element by sliding the filter over the whole matrix.
You may be wondering wonder what you can actually do with this. Here are some intuitive examples.
Averaging each pixel with its neighboring values blurs an image:
Taking the difference between a pixel and its neighbors detects edges:
(To understand this one intuitively, think about what happens in parts of the image that are smooth, where a pixel color equals that of its neighbors: The additions cancel and the resulting value is 0, or black. If there
您可能关注的文档
- 永久产权,看我在美国买地花了多少钱?.docx
- 永威外架施工方案.doc
- 永兴县人民医院天然气利用方案.doc
- 永远的伊苏1流程攻略.doc
- 甬心河施工设计.doc
- 用FDATool设计数字滤波器.docx
- 用flash8制作MV方法举例.doc
- 用java实现简单贪食蛇游戏.docx
- 用java实现推箱子(sokoban)游戏.docx
- 用labview做密码登录系统.doc
- 2025-2026学年下学期广州高二语文开学模拟卷3.pdf
- 2025-2026学年下学期北京高一英语开学模拟卷2.pdf
- 2025-2026学年下学期广州高二语文开学模拟卷2.pdf
- 2025-2026学年下学期北京高一英语开学模拟卷1.pdf
- 2025-2026学年下学期上海高二语文开学模拟卷1.pdf
- 2025-2026学年下学期广州高二英语开学模拟卷2.pdf
- 2025-2026学年下学期广州高一政治开学模拟卷1.pdf
- 2025-2026学年下学期广州高二物理开学模拟卷2.pdf
- 2025-2026学年下学期北京高一政治开学模拟卷1.pdf
- 高考政治选择性必修冲刺必备知识点.docx
最近下载
- YY9706.102-2021医疗装备电磁兼容EMC测试项目汇总.docx VIP
- 微生物学基础第二版1-9单元教材配套课件完整版电子教案.pptx
- 2025-2026学年冀人版(2017)小学科学五年级下册教学计划及进度表.pdf VIP
- 无人机维修知识培训课件.pptx
- 2026中国矿产资源集团校园招聘和所属单位社会招聘笔试模拟试题及答案解析.docx VIP
- 党员干部个人组织生活会个人对照(学习贯彻党的创新理论方面;加强党性锤炼方面;联系服务职工群众方面;发挥先锋模范作用方面;改作风树新风等方面)存在的问题清单及整改措施.docx VIP
- 2026年陕西省中考道德与法治备考全指南 (知识点归纳,必考知识点、真题模拟试卷及解析).docx VIP
- 陕西省轨道交通预应力混凝土预制梁施工及验收标准.docx VIP
- 普洱市罗非鱼养殖综合技术规范.doc
- 中国矿产资源集团2026校园招聘和所属单位社会招聘参考笔试试题及答案解析.docx VIP
原创力文档

文档评论(0)