I\'m trying to train models that are both deterministic (same result every time) and pre-emptible (training can be interrupted and resumed). The code below is my attempt on