PaddlePaddle entry-depth study (four): convolutional neural network infrastructure Pools and Relu

This course is an introductory offer of zero-based Baidu official depth course of study, there is no depth learning technology base or weak base mainly for students, to help you leap from 0 to 1+ depth study in the field. From this course, you will learn to:

  • Deep learning the basics
  • numpy achieve artificial neural network and gradient descent algorithm
  • The main principle of the direction of the field of computer vision, practice
  • The main direction of the principle of natural language processing, practice
  • Personalized recommendation algorithm theory, practice

This week is the third week of lecture, deep learning technology platform Baidu, senior R & D engineer Sun Gaofeng, he began to explain the depth of learning practical applications in computer vision direction. Today, as we bring is the convolution of the neural network infrastructure pooling and Relu.

Pooling (Pooling)

Pooling is using overall statistical characteristics of a location adjacent output instead of the output of the position in the network, its advantage is that when the input data to make a small pan, after most of the output of the pooling function can remain unchanged. For example: when identifying whether an image is a human face, we need to know there is a human face on the left eye, the right also has one eye, without the need to know the exact location of the eyes, this time of a pixel by about one area to get an overall statistical characteristics would seem useful. Since then pooled wherein FIG become smaller, if the latter is fully connected connecting layer, can effectively reduce the number of neurons, save storage space and computational efficiency. 10, the pool area is a 2 * 2 pixels into one. There are generally two methods, average and maximum pool pooling.

Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description

ReLU activation function

Here Insert Picture Description


# ReLU和Sigmoid激活函数示意图
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches

plt.figure(figsize=(10, 5))

# 创建数据x
x = np.arange(-10, 10, 0.1)

# 计算Sigmoid函数
s = 1.0 / (1 + np.exp(0. - x))

# 计算ReLU函数
y = np.clip(x, a_min=0., a_max=None)

#####################################
# 以下部分为画图代码
f = plt.subplot(121)
plt.plot(x, s, color='r')
currentAxis=plt.gca()
plt.text(-9.0, 0.9, r'$y=Sigmoid(x)$', fontsize=13)
currentAxis.xaxis.set_label_text('x', fontsize=15)
currentAxis.yaxis.set_label_text('y', fontsize=15)

f = plt.subplot(122)
plt.plot(x, y, color='g')
plt.text(-3.0, 9, r'$y=ReLU(x)$', fontsize=13)
currentAxis=plt.gca()
currentAxis.xaxis.set_label_text('x', fontsize=15)
currentAxis.yaxis.set_label_text('y', fontsize=15)

plt.show()

Here Insert Picture DescriptionHere Insert Picture Description

to sum up

This article focuses on expansion explained convolution neural network inside the common modules, such as pooling and Relu. In the latter part of the course, will continue to bring a richer curriculum for everyone, help students to grasp the depth of learning.

[Learn how]

How to watch the complete video? How coding practices?

Video + code has been published on the AI Studio practice platform, video support PC client / mobile terminal simultaneous viewing, but also encourage people to personally experience running code oh. Scan code or open the following link:
https://aistudio.baidu.com/aistudio/course/introduce/888

Learning process, we have questions how to do?

Adding depth study training camp QQ group: 726 887 660, and the class teacher will fly paddle research to answer questions and learning materials distributed in the group.

How to learn more?

Baidu will be in the form of fly fly paddle paddle depth study of training camp, continue to update the "zero-based entry-depth study" courses, learning senior research engineer personally taught by the depth of Baidu, Tuesdays, Thursdays 8: 00-9: 00 is not seen scattered, using taped live + + + practice in the form of Q & a's, welcome attention ~

Published 116 original articles · won praise 1 · views 4571

Guess you like

Origin blog.csdn.net/PaddleLover/article/details/103897634