How it works...

The fit() method accepts both features and labels as attributes for the first and second attributes, respectively. We reconstruct the MNIST features against themselves. In other words, we are trying to recreate the features once they are encoded and check how much they vary from actual features. We measure the reconstruction error during training and bother only about the feature values. So, the output is validated against the input and resembles how an autoencoder functions. So, step 1 is crucial for the evaluation stage as well.

Refer to this block of code:

for(INDArray data : featuresTrain){
net.fit(data,data);
}

That's the reason why we train the autoencoder against its own features (inputs) as we call fit() in this way: net.fit(data,data) in step 2.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset