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
0
votes
0 answers

Autoencoder in Keras with low Validation loss but reconstruction is just a noise

I am trying to compress a timewave by using autoencoder. I am using the below-mentioned architecture. #input_wave = Input(shape=(7500,)) encoded_1 = Dense(1000, activation='tanh',input_shape=(7500,)) encoded_2 = Dense(500,…
Ali Raza
  • 49
  • 1
  • 6
0
votes
1 answer

merging 2 CNNs into an autoencoder in Keras

I am trying to merge 2 CNNs and then un-merge them through an autoencoder but I always get the same error message saying "ValueError: total size of new array must be unchanged", not sure what is wrong with my network. I am replacing the LSTM and CNN…
0
votes
1 answer

Value error with dimensions in designing a simple autoencoder

Hi I am trying out a simple autoencoder in Python 3.5 using Keras library. The issue I face is - ValueError: Error when checking input: expected input_40 to have 2 dimensions, but got array with shape (32, 256, 256, 3). My dataset is very small (60…
mrin9san
  • 305
  • 1
  • 2
  • 12
0
votes
1 answer

Numpy: Increasing size of 4th dimension

I have a 4D numpy array: (#images, height, width, channels) of RGB images. The exact dimensions are (46, 224, 224, 3). I also have the grayscale versions of the same images. The exact dimensions are (46, 224, 224, 1). I'm playing with Keras, trying…
Richard Żak
  • 814
  • 1
  • 11
  • 21
0
votes
1 answer

Convolution Autoencoder Image Dimension Error

I have the following Convolutional Autoencoder setup: class autoencoder(nn.Module): def __init__(self): super(autoencoder, self).__init__() self.encoder = nn.Sequential( nn.Conv2d(1, 16, 3, stride=3, padding=1), # b, 16, 10, 10 …
0
votes
1 answer

ValueError: Error when checking target: expected conv2d_21 to have 4 dimensions, but got array with shape (26, 1)

I have images with shape (3600, 3600, 3). I'd like to use an autoencoder on them. My code is: from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D from keras.models import Model from keras import backend as K from…
0
votes
1 answer

How can I modify the read-only outputs of an Autoencoder object?

I get an object of class type Autoencoder after running the specified function: [X,T] = wine_dataset; hiddenSize = 25; autoenc1 = trainAutoencoder(X,hiddenSize,... 'L2WeightRegularization',0,... …
0
votes
0 answers

Improve convergence rate of Keras autoencoder

I want to train a convolutional autoencoder on (pretty noisy) images. For that I build a training_generator and a validation_generator that both produce batches of 120 images. I use 111 batches per epoch for training and 47 batches per epoch for…
Make42
  • 12,236
  • 24
  • 79
  • 155
0
votes
0 answers

Why is my autoencoder not using all elements of its code?

I'm trying to build an autoencoder using Keras. My goal is to compress a 200-dim vectorial space into a 20-dim one. For some reason, whenever I train the autoencoder, it always ends up not using some of the elements of it's compression. For…
Zagorax
  • 11,440
  • 8
  • 44
  • 56
0
votes
0 answers

How to use only two channels for gray scale images in Convolutional neural network and autoencoders not 3 channels RGB

I have a gray scale images (ultrasound) and i want to train them using CNN and autoencoders but i have issue with number of channels which is 3 by default , when i use the 3 channels an error reported , how can i use only 2 channels. ValueError:…
0
votes
0 answers

Trying to vectorizaion of gray scale image from bottelneck layer

i am working on program that make a vectorization for gray scale images not RGB that taken bottleneck layer from autoencoder but i have the following error, any suggestion: Root: image at /path/to/images is not RGB , therefore not using it
0
votes
0 answers

Cost Function in keras

How do I implement a network cost function of type autoencoder in keras based on the database labels. The examples of this base have labels 0 and 1. I did the form presented below, I do not know if it is correct. def loss_function (x): def…
Monteiro
  • 1
  • 1
0
votes
1 answer

convolutional autoencoder to analyse long 1-D sequences

I have a dataset of 1-D vectors each 3001 digits long. I have used a simple convolutional network to perform binary classification on these sequences: shape=train_X.shape[1:] model = Sequential() model.add(Conv1D(75,3,strides=1, input_shape=shape,…
0
votes
0 answers

Keras: split to train and test after adding noise is not working

I built a denoising autoencoder for training and testing I had to split dataset(image) to train set and test set. If I split before adding noise its working but if I split after adding nosing its not working. I need to split after adding noise. what…
0
votes
0 answers

Training Sparse Autoencoder in tensorflow

Trying to traing a sparse autoencoder, but from the first epoch its loss showing 'nan'. train dataset is normalized between 0 and 1. ##cost function prediction=decoder_res #output from…