Save the optimizer associated with the phase as a pickle

def save_optimizer_for_phase(phase):
    """
    Save the optimizer associated with the phase as a pickle
    """
    with open(make_optimizer_pickle_path(phase), "w+b") as f:
        f.write(pickle.dumps(phase.optimizer))