Linearly Constrained Nonsmooth Optimization for Training Autoencoders