Learning Discrete Equilibrium