Code to attempt making training faster, but it failed. Commented out. Maybe worth revisiting when parallelized