-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consufing Gradients on a Simple Scene #97
Comments
modifying the input parameters to function as (increasing the u0 to 0.2 from 0.0) changes the gradients as follows: the derived analytical equation does not imply such behavior, maybe there is something I missed? |
Yes, I agree with you. The analytical gradients of I'm not so familiar with the gradient computation inside Nimble. Could someone explain whether it is the expected behavior or not? I really appreciate any help you can provide! |
I did not rigorously work through the analytical equation, but my immediate intuition is that it is true only locally. If we set the input parameters s.t. the collision would never occur e.g. u0 > v0, wouldn't that break the analytical formula? The collision case does not necessarily show a smooth and differentiable behavior w.r.t input parameters, therefore I cannot conclusively say anything about the gradient computation. However, I would expect to have a gradient w.r.t the u0. |
Confusing Gradient Output
I got confusing output gradients from Nimble on a simple scene. The scene is about two balls with the same mass making fully elastic collision. In this scene, Nimble gives inconsistent gradients with the analytical gradients.
Scene description
Two balls are allowed to move horizontally. There is no friction or gravity. The two balls are of the same mass 1kg and have the same radius r = 0.1m. In the beginning, the left ball at x1 = 0 (shown in blue) moves at v0 = 1m/s to the right, while the right ball at x2 = 0.52m (shown in green) has velocity u0 = 0. Since there is no friction, the blue ball would make the uniform motion. At t = 0.5s, the two balls would collide. Then the two balls would exchange their speeds since they are of the same mass and the collision is fully elastic. The blue ball would then stay still while the green ball moves at 1m/s to the right. At t = T = 1s, the green ball would appear at xf = 1.2m.
Gradients computation
It is easy to show that the analytical form of xf w.r.t. (x1, x2, v0, u0) is:
xf = v0 T + x1 + 2r
So the analytical gradient of xf w.r.t. (x1, x2, v0, u0) is (1, 0, 1, 0).
However, the output gradients from Nimble is (0.75, 0.25, 0.91, 0.08), which is obviously inconsistent with the analytical gradients.
Reproduce
System configuration:
Source code:
Execution results:
The text was updated successfully, but these errors were encountered: