modified deep learning stop criteria