Gradient Based Optimization Code Python Game Ran San Moi