Autoencoders U
Autoencoders U
1
Introduction [1]
Autoencoders (AE) are neural networks that aims
to copy their inputs to their outputs.
2
Introduction [1]
Autoencoders (AE) are neural networks that aims
to copy their inputs to their outputs.
3
Introduction [1]
This kind of network is composed of two parts:
4
Introduction [1]
This kind of network is composed of two parts:
Encoder: This is the part of the network that compresses the input
into a latent-space representation. It can be represented by an
encoding function h=f(x).
5
Introduction [1]
This kind of network is composed of two parts:
Encoder: This is the part of the network that compresses the input
into a latent-space representation. It can be represented by an
encoding function h=f(x).
Decoder: This part aims to reconstruct the input from the latent
space representation. It can be represented by a decoding function
r=g(h).
6
Introduction [1]
This kind of network is composed of two parts:
Encoder: This is the part of the network that compresses the input
into a latent-space representation. It can be represented by an
encoding function h=f(x).
Decoder: This part aims to reconstruct the input from the latent
space representation. It can be represented by a decoding function
r=g(h).
The autoencoder as a whole can thus be described by the function 7
g(f(x)) = r where you want r as close as the original input x.
Why copying the input to the output ? [1]
If the only purpose of autoencoders was to copy
the input to the output, they would be useless.
8
Why copying the input to the output ? [1]
If the only purpose of autoencoders was to copy
the input to the output, they would be useless.
9
Why copying the input to the output ? [1]
This can be achieved by creating constraints on
the copying task.
10
Why copying the input to the output ? [1]
This can be achieved by creating constraints on
the copying task.
11
Why copying the input to the output ? [1]
This can be achieved by creating constraints on
the copying task.
12
Why copying the input to the output ? [1]
This can be achieved by creating constraints on
the copying task.
14
Why copying the input to the output ? [1]
This can also occur if the dimension of the latent
representation is the same as the input, and in the
overcomplete case, where the dimension of the
latent representation is greater than the input.
15
Why copying the input to the output ? [1]
This can also occur if the dimension of the latent
representation is the same as the input, and in the
overcomplete case, where the dimension of the
latent representation is greater than the input.
17
Types of Autoencoders [1]
Vanilla autoencoder
In its simplest form, the autoencoder is a three layers
net, i.e. a neural net with one hidden layer.
The input and output are the same, and we learn how to
reconstruct the input, for example using the adam
optimizer and the mean squared error loss function.
18
Types of Autoencoders [1]
Vanilla autoencoder
If the input data has a pattern, for example the digit “1”
usually contains a somewhat straight line and the digit “0” is
circular, it will learn this fact and encode it in a more compact
form.
23
Types of Autoencoders [1]
Convolutional autoencoder
Notice: padding=“valid”
25
Types of Autoencoders
Sparse autoencoder
Please recall, when we apply weight regularizer, it is like
adding a term in loss function like 𝑖 𝑗 |𝑤𝑖𝑗 | for L1
regularization and 𝑖 𝑗 𝑤𝑖𝑗 for L2 regularization. This
2
26
Types of Autoencoders [1]
Sparse autoencoder
28
Types of Autoencoders [2]
Denoising autoencoder
Denoising Autoencoders
31
Stacked Autoencoders [3]
Suppose you wished to train a stacked autoencoder with 2
hidden layers for classification of MNIST digits.
First, you would train a sparse autoencoder on the raw inputs
x(k) to learn primary features h(1)(k) on the raw input.
32
Stacked Autoencoders [3]
Next, you would feed the raw input into this trained sparse
autoencoder, obtaining the primary feature activations h(1)(k)
for each of the inputs x(k).
You would then use these primary features as the "raw input"
to another sparse autoencoder to learn secondary features
h(2)(k) on these primary features.
33
Stacked Autoencoders [3]
Following this, you would feed the primary features into the
second sparse autoencoder to obtain the secondary feature
activations h(2)(k) for each of the primary features h(1)(k)
(which correspond to the primary features of the
corresponding inputs x(k)).
34
Stacked Autoencoders [3]
Finally, you would combine all three layers together to form a
stacked autoencoder with 2 hidden layers and a final softmax
classifier layer capable of classifying the MNIST digits as
desired.
35
Stacked Autoencoders [3]
A stacked autoencoder enjoys all the benefits of any deep
network of greater expressive power.
37
Stacked Autoencoders [4]
38
Fine Tuning Stacked Autoencoders [4]
Fine Tuning
39
Stacked Denoising Autoencoders [4]
40
Stacked Denoising Autoencoders [4]
41
Stacked Denoising Autoencoders [4]
42
References
1. https://towardsdatascience.com/deep-inside-
autoencoders-7e41f319999f
2. https://towardsdatascience.com/applied-deep-learning-
part-3-autoencoders-1c083af4d798
3. http://ufldl.stanford.edu/wiki/index.php/Stacked_Autoe
ncoders
4. https://in.mathworks.com/help/deeplearning/examples/tr
ain-stacked-autoencoders-for-image-classification.html
Disclaimer
These slides are not original and have been
prepared from various sources for teaching
purpose.