Hi Physics!



 PhysicsIsFun:

However, it also differs by the fact that PyTorch subtracts the velocity from the parameter, instead of adding it.


The two formulations are equivalent.  Let’s call the “velocity” in the
first, pytorch, formulation vPytorch_{t} and in your second proposed
version vPhysics_{t}.  The two formulations only differ in a redefinition
of v, namely vPhysics_{t} = -vPytorch_{t}, that drops out of the
final calculation of p_{t}.
Now you might prefer to call the thing that you add to your “position”,
p_{t}, a “velocity,” so you might prefer the second, vPhysics,
formulation.  But that is purely a semantic or stylistic choice – again,
the two formulations are mathematically equivalent.
Best.
K. Frank