Confused how to use fit()

Hello,
I am new to tensorflow and I have a basic question. I found the documentation a bit confusing to start off.
I am following this tutorial Intro to Autoencoders  |  TensorFlow Core
But I dont understand why they use this command:

autoencoder.fit(x_train, x_train,
                epochs=10,
                shuffle=True,
                validation_data=(x_test, x_test))

Firstly, why they dont consider the y_train and y_test when loading the data and why when fitting they use the x_train and x_test twice?
I would expect to use something like:

autoencoder.fit(x_train, y_train,
                epochs=10,
                shuffle=True,
                validation_data=(x_test, y_test))

Thank you.

Autoencoders are a specific type of feedforward neural networks where the input is the same as the output. So the targets of the autoencoder are the same as the input. That’s why we supply the training data as the target. Thank you

1 Like

Thank you, I see what I got wrong.