class_docstr: An Autoencoder with deep fully-connected neural nets.
  
  Training Data: MNIST Handwritten Digits (28x28 images)
class_docstr_tok: ["An","Autoencoder","with","deep","fully-connected","neural","nets",".","Training","Data",":","MNIST","Handwritten","Digits","(","28x28","images",")"]
code: def build_encoder(self, optimizer, loss_function):
      encoder = NeuralNetwork(optimizer=optimizer, loss=loss_function)
      encoder.add(Dense(512, input_shape=(self.img_dim,)))
      encoder.add(Activation("leaky_relu"))
      encoder.add(BatchNormalization(momentum=0.8))
      encoder.add(Dense(256))
      encoder.add(Activation("leaky_relu"))
      encoder.add(BatchNormalization(momentum=0.8))
      encoder.add(Dense(self.latent_dim))
  
      return encoder
  
file_path: ML-From-Scratch/mlfromscratch/unsupervised_learning/autoencoder.py
imports: from __future__ import print_function, division
  from sklearn import datasets
  import math
  import matplotlib.pyplot
  import numpy
  import progressbar
  from sklearn.datasets import fetch_mldata
  from mlfromscratch.deep_learning.optimizers import Adam
  from mlfromscratch.deep_learning.loss_functions import CrossEntropy, SquareLoss
  from mlfromscratch.deep_learning.layers import Dense, Dropout, Flatten, Activation, Reshape, BatchNormalization
  from mlfromscratch.deep_learning import NeuralNetwork
label_desc: Use image node_id 2 for calling the Autoencoder obj's underlying member method code with example usage: obj.build_encoder(optimizer, loss_function) and returns: encoder