Skip to content

Potential mismatch in history window update logic (x_his / v_his) compared to Eq. (3) #9

@Tang-Webber

Description

@Tang-Webber

Hi, thanks for the great work!

I think there may be an off-by-one timing issue at train_eval.py L345:

x_his = torch.cat([x_his.reshape(batch_size, num_particles, -1, 3)[:, :, 1:], x[:, :, None].detach()], dim=2)

Tracing the execution order inside the rollout loop:

L293 x_in = x.clone() # x_in = X_t (snapshot)
L309 pred = material(x, v, x_his) # model sees current = X_t
L310 x, v = sim(...) # x is overwritten in place → X_{t+1}
L345 x_his ← [x_his[:,1:], x[..].detach()] # pushes X_{t+1}, not X_t

So the value appended to the history is X_{t+1} (post-sim), not X_t (pre-sim).
Could you confirm whether the current behavior is intentional, or if pushing x_in is the intended fix?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions