Denoising auto encoders(d a)

Tae Young Lee
Tae Young LeeChief Research Officer em Shinhan Bank AI LAB
Denoising Auto encoders(dA)
Produce by Tae Young Lee
history
• 1958 Rosenblatt proposed perceptrons
• 1980 Neocognitron (Fukushima, 1980)
• 1982 Hopfield network, SOM (Kohonen, 1982),
Neural PCA (Oja, 1982)
• 1985 Boltzmann machines (Ackley et al., 1985)
• 1986 Multilayer perceptrons and backpropagation
(Rumelhart et al., 1986)
1988 RBF networks (Broomhead&Lowe, 1988)
• 1989 Autoencoders (Baldi&Hornik, 1989),
Convolutional network (LeCun, 1989)
1992 Sigmoid belief network (Neal, 1992)
• 1993 Sparse coding (Field, 1993)
Beyond the Wall
deep learning beyond the limits
Limitation
• First.
먼저 ‘deep’ learning에 대한 이론적인 결
과가 전무했다는 점 (network가 deep 해
지면 문제가 더 이상 convex해지지 않는데,
이 상태에 대해 좋은 convergence는 어디
이며 어떤게 좋은 initialization인가 등에
대한 연구가 전무하다. 즉, learning하면
overfitting이 너무 심하게 일어난다),
• Second
이론적으로 연구가 많이 진행되어있는
‘deep’ 하지 않은 network (perceptron이라
고 한다) 는 xor도 learning할 수 없는 한계
가 존재한다는 점 (linear classifier라 그렇
다).
Overcome
• 가장 크게 차이 나는 점은 예전과는 다르
게 overfitting을 handle할 수 있는 좋은 연
구가 많이 나오게 되었다. 처음 2007, 2008
년에 등장했던 unsupervised pre-training
method들 (이 글에서 다룰 내용들), 2010
년도쯤 들어서서 나오기 시작한 수많은
regularization method들 (dropout, ReLU
등).
• Third
computation cost가 무시무시해서 그 당
시 컴퓨터로는 도저히 처리할 엄두조차 낼
수 없었다는 점이다.
Limitation
Overcome
• 하드웨어 스펙이 압도적으로 뛰어난데다가, GPU
parallelization에 대한 이해도가 높아지게 되면서
에전과는 비교도 할 수 없을 정도로 많은
computation power를 사용할 수 있게 되었다
• 현재까지 알려진 바로는 network가 deep할 수록
그 최종적인 성능이 좋아지며, optimization을 많
이 하면 할 수록 그 성능이 좋아지기 때문에,
computation power를 더 많이 사용할 수 있다면
그만큼 더 좋은 learning을 할 수 있다는 것을 의
미한다.
Denoising Auto Encoder
Image Processing
Denoising auto encoders(d a)
Denoising auto encoders(d a)
Denoising auto encoders(d a)
Denoising Auto Encoder
• Denoising Auto-Encoder는 데이터에 Noise
가 추가되었을 때, 이러한 Noise를 제거하여
원래의 데이터를 Extraction하는 모델이다.
• 실제 사물 인식이라든지, Vision을 연구하는
분야에서는 고의적으로 input data에 noise를
추가하고, 추가된 노이즈를 토대로 학습된 데
이터에서 나오는 결과값이, 내가 노이즈를 삽
입하기 전의 pure input 값인지를 확인한다.
Input & Output
• Denoising Autoencoder 를 제안한 근본적 배
경은 "robustness to partial destruction of
the input" 라고 힘주어 말한다. 인풋에 대해
부분적으로 분해 해버리면 부분으로 파괴된
(나뉘어진) 인풋은 거의 같은 representation
을 가질 것이라고 말한다.
• 위의 내용을 다시 설명해보면, 훌륭한 대표성
을 가지는 데이터는 종속적인 데이터에서 안
정적인 구조의 데이터를 뽑아내는 것이다.
For example
• 우리가 안개 속에서 운전을 한다고 가정하자. 만약, 안개
속에서 사람의 형체가 나타나게 되면, 우리의 시각은 자
동적으로 사람의 모양을 인지해서 차량을 정지하거나 서
행한다. 이와 마찬가지이다, 노이즈 된 데이터라 하더라
도 노이즈 속에는 사람의 물체를 나타내주는 상호 종속
적인 인풋데이터들이 존재한다. 사람을 인지함에 있어,
우리는 사람의 모양(modalities) 을 어떤 종속적인 데이
터 속에서 stable 한 구조로 뽑아낸다. 그리고 이러한
Modalities 는 특정 인풋벡터의 combination 으로 존재
할 가능성이 높다. 이러한 모티브에 의해 탄생한 것이
Denoising AutoEncoder 이다.
Mechanism
• 초기에 stochastic corruption pross에서는
랜덤하게 인풋 데이터의 절반 정도를 0 으
로 맞춰 받아들인다.
• 이러한 과정으로 Denoising AE는 노이즈
가 없는(Uncorrupted), 또는 인풋이 0이 아
닌 데이터들을 통해 나머지 0으로 받아들
였던 값들을 예측하려 한다.
Stacked Denoising
Autoencoders
Stacked Autoencoder(1)
• Stacked Autoencoder가 Autoencoder에 비해 갖는 가장
큰 차이점은 DBN(Deep Belief Network)의 구조라는 것
이다.
• 기존의 AE는 BP(BackPropagation)를 활용하여 Weight를
학습하였다. 하지만 이는 Layer와 Unit의 개수가 많아지
면 많아질 수록 Weight를 학습하는데 방대한 계산량과
Local Minima 에 빠질 위험이 존재한다. 또한 지속적으
로 작은 값들이 Update 되는 과정에서 Weight의 오차가
점점 줄어드는 이른바, Vanishing Gradient의 문제를 갖
고 있다.
• * DBN(Deep Belief Network)에서는 RBM(Restricted Boltzmann Machine)을 도입한
다.
RBM은 Fully connected Boltzmann Machine을 변형한 것으로, Unit의 Inner
Connection을 제한한 모델로, Layer과 Layer 사이의 Connection 만 존재하는 모델이
다. RBM에서는 BP 방법이 아니라, (Alternative) Gibbs sampling을 활용한
Contrastive Divergence(CD) 를 활용하여 Maximum Likelihood Estimation (MLE) 문
제를 해결하였다. CD트레이닝 방법은 위에서 언급한 MLE 뿐만 아니라, 트레이닝 샘
플의 확률 분포 함수와 모델의 확률 분포 함수의 Kullback-Leibler Divergence를 이용
한 식의 Gradient-Descent 방법을 통해 유도 할 수 있다.
• 핵심적인 idea 는 모델링을 함에 있어서 p(y=label|x=data)p(y=label|x=data) 가 아니
라, p(data)p(data) 만을 가지고도 layer 가 label 을 generate 할 수 있도록
Generative Model 을 만드는 것이다. 이 말은 곧, Training Data에서 Input과 Output
이 필요하지 않기 때문에, Unsupervised Learning과 Semi-Supervised Learning에 적
용할 수 있게 되었다.
• 이러한 DBN모델에서 층별로 학습시키는 방법을 [Bengio]가 본인의 논문 "Greedy
Layer-Wise Training of Deep Networks(2007)"에서 제안한다. 그리고 이를 활용한 모
델이 바로 Stacked AE 이다. 그리고 이러한 학습 방식을 Greedy Layer-Wise Training
라고 한다.
Stacked Autoencoder(2)
Stacked Autoencoder 장/단점
• Stacked Auto-Encoders(SAE)에서는 완전하게 Deep Generative
Model 이라고 할 수 없는 것이, RBM에서는 probabilistic 에 의존하
여, data만 가지고도 label 을 관측하려 하는데, SAE에서는 사실상
deterministic 방법으로 모델을 학습한다.
p(h=0,1)=s(Wx+b)p(h=0,1)=s(Wx+b) 가 아니라,
h=s(Wx+b)h=s(Wx+b) 로 학습한다.
• 이에 따른 단점으로는 완벽한 Deep Generative Model 은 아니라는
것이지만,
• 장점은 training 에 속도가 빠르고, Deep Neural Nets 의 속성들을
이용할 수 있다는 것이다.
Vanishing gradient 문제
• Vanishing gradient 문제는 1991년에 Sepp Hochreiter에 의해 발견
• Vanishing gradient 문제가 더 많은 관심을 받은 이유는 두 가지인데,
하나는 exploding gradient 문제는 쉽게 알아차릴 수 있다는 점이다.
Gradient 값들이 NaN (not a number)이 될 것이고 프로그램이 죽을
것이기 때문이다. 두 번째는, gradient 값이 너무 크다면 미리 정해
준 적당한 값으로 잘라버리는 방법 (이 논문에서 다뤄졌다)이 매우
쉽고 효율적으로 이 문제를 해결하기 때문이다. Vanishing gradient
문제는 언제 발생하는지 바로 확인하기가 힘들고 간단한 해결법이
없기 때문에 더 큰 문제였다.
Vanishing gradient 문제 해결
• W 행렬을 적당히 좋은 값으로 잘 초기화 해준다면 vanishing
gradient의 영향을 줄일 수 있고, regularization을 잘 정해줘도 비슷
한 효과를 볼 수 있다. 더 보편적으로 사용되는 방법은 tanh나
sigmoid activation 함수 말고 ReLU를 사용하는 것이다. ReLU는 미
분값의 최대치가 1로 정해져있지 않기 때문에 gradient 값이 없어져
버리는 일이 크게 줄어든다. 이보다 더 인기있는 해결책은 Long
Short-Term Memory (LSTM)이나 Gated Recurrent Unit (GRU) 구조
를 사용하는 방법이다. LSTM은 1997년에 처음 제안되었고, 현재 자
연어처리 분야에서 가장 널리 사용되는 모델 중 하나이다. GRU
는 2014년에 처음 나왔고, LSTM을 간략화한 버전이다. 두 RNN의
변형 구조 모두 vanishing gradient 문제 해결을 위해 디자인되었고,
효과적으로 긴 시퀀스를 처리할 수 있다는 것이 보여졌다.
Auto Encoder R Source
(theano) 8 Stacked Denoising
Autoencoders (SdA)
Denoising auto encoders(d a)
Denoising auto encoders(d a)
Denoising auto encoders(d a)
Error occurred
C:DevelopEnvironmentPython27python.exe "C:/DevelopEnvironment/PyCharm
Community Edition 4.0.4/Source_Repository/DeepLearningTutorials-
master/code/SdA.py"
... loading data
... building the model
... getting the pretraining
functions Traceback (most recent call last): File "C:/DevelopEnvironment/PyCharm
Community Edition 4.0.4/Source_Repository/DeepLearningTutorials-
master/code/SdA.py", line 491, in <module> test_SdA() File
"C:/DevelopEnvironment/PyCharm Community Edition
4.0.4/Source_Repository/DeepLearningTutorials-master/code/SdA.py", line 382, in
test_SdA batch_size=batch_size) File "C:/DevelopEnvironment/PyCharm Community
Edition 4.0.4/Source_Repository/DeepLearningTutorials-master/code/SdA.py", line
226, in pretraining_functions self.x: train_set_x[batch_begin: batch_end] File
"C:DevelopEnvironmentPython27libsite-
packagestheanocompilefunction.py", line 248, in function "In() instances
and tuple inputs trigger the old " NotImplementedError: In() instances and
tuple inputs trigger the old semantics, which disallow using updates and
givens
Denoising auto encoders(d a)
Error Solution(1)
Error Solution(2)
Success
if __name__ == '__main__':
test_SdA()
def test_SdA(finetune_lr=0.1, pretraining_epochs=15,
pretrain_lr=0.001, training_epochs=1000,
dataset='mnist.pkl.gz', batch_size=1):
datasets = load_data(dataset)
train_set_x, train_set_y = datasets[0]
valid_set_x, valid_set_y = datasets[1]
test_set_x, test_set_y = datasets[2]
# construct the stacked denoising autoencoder class
sda = SdA(
numpy_rng=numpy_rng,
n_ins=28 * 28,
hidden_layers_sizes=[1000, 1000, 1000],
n_outs=10
)
pretraining_fns = sda.pretraining_functions(train_set_x=train_set_x,
batch_size=batch_size)
## Pre-train layer-wise
corruption_levels = [.1, .2, .3]
for i in range(sda.n_layers):
# go through pretraining epochs
for epoch in range(pretraining_epochs):
# go through the training set
c = []
for batch_index in range(n_train_batches):
c.append(pretraining_fns[i](index=batch_index,
corruption=corruption_levels[i],
lr=pretrain_lr))
print('Pre-training layer %i, epoch %d, cost %f' % (i, epoch, numpy.mean(c)))
end_time = timeit.default_timer()
def pretraining_functions(self, train_set_x, batch_size):
# index to a [mini]batch
index = T.lscalar('index') # index to a minibatch
corruption_level = T.scalar('corruption') # % of corruption to use
learning_rate = T.scalar('lr') # learning rate to use
# begining of a batch, given `index`
batch_begin = index * batch_size
# ending of a batch given `index`
batch_end = batch_begin + batch_size
pretrain_fns = []
for dA in self.dA_layers:
# get the cost and the updates list
cost, updates = dA.get_cost_updates(corruption_level,
learning_rate)
# compile the theano function
fn = theano.function(
inputs=[
index,
theano.In(corruption_level, value=0.2),
theano.In(learning_rate, value=0.1)
],
outputs=cost,
updates=updates,
givens={
self.x: train_set_x[batch_begin: batch_end]
}
)
# append `fn` to the list of functions
pretrain_fns.append(fn)
return pretrain_fns
Denoising auto encoders(d a)
1 de 35

Recomendados

A Beginner's guide to understanding Autoencoder por
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderLee Seungeun
6.1K visualizações29 slides
2017 tensor flow dev summit por
2017 tensor flow dev summit2017 tensor flow dev summit
2017 tensor flow dev summitTae Young Lee
3.4K visualizações72 slides
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함) por
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)Lee Seungeun
68K visualizações52 slides
Image Deep Learning 실무적용 por
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용Youngjae Kim
4.5K visualizações84 slides
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod... por
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Haezoom Inc.
8.3K visualizações50 slides
Deep Learning Into Advance - 1. Image, ConvNet por
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetHyojun Kim
2.4K visualizações36 slides

Mais conteúdo relacionado

Mais procurados

딥러닝의 기본 por
딥러닝의 기본딥러닝의 기본
딥러닝의 기본deepseaswjh
5K visualizações66 slides
쫄지말자딥러닝2 - CNN RNN 포함버전 por
쫄지말자딥러닝2 - CNN RNN 포함버전쫄지말자딥러닝2 - CNN RNN 포함버전
쫄지말자딥러닝2 - CNN RNN 포함버전Modulabs
52.1K visualizações88 slides
인공 신경망 구현에 관한 간단한 설명 por
인공 신경망 구현에 관한 간단한 설명인공 신경망 구현에 관한 간단한 설명
인공 신경망 구현에 관한 간단한 설명Woonghee Lee
18.2K visualizações23 slides
밑바닥부터 시작하는딥러닝 8장 por
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장Sunggon Song
5.6K visualizações44 slides
Tensorflow for Deep Learning(SK Planet) por
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tae Young Lee
12.9K visualizações189 slides
딥러닝 자연어처리 - RNN에서 BERT까지 por
딥러닝 자연어처리 - RNN에서 BERT까지딥러닝 자연어처리 - RNN에서 BERT까지
딥러닝 자연어처리 - RNN에서 BERT까지deepseaswjh
21K visualizações43 slides

Mais procurados(20)

딥러닝의 기본 por deepseaswjh
딥러닝의 기본딥러닝의 기본
딥러닝의 기본
deepseaswjh5K visualizações
쫄지말자딥러닝2 - CNN RNN 포함버전 por Modulabs
쫄지말자딥러닝2 - CNN RNN 포함버전쫄지말자딥러닝2 - CNN RNN 포함버전
쫄지말자딥러닝2 - CNN RNN 포함버전
Modulabs52.1K visualizações
인공 신경망 구현에 관한 간단한 설명 por Woonghee Lee
인공 신경망 구현에 관한 간단한 설명인공 신경망 구현에 관한 간단한 설명
인공 신경망 구현에 관한 간단한 설명
Woonghee Lee18.2K visualizações
밑바닥부터 시작하는딥러닝 8장 por Sunggon Song
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장
Sunggon Song5.6K visualizações
Tensorflow for Deep Learning(SK Planet) por Tae Young Lee
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)
Tae Young Lee12.9K visualizações
딥러닝 자연어처리 - RNN에서 BERT까지 por deepseaswjh
딥러닝 자연어처리 - RNN에서 BERT까지딥러닝 자연어처리 - RNN에서 BERT까지
딥러닝 자연어처리 - RNN에서 BERT까지
deepseaswjh21K visualizações
Attention is all you need por Hoon Heo
Attention is all you needAttention is all you need
Attention is all you need
Hoon Heo3.3K visualizações
인공신경망 por 종열 현
인공신경망인공신경망
인공신경망
종열 현4.9K visualizações
Howto_Tensorflow+Linear Regression por Hyo jeong Lee
Howto_Tensorflow+Linear RegressionHowto_Tensorflow+Linear Regression
Howto_Tensorflow+Linear Regression
Hyo jeong Lee962 visualizações
텐서플로우로 배우는 딥러닝 por 찬웅 주
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝
찬웅 주13.8K visualizações
인공지능, 기계학습 그리고 딥러닝 por Jinwon Lee
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝
Jinwon Lee38.5K visualizações
Ai 그까이거 por 도형 임
Ai 그까이거Ai 그까이거
Ai 그까이거
도형 임19.8K visualizações
딥러닝 기본 원리의 이해 por Hee Won Park
딥러닝 기본 원리의 이해딥러닝 기본 원리의 이해
딥러닝 기본 원리의 이해
Hee Won Park33.2K visualizações
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap... por 홍배 김
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
홍배 김2K visualizações
keras 빨리 훑어보기(intro) por beom kyun choi
keras 빨리 훑어보기(intro)keras 빨리 훑어보기(intro)
keras 빨리 훑어보기(intro)
beom kyun choi27.3K visualizações
Energy based models and boltzmann machines - v2.0 por Soowan Lee
Energy based models and boltzmann machines - v2.0Energy based models and boltzmann machines - v2.0
Energy based models and boltzmann machines - v2.0
Soowan Lee2K visualizações
A neural image caption generator por 홍배 김
A neural image caption generatorA neural image caption generator
A neural image caption generator
홍배 김4.5K visualizações
Attention is all you need 설명 por Junho Lee
Attention is all you need 설명Attention is all you need 설명
Attention is all you need 설명
Junho Lee1.9K visualizações
Io17ex automl & autodraw por Tae Young Lee
Io17ex automl & autodrawIo17ex automl & autodraw
Io17ex automl & autodraw
Tae Young Lee2K visualizações
Deep Learning & Convolutional Neural Network por agdatalab
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Network
agdatalab872 visualizações

Destaque

Driving Computer Vision Research Innovation In Artificial Intelligence por
Driving Computer Vision Research Innovation In Artificial IntelligenceDriving Computer Vision Research Innovation In Artificial Intelligence
Driving Computer Vision Research Innovation In Artificial IntelligenceNVIDIA
4.5K visualizações23 slides
weather-data-processing-using-python por
weather-data-processing-using-pythonweather-data-processing-using-python
weather-data-processing-using-pythonmarc_kth
2.6K visualizações32 slides
[224] 번역 모델 기반_질의_교정_시스템 por
[224] 번역 모델 기반_질의_교정_시스템[224] 번역 모델 기반_질의_교정_시스템
[224] 번역 모델 기반_질의_교정_시스템NAVER D2
9.9K visualizações43 slides
Python 2 와 3 공존하기 por
Python 2 와 3 공존하기Python 2 와 3 공존하기
Python 2 와 3 공존하기태환 김
3.6K visualizações53 slides
Spm12를 이용한 fmri analysis por
Spm12를 이용한 fmri analysisSpm12를 이용한 fmri analysis
Spm12를 이용한 fmri analysisTae Young Lee
2.8K visualizações13 slides
[216]딥러닝예제로보는개발자를위한통계 최재걸 por
[216]딥러닝예제로보는개발자를위한통계 최재걸[216]딥러닝예제로보는개발자를위한통계 최재걸
[216]딥러닝예제로보는개발자를위한통계 최재걸NAVER D2
4.3K visualizações47 slides

Destaque(20)

Driving Computer Vision Research Innovation In Artificial Intelligence por NVIDIA
Driving Computer Vision Research Innovation In Artificial IntelligenceDriving Computer Vision Research Innovation In Artificial Intelligence
Driving Computer Vision Research Innovation In Artificial Intelligence
NVIDIA4.5K visualizações
weather-data-processing-using-python por marc_kth
weather-data-processing-using-pythonweather-data-processing-using-python
weather-data-processing-using-python
marc_kth2.6K visualizações
[224] 번역 모델 기반_질의_교정_시스템 por NAVER D2
[224] 번역 모델 기반_질의_교정_시스템[224] 번역 모델 기반_질의_교정_시스템
[224] 번역 모델 기반_질의_교정_시스템
NAVER D29.9K visualizações
Python 2 와 3 공존하기 por 태환 김
Python 2 와 3 공존하기Python 2 와 3 공존하기
Python 2 와 3 공존하기
태환 김3.6K visualizações
Spm12를 이용한 fmri analysis por Tae Young Lee
Spm12를 이용한 fmri analysisSpm12를 이용한 fmri analysis
Spm12를 이용한 fmri analysis
Tae Young Lee2.8K visualizações
[216]딥러닝예제로보는개발자를위한통계 최재걸 por NAVER D2
[216]딥러닝예제로보는개발자를위한통계 최재걸[216]딥러닝예제로보는개발자를위한통계 최재걸
[216]딥러닝예제로보는개발자를위한통계 최재걸
NAVER D24.3K visualizações
[221] 딥러닝을 이용한 지역 컨텍스트 검색 김진호 por NAVER D2
[221] 딥러닝을 이용한 지역 컨텍스트 검색 김진호[221] 딥러닝을 이용한 지역 컨텍스트 검색 김진호
[221] 딥러닝을 이용한 지역 컨텍스트 검색 김진호
NAVER D24.9K visualizações
PYCON KR 2017 - 구름이 하늘의 일이라면 (윤상웅) por Haezoom Inc.
PYCON KR 2017 - 구름이 하늘의 일이라면 (윤상웅)PYCON KR 2017 - 구름이 하늘의 일이라면 (윤상웅)
PYCON KR 2017 - 구름이 하늘의 일이라면 (윤상웅)
Haezoom Inc.9.5K visualizações
[ Pycon Korea 2017 ] Infrastructure as Code를위한 Ansible 활용 por Jihyung Song
[ Pycon Korea 2017 ] Infrastructure as Code를위한 Ansible 활용[ Pycon Korea 2017 ] Infrastructure as Code를위한 Ansible 활용
[ Pycon Korea 2017 ] Infrastructure as Code를위한 Ansible 활용
Jihyung Song2.1K visualizações
Speaker Diarization por HONGJOO LEE
Speaker DiarizationSpeaker Diarization
Speaker Diarization
HONGJOO LEE3.1K visualizações
[F2]자연어처리를 위한 기계학습 소개 por NAVER D2
[F2]자연어처리를 위한 기계학습 소개[F2]자연어처리를 위한 기계학습 소개
[F2]자연어처리를 위한 기계학습 소개
NAVER D212.6K visualizações
아마존 에코를 활용한 음성 인식 에어컨 제어 A to z por Jueun Seo
아마존 에코를 활용한 음성 인식 에어컨 제어 A to z아마존 에코를 활용한 음성 인식 에어컨 제어 A to z
아마존 에코를 활용한 음성 인식 에어컨 제어 A to z
Jueun Seo4.9K visualizações
PYCON 2017 발표자료 한성준 por sungjun han
PYCON 2017 발표자료 한성준PYCON 2017 발표자료 한성준
PYCON 2017 발표자료 한성준
sungjun han4.7K visualizações
Pycon2017 이성용 Dances with the Last Samurai por SungYong Lee
Pycon2017 이성용 Dances with the Last SamuraiPycon2017 이성용 Dances with the Last Samurai
Pycon2017 이성용 Dances with the Last Samurai
SungYong Lee9.9K visualizações
One-Shot Learning por Jisung Kim
One-Shot LearningOne-Shot Learning
One-Shot Learning
Jisung Kim11.8K visualizações
머신러닝의 자연어 처리기술(I) por 홍배 김
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)
홍배 김33.2K visualizações
딥러닝을 이용한 자연어처리의 연구동향 por 홍배 김
딥러닝을 이용한 자연어처리의 연구동향딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향
홍배 김20.4K visualizações
Developing Korean Chatbot 101 por Jaemin Cho
Developing Korean Chatbot 101Developing Korean Chatbot 101
Developing Korean Chatbot 101
Jaemin Cho20.1K visualizações
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016 por Taehoon Kim
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
지적 대화를 위한 깊고 넓은 딥러닝 PyCon APAC 2016
Taehoon Kim204.6K visualizações
Deep learning framework 제작 por Tae Young Lee
Deep learning framework 제작Deep learning framework 제작
Deep learning framework 제작
Tae Young Lee2.3K visualizações

Similar a Denoising auto encoders(d a)

Deep learning overview por
Deep learning overviewDeep learning overview
Deep learning overview강민국 강민국
988 visualizações44 slides
2021-11-16 모두콘 딥러닝 경량화 발표 por
2021-11-16 모두콘 딥러닝 경량화 발표2021-11-16 모두콘 딥러닝 경량화 발표
2021-11-16 모두콘 딥러닝 경량화 발표JongkukLim
260 visualizações23 slides
Dense sparse-dense training for dnn and Other Models por
Dense sparse-dense training for dnn and Other ModelsDense sparse-dense training for dnn and Other Models
Dense sparse-dense training for dnn and Other ModelsDong Heon Cho
324 visualizações32 slides
Transfer learning usage por
Transfer learning usageTransfer learning usage
Transfer learning usageTae Young Lee
151 visualizações64 slides
Anomaly detection practive_using_deep_learning por
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning도형 임
946 visualizações73 slides
History of Vision AI por
History of Vision AIHistory of Vision AI
History of Vision AITae Young Lee
47 visualizações100 slides

Similar a Denoising auto encoders(d a)(20)

Deep learning overview por 강민국 강민국
Deep learning overviewDeep learning overview
Deep learning overview
강민국 강민국988 visualizações
2021-11-16 모두콘 딥러닝 경량화 발표 por JongkukLim
2021-11-16 모두콘 딥러닝 경량화 발표2021-11-16 모두콘 딥러닝 경량화 발표
2021-11-16 모두콘 딥러닝 경량화 발표
JongkukLim260 visualizações
Dense sparse-dense training for dnn and Other Models por Dong Heon Cho
Dense sparse-dense training for dnn and Other ModelsDense sparse-dense training for dnn and Other Models
Dense sparse-dense training for dnn and Other Models
Dong Heon Cho324 visualizações
Transfer learning usage por Tae Young Lee
Transfer learning usageTransfer learning usage
Transfer learning usage
Tae Young Lee151 visualizações
Anomaly detection practive_using_deep_learning por 도형 임
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning
도형 임946 visualizações
History of Vision AI por Tae Young Lee
History of Vision AIHistory of Vision AI
History of Vision AI
Tae Young Lee47 visualizações
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작 por DACON AI 데이콘
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
DACON AI 데이콘1.3K visualizações
Image net classification with deep convolutional neural networks por Korea, Sejong University.
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks
Korea, Sejong University.244 visualizações
딥러닝 논문읽기 efficient netv2 논문리뷰 por taeseon ryu
딥러닝 논문읽기 efficient netv2  논문리뷰딥러닝 논문읽기 efficient netv2  논문리뷰
딥러닝 논문읽기 efficient netv2 논문리뷰
taeseon ryu579 visualizações
Workshop 210417 dhlee por Dongheon Lee
Workshop 210417 dhleeWorkshop 210417 dhlee
Workshop 210417 dhlee
Dongheon Lee155 visualizações
Learning how to explain neural networks: PatternNet and PatternAttribution por Gyubin Son
Learning how to explain neural networks: PatternNet and PatternAttributionLearning how to explain neural networks: PatternNet and PatternAttribution
Learning how to explain neural networks: PatternNet and PatternAttribution
Gyubin Son140 visualizações
네트워크 경량화 이모저모 @ 2020 DLD por Kim Junghoon
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD
Kim Junghoon1.1K visualizações
PaLM Paper Review por Tae Young Lee
PaLM Paper ReviewPaLM Paper Review
PaLM Paper Review
Tae Young Lee113 visualizações
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review por LEE HOSEONG
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
LEE HOSEONG203 visualizações
딥뉴럴넷 클러스터링 실패기 por Myeongju Kim
딥뉴럴넷 클러스터링 실패기딥뉴럴넷 클러스터링 실패기
딥뉴럴넷 클러스터링 실패기
Myeongju Kim284 visualizações
VC를 위한 인공지능 세미나 por JD Yang
VC를 위한 인공지능 세미나VC를 위한 인공지능 세미나
VC를 위한 인공지능 세미나
JD Yang5.8K visualizações
Deep neural networks cnn rnn_ae_some practical techniques por Kang Pilsung
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniques
Kang Pilsung1.7K visualizações
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T... por Mad Scientists
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Mad Scientists3.9K visualizações
Basics of deep learning_imcloud por imcloud
Basics of deep learning_imcloudBasics of deep learning_imcloud
Basics of deep learning_imcloud
imcloud153 visualizações
2019 5-5-week-i-learned-generative model por strutive07
2019 5-5-week-i-learned-generative model2019 5-5-week-i-learned-generative model
2019 5-5-week-i-learned-generative model
strutive0754 visualizações

Mais de Tae Young Lee

Exploring Deep Learning Acceleration Technology Embedded in LLMs por
Exploring Deep Learning Acceleration Technology Embedded in LLMsExploring Deep Learning Acceleration Technology Embedded in LLMs
Exploring Deep Learning Acceleration Technology Embedded in LLMsTae Young Lee
28 visualizações53 slides
LLM 모델 기반 서비스 실전 가이드 por
LLM 모델 기반 서비스 실전 가이드LLM 모델 기반 서비스 실전 가이드
LLM 모델 기반 서비스 실전 가이드Tae Young Lee
1.1K visualizações61 slides
Recommendation System History por
Recommendation System HistoryRecommendation System History
Recommendation System HistoryTae Young Lee
79 visualizações86 slides
검색엔진에 적용된 ChatGPT por
검색엔진에 적용된 ChatGPT검색엔진에 적용된 ChatGPT
검색엔진에 적용된 ChatGPTTae Young Lee
329 visualizações37 slides
검색엔진에 적용된 딥러닝 모델 방법론 por
검색엔진에 적용된 딥러닝 모델 방법론검색엔진에 적용된 딥러닝 모델 방법론
검색엔진에 적용된 딥러닝 모델 방법론Tae Young Lee
48 visualizações31 slides
The Deep Learning Compiler por
The Deep Learning CompilerThe Deep Learning Compiler
The Deep Learning CompilerTae Young Lee
113 visualizações17 slides

Mais de Tae Young Lee(20)

Exploring Deep Learning Acceleration Technology Embedded in LLMs por Tae Young Lee
Exploring Deep Learning Acceleration Technology Embedded in LLMsExploring Deep Learning Acceleration Technology Embedded in LLMs
Exploring Deep Learning Acceleration Technology Embedded in LLMs
Tae Young Lee28 visualizações
LLM 모델 기반 서비스 실전 가이드 por Tae Young Lee
LLM 모델 기반 서비스 실전 가이드LLM 모델 기반 서비스 실전 가이드
LLM 모델 기반 서비스 실전 가이드
Tae Young Lee1.1K visualizações
Recommendation System History por Tae Young Lee
Recommendation System HistoryRecommendation System History
Recommendation System History
Tae Young Lee79 visualizações
검색엔진에 적용된 ChatGPT por Tae Young Lee
검색엔진에 적용된 ChatGPT검색엔진에 적용된 ChatGPT
검색엔진에 적용된 ChatGPT
Tae Young Lee329 visualizações
검색엔진에 적용된 딥러닝 모델 방법론 por Tae Young Lee
검색엔진에 적용된 딥러닝 모델 방법론검색엔진에 적용된 딥러닝 모델 방법론
검색엔진에 적용된 딥러닝 모델 방법론
Tae Young Lee48 visualizações
The Deep Learning Compiler por Tae Young Lee
The Deep Learning CompilerThe Deep Learning Compiler
The Deep Learning Compiler
Tae Young Lee113 visualizações
Aws architecture por Tae Young Lee
Aws architectureAws architecture
Aws architecture
Tae Young Lee382 visualizações
Enhanced ai platform por Tae Young Lee
Enhanced ai platformEnhanced ai platform
Enhanced ai platform
Tae Young Lee835 visualizações
Nvidia architecture por Tae Young Lee
Nvidia architectureNvidia architecture
Nvidia architecture
Tae Young Lee452 visualizações
Ai based on gpu por Tae Young Lee
Ai based on gpuAi based on gpu
Ai based on gpu
Tae Young Lee1K visualizações
Real estate trust solution por Tae Young Lee
Real estate trust solutionReal estate trust solution
Real estate trust solution
Tae Young Lee159 visualizações
Create a solution including deep learning models por Tae Young Lee
Create a solution including deep learning modelsCreate a solution including deep learning models
Create a solution including deep learning models
Tae Young Lee163 visualizações
Infra as a model service por Tae Young Lee
Infra as a model serviceInfra as a model service
Infra as a model service
Tae Young Lee135 visualizações
Bayesian learning por Tae Young Lee
Bayesian learningBayesian learning
Bayesian learning
Tae Young Lee169 visualizações
Deep learning financial product recommendation model por Tae Young Lee
Deep learning financial product recommendation modelDeep learning financial product recommendation model
Deep learning financial product recommendation model
Tae Young Lee585 visualizações
Deep Learning Through Various Processes por Tae Young Lee
Deep Learning Through Various ProcessesDeep Learning Through Various Processes
Deep Learning Through Various Processes
Tae Young Lee546 visualizações
Reinforcement learning por Tae Young Lee
Reinforcement learningReinforcement learning
Reinforcement learning
Tae Young Lee1.1K visualizações
Jenkins in finance por Tae Young Lee
Jenkins in financeJenkins in finance
Jenkins in finance
Tae Young Lee283 visualizações
HistoryOfCNN por Tae Young Lee
HistoryOfCNNHistoryOfCNN
HistoryOfCNN
Tae Young Lee928 visualizações
금융분야 취업을 위한 커리어 설계 por Tae Young Lee
금융분야 취업을 위한 커리어 설계금융분야 취업을 위한 커리어 설계
금융분야 취업을 위한 커리어 설계
Tae Young Lee679 visualizações

Denoising auto encoders(d a)

  • 2. history • 1958 Rosenblatt proposed perceptrons • 1980 Neocognitron (Fukushima, 1980) • 1982 Hopfield network, SOM (Kohonen, 1982), Neural PCA (Oja, 1982) • 1985 Boltzmann machines (Ackley et al., 1985) • 1986 Multilayer perceptrons and backpropagation (Rumelhart et al., 1986) 1988 RBF networks (Broomhead&Lowe, 1988) • 1989 Autoencoders (Baldi&Hornik, 1989), Convolutional network (LeCun, 1989) 1992 Sigmoid belief network (Neal, 1992) • 1993 Sparse coding (Field, 1993)
  • 3. Beyond the Wall deep learning beyond the limits
  • 4. Limitation • First. 먼저 ‘deep’ learning에 대한 이론적인 결 과가 전무했다는 점 (network가 deep 해 지면 문제가 더 이상 convex해지지 않는데, 이 상태에 대해 좋은 convergence는 어디 이며 어떤게 좋은 initialization인가 등에 대한 연구가 전무하다. 즉, learning하면 overfitting이 너무 심하게 일어난다),
  • 5. • Second 이론적으로 연구가 많이 진행되어있는 ‘deep’ 하지 않은 network (perceptron이라 고 한다) 는 xor도 learning할 수 없는 한계 가 존재한다는 점 (linear classifier라 그렇 다).
  • 6. Overcome • 가장 크게 차이 나는 점은 예전과는 다르 게 overfitting을 handle할 수 있는 좋은 연 구가 많이 나오게 되었다. 처음 2007, 2008 년에 등장했던 unsupervised pre-training method들 (이 글에서 다룰 내용들), 2010 년도쯤 들어서서 나오기 시작한 수많은 regularization method들 (dropout, ReLU 등).
  • 7. • Third computation cost가 무시무시해서 그 당 시 컴퓨터로는 도저히 처리할 엄두조차 낼 수 없었다는 점이다. Limitation
  • 8. Overcome • 하드웨어 스펙이 압도적으로 뛰어난데다가, GPU parallelization에 대한 이해도가 높아지게 되면서 에전과는 비교도 할 수 없을 정도로 많은 computation power를 사용할 수 있게 되었다 • 현재까지 알려진 바로는 network가 deep할 수록 그 최종적인 성능이 좋아지며, optimization을 많 이 하면 할 수록 그 성능이 좋아지기 때문에, computation power를 더 많이 사용할 수 있다면 그만큼 더 좋은 learning을 할 수 있다는 것을 의 미한다.
  • 13. Denoising Auto Encoder • Denoising Auto-Encoder는 데이터에 Noise 가 추가되었을 때, 이러한 Noise를 제거하여 원래의 데이터를 Extraction하는 모델이다. • 실제 사물 인식이라든지, Vision을 연구하는 분야에서는 고의적으로 input data에 noise를 추가하고, 추가된 노이즈를 토대로 학습된 데 이터에서 나오는 결과값이, 내가 노이즈를 삽 입하기 전의 pure input 값인지를 확인한다.
  • 14. Input & Output • Denoising Autoencoder 를 제안한 근본적 배 경은 "robustness to partial destruction of the input" 라고 힘주어 말한다. 인풋에 대해 부분적으로 분해 해버리면 부분으로 파괴된 (나뉘어진) 인풋은 거의 같은 representation 을 가질 것이라고 말한다. • 위의 내용을 다시 설명해보면, 훌륭한 대표성 을 가지는 데이터는 종속적인 데이터에서 안 정적인 구조의 데이터를 뽑아내는 것이다.
  • 15. For example • 우리가 안개 속에서 운전을 한다고 가정하자. 만약, 안개 속에서 사람의 형체가 나타나게 되면, 우리의 시각은 자 동적으로 사람의 모양을 인지해서 차량을 정지하거나 서 행한다. 이와 마찬가지이다, 노이즈 된 데이터라 하더라 도 노이즈 속에는 사람의 물체를 나타내주는 상호 종속 적인 인풋데이터들이 존재한다. 사람을 인지함에 있어, 우리는 사람의 모양(modalities) 을 어떤 종속적인 데이 터 속에서 stable 한 구조로 뽑아낸다. 그리고 이러한 Modalities 는 특정 인풋벡터의 combination 으로 존재 할 가능성이 높다. 이러한 모티브에 의해 탄생한 것이 Denoising AutoEncoder 이다.
  • 16. Mechanism • 초기에 stochastic corruption pross에서는 랜덤하게 인풋 데이터의 절반 정도를 0 으 로 맞춰 받아들인다. • 이러한 과정으로 Denoising AE는 노이즈 가 없는(Uncorrupted), 또는 인풋이 0이 아 닌 데이터들을 통해 나머지 0으로 받아들 였던 값들을 예측하려 한다.
  • 18. Stacked Autoencoder(1) • Stacked Autoencoder가 Autoencoder에 비해 갖는 가장 큰 차이점은 DBN(Deep Belief Network)의 구조라는 것 이다. • 기존의 AE는 BP(BackPropagation)를 활용하여 Weight를 학습하였다. 하지만 이는 Layer와 Unit의 개수가 많아지 면 많아질 수록 Weight를 학습하는데 방대한 계산량과 Local Minima 에 빠질 위험이 존재한다. 또한 지속적으 로 작은 값들이 Update 되는 과정에서 Weight의 오차가 점점 줄어드는 이른바, Vanishing Gradient의 문제를 갖 고 있다.
  • 19. • * DBN(Deep Belief Network)에서는 RBM(Restricted Boltzmann Machine)을 도입한 다. RBM은 Fully connected Boltzmann Machine을 변형한 것으로, Unit의 Inner Connection을 제한한 모델로, Layer과 Layer 사이의 Connection 만 존재하는 모델이 다. RBM에서는 BP 방법이 아니라, (Alternative) Gibbs sampling을 활용한 Contrastive Divergence(CD) 를 활용하여 Maximum Likelihood Estimation (MLE) 문 제를 해결하였다. CD트레이닝 방법은 위에서 언급한 MLE 뿐만 아니라, 트레이닝 샘 플의 확률 분포 함수와 모델의 확률 분포 함수의 Kullback-Leibler Divergence를 이용 한 식의 Gradient-Descent 방법을 통해 유도 할 수 있다. • 핵심적인 idea 는 모델링을 함에 있어서 p(y=label|x=data)p(y=label|x=data) 가 아니 라, p(data)p(data) 만을 가지고도 layer 가 label 을 generate 할 수 있도록 Generative Model 을 만드는 것이다. 이 말은 곧, Training Data에서 Input과 Output 이 필요하지 않기 때문에, Unsupervised Learning과 Semi-Supervised Learning에 적 용할 수 있게 되었다. • 이러한 DBN모델에서 층별로 학습시키는 방법을 [Bengio]가 본인의 논문 "Greedy Layer-Wise Training of Deep Networks(2007)"에서 제안한다. 그리고 이를 활용한 모 델이 바로 Stacked AE 이다. 그리고 이러한 학습 방식을 Greedy Layer-Wise Training 라고 한다. Stacked Autoencoder(2)
  • 20. Stacked Autoencoder 장/단점 • Stacked Auto-Encoders(SAE)에서는 완전하게 Deep Generative Model 이라고 할 수 없는 것이, RBM에서는 probabilistic 에 의존하 여, data만 가지고도 label 을 관측하려 하는데, SAE에서는 사실상 deterministic 방법으로 모델을 학습한다. p(h=0,1)=s(Wx+b)p(h=0,1)=s(Wx+b) 가 아니라, h=s(Wx+b)h=s(Wx+b) 로 학습한다. • 이에 따른 단점으로는 완벽한 Deep Generative Model 은 아니라는 것이지만, • 장점은 training 에 속도가 빠르고, Deep Neural Nets 의 속성들을 이용할 수 있다는 것이다.
  • 21. Vanishing gradient 문제 • Vanishing gradient 문제는 1991년에 Sepp Hochreiter에 의해 발견 • Vanishing gradient 문제가 더 많은 관심을 받은 이유는 두 가지인데, 하나는 exploding gradient 문제는 쉽게 알아차릴 수 있다는 점이다. Gradient 값들이 NaN (not a number)이 될 것이고 프로그램이 죽을 것이기 때문이다. 두 번째는, gradient 값이 너무 크다면 미리 정해 준 적당한 값으로 잘라버리는 방법 (이 논문에서 다뤄졌다)이 매우 쉽고 효율적으로 이 문제를 해결하기 때문이다. Vanishing gradient 문제는 언제 발생하는지 바로 확인하기가 힘들고 간단한 해결법이 없기 때문에 더 큰 문제였다.
  • 22. Vanishing gradient 문제 해결 • W 행렬을 적당히 좋은 값으로 잘 초기화 해준다면 vanishing gradient의 영향을 줄일 수 있고, regularization을 잘 정해줘도 비슷 한 효과를 볼 수 있다. 더 보편적으로 사용되는 방법은 tanh나 sigmoid activation 함수 말고 ReLU를 사용하는 것이다. ReLU는 미 분값의 최대치가 1로 정해져있지 않기 때문에 gradient 값이 없어져 버리는 일이 크게 줄어든다. 이보다 더 인기있는 해결책은 Long Short-Term Memory (LSTM)이나 Gated Recurrent Unit (GRU) 구조 를 사용하는 방법이다. LSTM은 1997년에 처음 제안되었고, 현재 자 연어처리 분야에서 가장 널리 사용되는 모델 중 하나이다. GRU 는 2014년에 처음 나왔고, LSTM을 간략화한 버전이다. 두 RNN의 변형 구조 모두 vanishing gradient 문제 해결을 위해 디자인되었고, 효과적으로 긴 시퀀스를 처리할 수 있다는 것이 보여졌다.
  • 23. Auto Encoder R Source
  • 24. (theano) 8 Stacked Denoising Autoencoders (SdA)
  • 28. Error occurred C:DevelopEnvironmentPython27python.exe "C:/DevelopEnvironment/PyCharm Community Edition 4.0.4/Source_Repository/DeepLearningTutorials- master/code/SdA.py" ... loading data ... building the model ... getting the pretraining functions Traceback (most recent call last): File "C:/DevelopEnvironment/PyCharm Community Edition 4.0.4/Source_Repository/DeepLearningTutorials- master/code/SdA.py", line 491, in <module> test_SdA() File "C:/DevelopEnvironment/PyCharm Community Edition 4.0.4/Source_Repository/DeepLearningTutorials-master/code/SdA.py", line 382, in test_SdA batch_size=batch_size) File "C:/DevelopEnvironment/PyCharm Community Edition 4.0.4/Source_Repository/DeepLearningTutorials-master/code/SdA.py", line 226, in pretraining_functions self.x: train_set_x[batch_begin: batch_end] File "C:DevelopEnvironmentPython27libsite- packagestheanocompilefunction.py", line 248, in function "In() instances and tuple inputs trigger the old " NotImplementedError: In() instances and tuple inputs trigger the old semantics, which disallow using updates and givens
  • 33. if __name__ == '__main__': test_SdA() def test_SdA(finetune_lr=0.1, pretraining_epochs=15, pretrain_lr=0.001, training_epochs=1000, dataset='mnist.pkl.gz', batch_size=1): datasets = load_data(dataset) train_set_x, train_set_y = datasets[0] valid_set_x, valid_set_y = datasets[1] test_set_x, test_set_y = datasets[2] # construct the stacked denoising autoencoder class sda = SdA( numpy_rng=numpy_rng, n_ins=28 * 28, hidden_layers_sizes=[1000, 1000, 1000], n_outs=10 ) pretraining_fns = sda.pretraining_functions(train_set_x=train_set_x, batch_size=batch_size) ## Pre-train layer-wise corruption_levels = [.1, .2, .3] for i in range(sda.n_layers): # go through pretraining epochs for epoch in range(pretraining_epochs): # go through the training set c = [] for batch_index in range(n_train_batches): c.append(pretraining_fns[i](index=batch_index, corruption=corruption_levels[i], lr=pretrain_lr)) print('Pre-training layer %i, epoch %d, cost %f' % (i, epoch, numpy.mean(c))) end_time = timeit.default_timer()
  • 34. def pretraining_functions(self, train_set_x, batch_size): # index to a [mini]batch index = T.lscalar('index') # index to a minibatch corruption_level = T.scalar('corruption') # % of corruption to use learning_rate = T.scalar('lr') # learning rate to use # begining of a batch, given `index` batch_begin = index * batch_size # ending of a batch given `index` batch_end = batch_begin + batch_size pretrain_fns = [] for dA in self.dA_layers: # get the cost and the updates list cost, updates = dA.get_cost_updates(corruption_level, learning_rate) # compile the theano function fn = theano.function( inputs=[ index, theano.In(corruption_level, value=0.2), theano.In(learning_rate, value=0.1) ], outputs=cost, updates=updates, givens={ self.x: train_set_x[batch_begin: batch_end] } ) # append `fn` to the list of functions pretrain_fns.append(fn) return pretrain_fns