Adversarial Networks and Autoencoders: The Primal-Dual Relationship and Generalization Bounds