tug of war generative model (in python)