Questions tagged [autoencoder]

An autoencoder, autoassociator or Diabolo network is an artificial neural network used for learning efficient codings. As such, it is part of the dimensionality reduction algorithms.

The aim of an auto-encoder is to learn a compressed, distributed representation (encoding) for a set of data. This means it is being used for dimensionality reduction. Auto-encoders use two or more layers, starting from the input data (for instance in a face recognition task this would be pixels in the photograph):

  • A number of hidden layers (usually with a smaller number of neurons), which will form the encoder.
  • A number of hidden layer leading to an output layer (usually progressively bigger until the last one, where each neuron has the same meaning as in the input layer), which will form the decoder.

If linear neurons are used, then the optimal solution to an auto-encoder is strongly related to PCA.

When the hidden layers are larger than the input layer, an autoencoder can potentially learn the identity function and become useless; however, experimental results have shown that such autoencoders might still serve learn useful features in this case.

Auto-encoders can also be used to learn overcomplete feature representations of data.

The "coding" is also known as the embedded space or latent space in dimensionality reduction where the encoder will be used to project and the decoder to reconstruct.

1553 questions
49
votes
5 answers

What is the purpose of the add_loss function in Keras?

Currently I stumbled across variational autoencoders and tried to make them work on MNIST using keras. I found a tutorial on github. My question concerns the following lines of code: # Build model vae = Model(x, x_decoded_mean) # Calculate custom…
DocDriven
  • 3,726
  • 6
  • 24
  • 53
44
votes
2 answers

Deep Belief Networks vs Convolutional Neural Networks

I am new to the field of neural networks and I would like to know the difference between Deep Belief Networks and Convolutional Networks. Also, is there a Deep Convolutional Network which is the combination of Deep Belief and Convolutional Neural…
32
votes
1 answer

How does binary cross entropy loss work on autoencoders?

I wrote a vanilla autoencoder using only Dense layer. Below is my code: iLayer = Input ((784,)) layer1 = Dense(128, activation='relu' ) (iLayer) layer2 = Dense(64, activation='relu') (layer1) layer3 = Dense(28, activation ='relu') (layer2) layer4 =…
Whoami
  • 13,930
  • 19
  • 84
  • 140
23
votes
1 answer

Decoder's weights of Autoencoder with tied weights in Keras

I have implemented a tied weights Auto-encoder in Keras and have successfully trained it. My goal is to use only the decoder part of the Auto-encoder as the last layer of another network, to fine tune both the network and the decoder. Thing is, as…
achigeor
  • 370
  • 4
  • 12
19
votes
1 answer

How to connect LSTM layers in Keras, RepeatVector or return_sequence=True?

I'm trying to develop an Encoder model in keras for timeseries. The shape of data is (5039, 28, 1), meaning that my seq_len is 28 and I have one feature. For the first layer of the encoder, I'm using 112 hunits, second layer will have 56 and to be…
Birish
  • 5,514
  • 5
  • 32
  • 51
19
votes
1 answer

TensorFlow: how is dataset.train.next_batch defined?

I am trying to learn TensorFlow and studying the example at: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/autoencoder.ipynb I then have some questions in the code below: for epoch in…
Edamame
  • 23,718
  • 73
  • 186
  • 320
17
votes
2 answers

Does attention make sense for Autoencoders?

I am struggling with the concept of attention in the the context of autoencoders. I believe I understand the usage of attention with regards to seq2seq translation - after training the combined encoder and decoder, we can use both encoder and…
17
votes
2 answers

How do you decide the parameters of a Convolutional Neural Network for image classification?

I am using Convolutional Neural Networks (Unsupervised Feature learning to detect features + Softmax Regression Classifier) for image classification. I have gone through all the tutorials by Andrew NG in this area.…
16
votes
3 answers

Keras LSTM Autoencoder time-series reconstruction

I am trying to reconstruct time series data with LSTM Autoencoder (Keras). Now I want train autoencoder on small amount of samples (5 samples, every sample is 500 time-steps long and have 1 dimension). I want to make sure that model can reconstruct…
Tombozik
  • 161
  • 1
  • 5
13
votes
3 answers

How to resolve runtime error due to size mismatch in PyTorch?

I am trying to implement a simple autoencoder using PyTorch. My dataset consists of 256 x 256 x 3 images. I have built a torch.utils.data.dataloader.DataLoader object which has the image stored as tensor. When I run the autoencoder, I get a runtime…
Shreyas
  • 419
  • 1
  • 5
  • 14
13
votes
1 answer

Auto-encoders with tied weights in Caffe

From my understanding, normally an auto-encoder uses tied weights in the encoding and decoding networks right? I took a look at Caffe's auto-encoder example, but I didn't see how the weights are tied. I noticed that the encoding and decoding…
dontloo
  • 10,067
  • 4
  • 29
  • 50
13
votes
1 answer

Should I use loss or accuracy as the early stopping metric?

I am learning and experimenting with neural networks and would like to have the opinion from someone more experienced on the following issue: When I train an Autoencoder in Keras ('mean_squared_error' loss function and SGD optimizer), the…
Mark
  • 435
  • 1
  • 4
  • 10
13
votes
2 answers

Tied weights in Autoencoder

I have been looking at autoencoders and have been wondering whether to used tied weights or not. I intend on stacking them as a pretraining step and then using their hidden representations to feed a NN. Using untied weights it would look like:…
12
votes
1 answer

LSTM Autoencoder problems

TLDR: Autoencoder underfits timeseries reconstruction and just predicts average value. Question Set-up: Here is a summary of my attempt at a sequence-to-sequence autoencoder. This image was taken from this paper:…
rocksNwaves
  • 5,331
  • 4
  • 38
  • 77
12
votes
2 answers

Intermediate layer makes tensorflow optimizer to stop working

This graph trains a simple signal identity encoder, and in fact shows that the weights are being evolved by the optimizer: import tensorflow as tf import numpy as np initia = tf.random_normal_initializer(0, 1e-3) DEPTH_1 = 16 OUT_DEPTH = 1 I =…
lurscher
  • 25,930
  • 29
  • 122
  • 185
1
2 3
99 100