SlideShare a Scribd company logo
합성곱 신경망
딥러닝을 위한 신경망 기초
nonezerok@gmail.com
영상학습에 절대강자인 CNN을 다룹니다.
향후 자신의 신경망 설계를 위해 꼭 필요한 기반 요소 및 관련 하이퍼 파라미터를 설명합니다.
MNIST 필기체 숫자영상 인식을 위한 Tensorflow 코드를 통해 하이퍼 파라미터 설정을 연습합니다.
2
CNN in Practice for MNIST
fully-connected
10-neuron
output layer
(softmax)
http://neuralnetworksanddeeplearning.com/index.html
5X5 커널 20개 사용
각각 1개 층
3
AlexNet (2012)
https://ml4a.github.io/ml4a/convnets/
더 복잡하게 구성할 수 있다.
stride
padding커널 크기, 커널 개수, 합성곱 층, 풀링 층 구성
커널 크기: 3X3
4
ImageNet (http://www.image-net.org/) Data
https://www.youtube.com/watch?v=40riCqvRoMs (Fei Fei Li)
5
1D 2D+1D
통합구조
6
depth, stride, zero-padding
convolution layer
7
https://tensorflow.blog/a-guide-to-convolution-arithmetic-for-deep-learning/
8
convolution with filter 3x3, stride 2, pad 1
99
a 7x7 input and a 3x3 filter with stride 1 and pad 0
we would get a 5x5 output
( −  + 2)

+ 1
 =
 − 1
2
,  = 1 → input volume = output volume
10
https://github.com/vdumoulin/conv_arithmetic
11
 = 2,  = 3,  = 2,  = 1 → 3 × 3
http://cs231n.github.io/convolutional-networks/ (animation)
12
Robust to Spatial Location
pooling layer
13
max pooling with filter 2x2, stride 2, pad 0
14
max pooling with filter 3x3, stride 1, pad 0
15
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
x = tf.placeholder("float", shape=[None, 784])
y = tf.placeholder("float", shape=[None, 10])
x_image = tf.reshape(x, [-1, 28, 28, 1])
W_conv1 = tf.Variable(tf.truncated_normal([5,5,1,32], stddev=0.1))
b_conv1 = tf.Variable(tf.constant(0.1, shape=[32]))
[code in Tensorflow]
https://tensorflow.blog
16
conv1 = tf.nn.relu(tf.nn.conv2d(x_image, W_conv1, strides=[1, 1, 1, 1],
padding='SAME') + b_conv1)
pool1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1],
padding='SAME')
'''
conv1 = tf.layers.conv2d(x_image, 32, (5,5), strides=(1,1),
padding="same", activation=tf.nn.relu)
pool1 = tf.layers.max_pooling2d(conv1, pool_size=(2,2), strides=(2,2))
'''
conv2 = tf.layers.conv2d(pool1, 64, (5,5), strides=(1,1), padding="same",
activation=tf.nn.relu)
pool2 = tf.layers.max_pooling2d(conv2, pool_size=(2,2), strides=(2,2))
pool2_flat = tf.reshape(pool2, [-1, 7*7*64])
fc = tf.layers.dense(pool2_flat, 1024, activation=tf.nn.relu)
drop_prob = tf.placeholder("float")
fc_drop = tf.layers.dropout(fc, rate=drop_prob)
z = tf.layers.dense(fc_drop, 10)
y_hat = tf.nn.softmax(z)
17
loss = tf.losses.softmax_cross_entropy(y, y_hat)
optimizer = tf.train.GradientDescentOptimizer(0.1)
train = optimizer.minimize(loss)
correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_hat, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
sess = tf.Session()
sess.run(tf.global_variables_initializer())
18
costs = []
for i in range(200):
x_data, y_data = mnist.train.next_batch(100)
_, cost = sess.run([train, loss],
feed_dict={x:x_data, y:y_data, drop_prob:0.5})
if i%100 == 0:
'''training_accuracy = sess.run(accuracy,
feed_dict={x:x_data, y:y_data, drop_prob: 0.1})
print("%d, training accuracy: %g"%(i, training_accuracy))'''
print("%05d, cost: %g"%(i, cost))
costs.append(cost)
plt.plot(costs)
plt.show()
test_accuracy = sess.run(accuracy,
feed_dict={x:mnist.test.images[:100], y:mnist.test.labels[:100],
drop_prob: 1.0})
print("test accuracy: %g"%(test_accuracy))
19
''' filter for the first convolution layer'''
filters = sess.run(W_conv1)
for i in range(32):
plt.subplot(4, 8, i+1)
filter = filters[:, :, 0, i]
plt.imshow(filter, interpolation="nearest", cmap="gray")
plt.show()

More Related Content

What's hot

TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用
Mark Chang
 
Python Tidbits
Python TidbitsPython Tidbits
Python Tidbits
Mitchell Vitez
 
Lec 3-mcgregor
Lec 3-mcgregorLec 3-mcgregor
Lec 3-mcgregor
Atner Yegorov
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
Mohammad Usman
 
Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis
Bharti Airtel Ltd.
 
Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3
Khor SoonHin
 
Gentlest Introduction to Tensorflow
Gentlest Introduction to TensorflowGentlest Introduction to Tensorflow
Gentlest Introduction to Tensorflow
Khor SoonHin
 
Numerical methods generating polynomial
Numerical methods generating polynomialNumerical methods generating polynomial
30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection
James Huang
 
Teeing Up Python - Code Golf
Teeing Up Python - Code GolfTeeing Up Python - Code Golf
Teeing Up Python - Code Golf
Yelp Engineering
 
Matlab differential
Matlab differentialMatlab differential
Matlab differential
pramodkumar1804
 
2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup
Raphaël Laffitte
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
Abhranil Das
 
Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional Programming
Saurabh Singh
 
TensorFlow in Practice
TensorFlow in PracticeTensorFlow in Practice
TensorFlow in Practice
indico data
 
Langrange method for MATLAB Code
Langrange method for MATLAB CodeLangrange method for MATLAB Code
Langrange method for MATLAB Code
Taimoor Muzaffar Gondal
 
R - binomial distribution
R - binomial distributionR - binomial distribution
R - binomial distribution
Learnbay Datascience
 
Codecomparaison
CodecomparaisonCodecomparaison
Codecomparaison
SokhnaRokhayaDIOP
 
Statistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat SheetStatistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat Sheet
Laurel Ayuyao
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
KristhyanAndreeKurtL
 

What's hot (20)

TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用
 
Python Tidbits
Python TidbitsPython Tidbits
Python Tidbits
 
Lec 3-mcgregor
Lec 3-mcgregorLec 3-mcgregor
Lec 3-mcgregor
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
 
Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis
 
Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3
 
Gentlest Introduction to Tensorflow
Gentlest Introduction to TensorflowGentlest Introduction to Tensorflow
Gentlest Introduction to Tensorflow
 
Numerical methods generating polynomial
Numerical methods generating polynomialNumerical methods generating polynomial
Numerical methods generating polynomial
 
30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection
 
Teeing Up Python - Code Golf
Teeing Up Python - Code GolfTeeing Up Python - Code Golf
Teeing Up Python - Code Golf
 
Matlab differential
Matlab differentialMatlab differential
Matlab differential
 
2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
 
Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional Programming
 
TensorFlow in Practice
TensorFlow in PracticeTensorFlow in Practice
TensorFlow in Practice
 
Langrange method for MATLAB Code
Langrange method for MATLAB CodeLangrange method for MATLAB Code
Langrange method for MATLAB Code
 
R - binomial distribution
R - binomial distributionR - binomial distribution
R - binomial distribution
 
Codecomparaison
CodecomparaisonCodecomparaison
Codecomparaison
 
Statistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat SheetStatistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat Sheet
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
 

Similar to [신경망기초] 합성곱신경망

Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
Oswald Campesato
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your Browser
Oswald Campesato
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.js
Oswald Campesato
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your Browser
Oswald Campesato
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
Ganesan Narayanasamy
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
Sri Ambati
 
Introduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowIntroduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and Tensorflow
Oswald Campesato
 
NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用
NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用
NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用
NTC.im(Notch Training Center)
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlow
Oswald Campesato
 
Deep cv 101
Deep cv 101Deep cv 101
Deep cv 101
Xiaohu ZHU
 
Deep Learning, Scala, and Spark
Deep Learning, Scala, and SparkDeep Learning, Scala, and Spark
Deep Learning, Scala, and Spark
Oswald Campesato
 
H2 o berkeleydltf
H2 o berkeleydltfH2 o berkeleydltf
H2 o berkeleydltf
Oswald Campesato
 
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Codemotion
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
Databricks
 
Machine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code SmarterMachine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code Smarter
Astrails
 
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
Mark Chang
 
실용주의 머신러닝 CNN MNIST TENSORBOARD
실용주의 머신러닝 CNN MNIST TENSORBOARD실용주의 머신러닝 CNN MNIST TENSORBOARD
실용주의 머신러닝 CNN MNIST TENSORBOARD
SeongHyun Ahn
 
Scaling Deep Learning with MXNet
Scaling Deep Learning with MXNetScaling Deep Learning with MXNet
Scaling Deep Learning with MXNet
AI Frontiers
 
Deep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLDeep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGL
Oswald Campesato
 
Introduction to Tensorflow
Introduction to TensorflowIntroduction to Tensorflow
Introduction to Tensorflow
Tzar Umang
 

Similar to [신경망기초] 합성곱신경망 (20)

Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your Browser
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.js
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your Browser
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
 
Introduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowIntroduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and Tensorflow
 
NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用
NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用
NTC_TENSORFLOW深度學習快速上手班_Part3_電腦視覺應用
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlow
 
Deep cv 101
Deep cv 101Deep cv 101
Deep cv 101
 
Deep Learning, Scala, and Spark
Deep Learning, Scala, and SparkDeep Learning, Scala, and Spark
Deep Learning, Scala, and Spark
 
H2 o berkeleydltf
H2 o berkeleydltfH2 o berkeleydltf
H2 o berkeleydltf
 
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
 
Machine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code SmarterMachine Learning: Make Your Ruby Code Smarter
Machine Learning: Make Your Ruby Code Smarter
 
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
 
실용주의 머신러닝 CNN MNIST TENSORBOARD
실용주의 머신러닝 CNN MNIST TENSORBOARD실용주의 머신러닝 CNN MNIST TENSORBOARD
실용주의 머신러닝 CNN MNIST TENSORBOARD
 
Scaling Deep Learning with MXNet
Scaling Deep Learning with MXNetScaling Deep Learning with MXNet
Scaling Deep Learning with MXNet
 
Deep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLDeep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGL
 
Introduction to Tensorflow
Introduction to TensorflowIntroduction to Tensorflow
Introduction to Tensorflow
 

More from jaypi Ko

CVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic Model
CVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic ModelCVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic Model
CVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic Model
jaypi Ko
 
개념 이해가 쉬운 Variational Autoencoder (VAE)
개념 이해가 쉬운 Variational Autoencoder (VAE)개념 이해가 쉬운 Variational Autoencoder (VAE)
개념 이해가 쉬운 Variational Autoencoder (VAE)
jaypi Ko
 
파이썬설치
파이썬설치파이썬설치
파이썬설치
jaypi Ko
 
객체지향 단어가 의미하는 것
객체지향 단어가 의미하는 것객체지향 단어가 의미하는 것
객체지향 단어가 의미하는 것
jaypi Ko
 
C언어 들어가기
C언어 들어가기C언어 들어가기
C언어 들어가기
jaypi Ko
 
C언어 연산자에 대해 간과한 것
C언어 연산자에 대해 간과한 것C언어 연산자에 대해 간과한 것
C언어 연산자에 대해 간과한 것
jaypi Ko
 
[확률통계]04모수추정
[확률통계]04모수추정[확률통계]04모수추정
[확률통계]04모수추정
jaypi Ko
 
MFC 프로젝트 시작하기
MFC 프로젝트 시작하기MFC 프로젝트 시작하기
MFC 프로젝트 시작하기
jaypi Ko
 
01 윈도우프로그램 들어가기
01 윈도우프로그램 들어가기01 윈도우프로그램 들어가기
01 윈도우프로그램 들어가기
jaypi Ko
 
13 사용자 메세지 처리
13 사용자 메세지 처리13 사용자 메세지 처리
13 사용자 메세지 처리
jaypi Ko
 
12 컨트롤에서의 메세지 처리
12 컨트롤에서의 메세지 처리12 컨트롤에서의 메세지 처리
12 컨트롤에서의 메세지 처리
jaypi Ko
 
11 노티피케이션코드
11 노티피케이션코드11 노티피케이션코드
11 노티피케이션코드
jaypi Ko
 
10 컨트롤윈도우
10 컨트롤윈도우10 컨트롤윈도우
10 컨트롤윈도우
jaypi Ko
 
09 윈도우스타일
09 윈도우스타일09 윈도우스타일
09 윈도우스타일
jaypi Ko
 
08 부모윈도우 자식윈도우
08 부모윈도우 자식윈도우08 부모윈도우 자식윈도우
08 부모윈도우 자식윈도우
jaypi Ko
 
07 윈도우 핸들
07 윈도우 핸들07 윈도우 핸들
07 윈도우 핸들
jaypi Ko
 
06 일반적 유형의 프로그램
06 일반적 유형의 프로그램06 일반적 유형의 프로그램
06 일반적 유형의 프로그램
jaypi Ko
 
05 윈도우 프로그램 유형
05 윈도우 프로그램 유형05 윈도우 프로그램 유형
05 윈도우 프로그램 유형
jaypi Ko
 
04 이벤트처리
04 이벤트처리04 이벤트처리
04 이벤트처리
jaypi Ko
 
03 첫번째프로그램
03 첫번째프로그램03 첫번째프로그램
03 첫번째프로그램
jaypi Ko
 

More from jaypi Ko (20)

CVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic Model
CVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic ModelCVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic Model
CVPR 2022 Tutorial에 대한 쉽고 상세한 Diffusion Probabilistic Model
 
개념 이해가 쉬운 Variational Autoencoder (VAE)
개념 이해가 쉬운 Variational Autoencoder (VAE)개념 이해가 쉬운 Variational Autoencoder (VAE)
개념 이해가 쉬운 Variational Autoencoder (VAE)
 
파이썬설치
파이썬설치파이썬설치
파이썬설치
 
객체지향 단어가 의미하는 것
객체지향 단어가 의미하는 것객체지향 단어가 의미하는 것
객체지향 단어가 의미하는 것
 
C언어 들어가기
C언어 들어가기C언어 들어가기
C언어 들어가기
 
C언어 연산자에 대해 간과한 것
C언어 연산자에 대해 간과한 것C언어 연산자에 대해 간과한 것
C언어 연산자에 대해 간과한 것
 
[확률통계]04모수추정
[확률통계]04모수추정[확률통계]04모수추정
[확률통계]04모수추정
 
MFC 프로젝트 시작하기
MFC 프로젝트 시작하기MFC 프로젝트 시작하기
MFC 프로젝트 시작하기
 
01 윈도우프로그램 들어가기
01 윈도우프로그램 들어가기01 윈도우프로그램 들어가기
01 윈도우프로그램 들어가기
 
13 사용자 메세지 처리
13 사용자 메세지 처리13 사용자 메세지 처리
13 사용자 메세지 처리
 
12 컨트롤에서의 메세지 처리
12 컨트롤에서의 메세지 처리12 컨트롤에서의 메세지 처리
12 컨트롤에서의 메세지 처리
 
11 노티피케이션코드
11 노티피케이션코드11 노티피케이션코드
11 노티피케이션코드
 
10 컨트롤윈도우
10 컨트롤윈도우10 컨트롤윈도우
10 컨트롤윈도우
 
09 윈도우스타일
09 윈도우스타일09 윈도우스타일
09 윈도우스타일
 
08 부모윈도우 자식윈도우
08 부모윈도우 자식윈도우08 부모윈도우 자식윈도우
08 부모윈도우 자식윈도우
 
07 윈도우 핸들
07 윈도우 핸들07 윈도우 핸들
07 윈도우 핸들
 
06 일반적 유형의 프로그램
06 일반적 유형의 프로그램06 일반적 유형의 프로그램
06 일반적 유형의 프로그램
 
05 윈도우 프로그램 유형
05 윈도우 프로그램 유형05 윈도우 프로그램 유형
05 윈도우 프로그램 유형
 
04 이벤트처리
04 이벤트처리04 이벤트처리
04 이벤트처리
 
03 첫번째프로그램
03 첫번째프로그램03 첫번째프로그램
03 첫번째프로그램
 

Recently uploaded

一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
PIMR BHOPAL
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 

Recently uploaded (20)

一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 

[신경망기초] 합성곱신경망

  • 1. 합성곱 신경망 딥러닝을 위한 신경망 기초 nonezerok@gmail.com 영상학습에 절대강자인 CNN을 다룹니다. 향후 자신의 신경망 설계를 위해 꼭 필요한 기반 요소 및 관련 하이퍼 파라미터를 설명합니다. MNIST 필기체 숫자영상 인식을 위한 Tensorflow 코드를 통해 하이퍼 파라미터 설정을 연습합니다.
  • 2. 2 CNN in Practice for MNIST fully-connected 10-neuron output layer (softmax) http://neuralnetworksanddeeplearning.com/index.html 5X5 커널 20개 사용 각각 1개 층
  • 3. 3 AlexNet (2012) https://ml4a.github.io/ml4a/convnets/ 더 복잡하게 구성할 수 있다. stride padding커널 크기, 커널 개수, 합성곱 층, 풀링 층 구성 커널 크기: 3X3
  • 8. 8 convolution with filter 3x3, stride 2, pad 1
  • 9. 99 a 7x7 input and a 3x3 filter with stride 1 and pad 0 we would get a 5x5 output ( −  + 2)  + 1  =  − 1 2 ,  = 1 → input volume = output volume
  • 11. 11  = 2,  = 3,  = 2,  = 1 → 3 × 3 http://cs231n.github.io/convolutional-networks/ (animation)
  • 12. 12 Robust to Spatial Location pooling layer
  • 13. 13 max pooling with filter 2x2, stride 2, pad 0
  • 14. 14 max pooling with filter 3x3, stride 1, pad 0
  • 15. 15 import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) x = tf.placeholder("float", shape=[None, 784]) y = tf.placeholder("float", shape=[None, 10]) x_image = tf.reshape(x, [-1, 28, 28, 1]) W_conv1 = tf.Variable(tf.truncated_normal([5,5,1,32], stddev=0.1)) b_conv1 = tf.Variable(tf.constant(0.1, shape=[32])) [code in Tensorflow] https://tensorflow.blog
  • 16. 16 conv1 = tf.nn.relu(tf.nn.conv2d(x_image, W_conv1, strides=[1, 1, 1, 1], padding='SAME') + b_conv1) pool1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME') ''' conv1 = tf.layers.conv2d(x_image, 32, (5,5), strides=(1,1), padding="same", activation=tf.nn.relu) pool1 = tf.layers.max_pooling2d(conv1, pool_size=(2,2), strides=(2,2)) ''' conv2 = tf.layers.conv2d(pool1, 64, (5,5), strides=(1,1), padding="same", activation=tf.nn.relu) pool2 = tf.layers.max_pooling2d(conv2, pool_size=(2,2), strides=(2,2)) pool2_flat = tf.reshape(pool2, [-1, 7*7*64]) fc = tf.layers.dense(pool2_flat, 1024, activation=tf.nn.relu) drop_prob = tf.placeholder("float") fc_drop = tf.layers.dropout(fc, rate=drop_prob) z = tf.layers.dense(fc_drop, 10) y_hat = tf.nn.softmax(z)
  • 17. 17 loss = tf.losses.softmax_cross_entropy(y, y_hat) optimizer = tf.train.GradientDescentOptimizer(0.1) train = optimizer.minimize(loss) correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_hat, 1)) accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float")) sess = tf.Session() sess.run(tf.global_variables_initializer())
  • 18. 18 costs = [] for i in range(200): x_data, y_data = mnist.train.next_batch(100) _, cost = sess.run([train, loss], feed_dict={x:x_data, y:y_data, drop_prob:0.5}) if i%100 == 0: '''training_accuracy = sess.run(accuracy, feed_dict={x:x_data, y:y_data, drop_prob: 0.1}) print("%d, training accuracy: %g"%(i, training_accuracy))''' print("%05d, cost: %g"%(i, cost)) costs.append(cost) plt.plot(costs) plt.show() test_accuracy = sess.run(accuracy, feed_dict={x:mnist.test.images[:100], y:mnist.test.labels[:100], drop_prob: 1.0}) print("test accuracy: %g"%(test_accuracy))
  • 19. 19 ''' filter for the first convolution layer''' filters = sess.run(W_conv1) for i in range(32): plt.subplot(4, 8, i+1) filter = filters[:, :, 0, i] plt.imshow(filter, interpolation="nearest", cmap="gray") plt.show()