The Passage from Discrete to Continuous Variational Problems: a Nonlinear Homogenization Process