Complextext2animation icon indicating copy to clipboard operation
Complextext2animation copied to clipboard

Trajectory loss in src/eval_APE.py

Open Mathux opened this issue 2 years ago • 1 comments

Hello,

In src/eval_APE.py line 249, you define the trajectory loss in this way:

trajectory_loss_ += math.sqrt(mse_loss(y_cap[:, 0], y[:, 0]))

As far as I understand, the dimensions of y are [batch_size, number_of_frames, number_of_features]: when I put a debug point, I got [1, 64, 68]. This is confirmed as the other metrics are defined in this way: (line 250)

pelvis_loss_ += math.sqrt(mse_loss(y_cap[:, :, 1], y[:, :, 1])) + \
                    math.sqrt(mse_loss(y_cap[:, :, 2], y[:, :, 2])) + \
                    math.sqrt(mse_loss(y_cap[:, :, 3], y[:, :, 3]))

So, I don't understand the slicing of the trajectory_loss. By doing y[:, 0], you get a tensor of size [1, 68], as you extract the first frame. So it seems that the trajectory loss is computed with all the features of the first frame. I think that the loss should be instead:

trajectory_loss_ += math.sqrt(mse_loss(y_cap[:, :, 0], y[:, :, 0]))

What do you think about it?

Mathux avatar Mar 04 '22 11:03 Mathux

Hi, yes that is a typo. Thanks for pointing it out! We will fix this.

anindita127 avatar Mar 04 '22 15:03 anindita127