added early termination for training when we cannot beat the identity function