facebookresearch / theseus

A library for differentiable nonlinear optimization
MIT License
1.77k stars 127 forks source link

Optimize quasi-static pushing cost function's Jacobians #36

Open mhmukadam opened 2 years ago

mhmukadam commented 2 years ago

Current implementation uses a few intermediate matrix multiplication that can be removed and the final results just hardcoded using indexing or basic torch operations.

aymuos15 commented 2 months ago

Can I pick this up if still relevant?

luisenp commented 2 months ago

Hi @aymuos15. Definitely, we welcome contributions. This is the relevant class. It's been a few years, so I don't quite remember which particular matrix products could be simplified, so you may have to look at the math in this paper.

aymuos15 commented 1 month ago

Awesome, thanks! Are these tests enough? (haven't gone through any material yet): https://github.com/facebookresearch/theseus/blob/main/tests/theseus_tests/embodied/motionmodel/test_quasi_static_pushing_planar.py

luisenp commented 1 month ago

Assuming you only change jacobians computation and not error, the second test should give good coverage. When testing for the first time we can increase the batch size and number of reps just to make sure we get more variety of cases.

aymuos15 commented 1 month ago

Okay, sounds good! I will get to this soon. Going through the math for now.

Thank you!