Optimal Binary Autoencoding with Pairwise Correlations