improved forward performance
added support for stacked autoencoders