Question about auto-encoder quiz autoencoder.fit

I have a question about auto-encoder quiz. Please see picture below. In case of not having noise, we do train data on it’s input, so X_train, X_train is right and it is a case of unsupervised learning. But in case of adding noise, my understanding is that we trained noisy data on non-noisy data (image_noisy on image), so X_train, Y_train answer might also be right and it is more like supervised learning. Could someone comment about this?
Thank you

1 Like

Hello @Dennis_Sinitsky

Because we are trying to fit the training data to itself in auto encoder, the selected option is correct.

one needs to understand the second x train is basically using the same encoding layer but with latent representation of the original X_train data.

Regards
DP

1 Like

Hi Deepti,
please correct me if I am wrong. Let’s say we have two image sets: image_set and noisy_image_set=image_set+generated_noise.
When we train autoencoder on noisy images, we do:
autoencoder.fit(noisy_image_set, image_set, epochs=40)
and not:
autoencoder.fit(noisy_image_set, noisy_image_set, epochs=40)
Am I right or wrong?
Thank you very much for all your explanations.
Dennis

1 Like

@Dennis_Sinitsky

you need to understand when it comes to autoencoder fit, it is alway noisy image set and noisy image set but the second noisy image set is not same as the first noisy image set, it hold the same features but with reduced dimension than first noisy image set.

Please refer the first video of week 2 where Lawrence explains about this part.

Let me know if you understood.

What I think your thought is correct about the output being different from the input in the autoencoder but you are getting confusing about that being totally different output than the original image input.

Basically the original image input used here in question used would x_train which would passed through encoder to get the bottle neck which is again is representative of x_train. It’s a lossy representation of the content in the image, but one which is able to maintain the sense of the original image. Hence in the autoencoder.fit(x_train, x_train, epoch)

Regards
DP

Hi Deepti,
Thank for your reply.
Below are screenshots from noisy digit images ungraded lab.

train_dataset here points to output of map_image_with_noise, which outputs tuple (image_noisy, image)

image


so it does seem to me that we are training noisy image data using non-noisy image labels; not really unsupervised learning (because in unsupervised learning non-noisy images would not be available pre-training). Am I understanding wrong?
Thank you

1 Like

Hello @Dennis_Sinitsky

is the shared image from the same lab you discussed on other thread?? Please confirm this first, so I can response to your query.

Regards
DP

2 Likes

Hi Deepti,
those images are from the noisy image ungraded lab of week 2 course 4 called Fashion MNIST - Noisy CNN AutoEncoder. You can see that we return image_noisy, image tuple and image_noisy is X_train and image is Y_train. This is my understanding, but may be I am incorrect.
I am sorry to ask so many questions, but hope that answering them is also useful to you and for other students to read :slight_smile:
Dennis

1 Like

Hello @Dennis_Sinitsky

Again Dennis as I told you learners can ask any number of questions without worrying about what other think if you have doubt. Mentors would try to help and guide to their best of ability. there are times learners are not satisfied or unhappy with mentor’s response which should be totally acceptable by mentor as long as communication exchange is respectable, so growing knowledge should be totally from an optimistic approach.

Now lets get back to our topic, this might be bigger reply so bare with me and read it with patience

Fashion-MNIST is a dataset of Zalando’s article images consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes.

Also this model would come under supervised learning algorithm and not un unsupervised. Sharing a link which gives information about fashion mnist
fashion_mnist  |  TensorFlow Datasets.

So in the question it states after initialising our autoencoder, meaning your defining your autoencoder model, where
defining autoencoder training model (X_train(this is original input, Y_train(this would be the decoder output), epochs)

so for this model, model fit would be an autoencoder.fit(in which X_train would be again as the original input, and the output here would the output from the encoder output (which is the input from encoder input)===this here is again represented by X_train in the question for it represent the input layer of encoder but is output of encoder). So the second X_train is not same as first X train but input from the bottleneck output

See this below image

def convolutional_auto_encoder():
‘’‘Builds the entire autoencoder model.’‘’
inputs = tf.keras.layers.Input(shape=(28, 28, 1,)) (THIS IS INITIAL INPUT NAMED X_TRAIN FOR THE QUESTION YOU ARE ASKING
encoder_output = encoder(inputs)
bottleneck_output, encoder_visualization = bottle_neck(encoder_output)
decoder_output = decoder(bottleneck_output)

model = tf.keras.Model(inputs =inputs, outputs=decoder_output)
encoder_model = tf.keras.Model(inputs=inputs, outputs=encoder_visualization(THIS HERE IS YOUR SECOND X_TRAIN WHICH IS LATEST REPRESENTATION OF BOTTLE NECK OUTPUT WHICH IS INTURN OUTPUT FROM ENCODER OUTPUT)

return model, encoder_model

So, when history= model(autoencoder.fit(is being used both would be represented here with X_Train(input and X_train(encoder_visualization output), epoch)

which would given us our Y_train from the autoencoder_training(X_train=original input and Y_train= decoder output, epoch)

Please ask if any doubt.

Regards
DP

1 Like

:ok_hand:
I got it!!! Thank you. :slight_smile:

1 Like

have you completed that quiz in the autoencoder topic?

1 Like