Regularization, early-stopping and dreaming: A Hopfield-like setup to address generalization and overfitting | Synapse