agrimgupta92 / sgan

Code for "Social GAN: Socially Acceptable Trajectories with Generative Adversarial Networks", Gupta et al, CVPR 2018
MIT License
810 stars 259 forks source link

A problem in trajectories.py #127

Open neugzy opened 4 months ago

neugzy commented 4 months ago

I think there is a problem in this code segment.

def poly_fit(traj, traj_len, threshold): """ Input:

res_x and res_y are residuals of quadratic terms, so if the value of (res_x + res_y) is bigger than threshold, indicating that the trajectories don't conform to the quadratic distribution. But the code indicates Non Linear. Is not contradictory?

neugzy commented 4 months ago

I think the code should be changed to the following: res_x = np.polyfit(t, traj[0, -traj_len:], 1, full=True)[1] res_y = np.polyfit(t, traj[1, -traj_len:], 1, full=True)[1]

Is my idea correct?