Autoencoding Galaxy Spectra. I. Architecture