train autoencoders simultaneously