Currently, the optimization notebook uses a loop without early stop criteria. We want to enable this.