The following figure shows the shapes and orientation of digits from MNIST captured by the sparse autoencoder:
Filter generated by the sparse autoencoder to get the digit outcome
The filter learned by the sparse autoencoder can be visualized using the visualize.hidden.units function from the autoencoder package. The package plots the weight of the final layer with respect to the output. In the current scenario, 100 is the number of neurons in the hidden layer and 256 is the number of nodes in the output layer.