Functional Autoencoder for Smoothing and Representation Learning