Adrian_Briceno_Aguil:

That is why I tried to use np.mgrid to produce sample (x,y) uniformly and use it as my training set. Could you think of any way I could do it more easily?


I think you are using a valid approach.
Are you concerned about the ordering of the data after the reshape?
If so, you could print some data and check, if the shape is expected.
After my view operation, the [50, 50] numpy array would be flattened to [2500, 1], so that each “point” is a sample now.