All Questions

Tagged with
Filter by
Sorted by
Tagged with
6 votes
2 answers
2k views

Keras Autoencoder: Tying Weights from Encoder To Decoder not working

Im creating an Autoencoder as part of my full model for a Kaggle competition. Im trying to tie the weighs of the Encoder, transposed to the Decoder. Before the first Epoch the weights are correctly ...
ElPapi42's user avatar
  • 514
4 votes
1 answer
10k views

Keras Graph disconnected cannot obtain value for tensor KerasTensor

Tensorflow: 2.4.0 This is the Full Error Message: ValueError: Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 64, 64, 3), dtype=tf.float32, name='...
Allstreamer_'s user avatar
3 votes
0 answers
353 views

Keras autoencoder is not reconstructing 1D signals

I would like to train an autoencoder neural network. Assume I have a 1D signal: Then in order to create a dataset, I split this signal into several thousands of (overlapping) segments (each with 1024 ...
Zekhire's user avatar
  • 115
1 vote
1 answer
5k views

how to see tensor value of a layer output in keras

I have a Seq2Seq model. I am interested to print out the matrix value of the output of the encoder per iteration. So for example as the dimension of the matrix in the encoder is (?,20) and the epoch =...
sariii's user avatar
  • 2,080
1 vote
0 answers
156 views

How to export and reuse the model from Tensorflow Image Captioning tutorial?

I followed the whole TensorFlow image captioning tutorial (https://www.tensorflow.org/tutorials/text/image_captioning) and everything works. Now that my model is trained I wanted to know how to export ...
Antonin Beaufort's user avatar
0 votes
1 answer
365 views

No Gradients Provided Keras Tensorflow when nesting Models

Im started to work with Keras a little bit but i run in to this issue where it tells me that no gradients are provided. I know that this question was posted like 100 times before but the solutions are ...
MrDiver's user avatar
  • 122
0 votes
1 answer
33 views

Retrieve input values after passing to hidden layer in every epoch by using autoencoder

I want to retrieve input values after passing to the hidden layer in every epoch. I use an autoencoder to train data from the input (iris.csv). In the code below, I don't know how to intervene to the ...
Dammio's user avatar
  • 961
0 votes
1 answer
317 views

How to choose matching layer sizes in a convolutional autoencoder?

Are there any suggested best practices when choosing layer sizes when building a convolutional autoencoder? For example, if I'm working with a 28x28x1 MNIST image, and creating my model with tf.keras ...
A Poor's user avatar
  • 974
0 votes
1 answer
208 views

Why does Keras documentation examples for autonencoders use Conv2D instead of Conv2DTranspose

I have been following the Keras documentation to build up a CNN autoencoder https://blog.keras.io/building-autoencoders-in-keras.html . from keras.layers import Input, Dense, Conv2D, MaxPooling2D, ...
Tyesh's user avatar
  • 380
0 votes
0 answers
33 views

model.fit function using datasets stops training after 2 epochs

Trying to train a autoencoder model using tensorflow datasets. Trying to use model.fit function to train the model. The training is exiting after 2 epochs. Even after changing the epochs >2. It ...
Richard Deepak's user avatar
0 votes
0 answers
33 views

How to set parameters for decoder to match the encoder

I am finding it hard to understand how the decoder parameters are set to "undo" the encoder parameters when constructing a variational autoencoder. Here is the code from the Keras site: ...
user4562262's user avatar
0 votes
1 answer
276 views

ValueError: All layers added to a Sequential model should have unique names

I am trying to train a VAE model for music generation. When I run the following program, it shows an error: All layers added to a Sequential model should have unique names. Name "" is ...
Wanderer's user avatar
0 votes
1 answer
738 views

KL divergence loss goes to zero while training VAE

I am trying to train a supervised variational autoencoder to perform classification for a noisy dataset. I am using a fully connected encoder and decoder where uses the z as input for an MLP. I'm ...
Akbari's user avatar
  • 58
0 votes
1 answer
112 views

Why VAE in Keras has an exponential?

In Keras VAE implementation: class Sampling(layers.Layer): """Uses (z_mean, z_log_var) to sample z, the vector encoding a digit.""" def call(self, inputs): ...
Joker King's user avatar
0 votes
1 answer
285 views

Autoencoding, using encoding and decoding layers in Keras, Tensorflow- issues in defining latent layers

I've been following a convolutional autoencoder, derived from https://medium.com/analytics-vidhya/building-a-convolutional-autoencoder-using-keras-using-conv2dtranspose-ca403c8d144e using a data set ...
alpined's user avatar
0 votes
0 answers
32 views

Custom loss function in keras (calculate loss based on chosen neurons)

I'm building autoencoder for system recommendation and I want to calculate loss based for example on 200 outputs instead of 500 neurons (data with 500 columns as below). In other words when ...
Thomas Kodill's user avatar
0 votes
1 answer
134 views

how to fit the dimension in the autoencoder of Keras

I am using a convolutional autoencoder for the Mnist image data (with dimension 28*28); here is my code: input_img = Input(shape=(28, 28, 1)) x = Convolution2D(16, (5, 5), activation='relu', padding='...
SC_thesard's user avatar
0 votes
0 answers
104 views

Is there a way to pass a Counter as input into Tensorflow?

I have a dictionary of Counters (from collections,) all keys are integers. I am trying to write an autoencoder which takes a Counter as input. Naive attempts like tf.data.Dataset.from_tensor_slices(...
Parker Wieck's user avatar
0 votes
1 answer
288 views

tf.keras.backend.function for transforming embeddings inside tf.data.dataset

I am trying to use the output of a neural network to transform data inside tf.data.dataset. Specifically, I am using a Delta-Encoder to manipulate embeddings inside the tf.data pipeline. In so doing,...
Ottpocket's user avatar
  • 133
0 votes
1 answer
171 views

Smaller speedup than expected by precomputing encoded output in full pairwise comparison

I am building a neural net to predict the outcome of pairwise comparison. The same encoder network is applied on both inputs before merging and computing the result in the downstream part. In my use ...
Phik's user avatar
  • 444
0 votes
1 answer
63 views

unknow Error in Making AutoEncoder using Keras

from tensorflow.keras import metrics from tensorflow.keras.models import Model from tensorflow.keras.layers import Conv2D, MaxPooling2D, Reshape, Input, Dense,Flatten, Reshape import numpy as np ↑ ...
user avatar
0 votes
0 answers
355 views

TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple' when starting the training of my model

I am trying to build a vector quantized variational autoencoder in tensorflow. A very cryptic error occurs when I build my model and start training. I have gone through the code to find an mistakes ...
Ahmad Jarrar's user avatar
0 votes
1 answer
147 views

random projection after encoder in keras

I plan to do a random projection on the outputs of the encoded and hence input_img = Input(shape=(32, 32, 3)) x = Conv2D(64, (3, 3), padding='same')(input_img) x = BatchNormalization()(x) x = ...
hearse's user avatar
  • 379
0 votes
1 answer
2k views

During creating VAE model throws exception "you should implement a `call` method."

I want to create VAE(variational autoencoder). During model creating it throws exception. When subclassing the Model class, you should implement a call method. I am using Tensorflow 2.0 def vae(): ...
Grig Vardanyan's user avatar
0 votes
1 answer
587 views

Python/TensorFlow/Keras - Input to reshape is a tensor with 300 values, but the requested shape has 200 [[{{node decoder_1/reshape_1/Reshape}}]]

I want to transform my data from 2d to 3d for it I've created Autoencoder where code(hidden layer) has 3 neurons. When training starts it throws exception. import numpy as np import tensorflow as tf ...
Grig Vardanyan's user avatar
0 votes
0 answers
130 views

how to get the real shape of batch_size which is none in keras

When implementing a custom layer in Keras, I need to know the real size of batch_size. my shape is (?,20). questions: 1. What is the best way to change (?,20) to (batch_size,20). I have looked into ...
sariii's user avatar
  • 2,080
0 votes
1 answer
858 views

How to plot ROC curve and compute AUC on AutoEncoder model? [duplicate]

I created an autoencoder model and train it with image sequence dataset. The final result of testset is a reconstructed images. How can I plot ROC curve and calculate AUC? Edited: This is my code: ...
Alpha9's user avatar
  • 121