Closed xiangdonglai closed 4 years ago
I obtained the observation from the new simulator. Different underlying implementations will affect the final output, even with the same input. This is known as error aggregation during the simulation.
I removed relax_initial_state mostly because of performance since apply_pop_filter takes a lot of time by computing the internal energy of each triangle even it is not needed. Actually, when the initial mesh is not extremely stretched, it does not need this step.
Here is a rough list of what I removed and why, but I am not sure if it is complete: relax_initial_state (performance, explained above) remeshing_step (too complicated as the first trial for differentiable simulation) strainzeroing_step (not needed) strainlimiting_step (performance; its gradient cannot be computed when strain limiting is necessary: its optimization results are observed not to be at local optimum)
Sorry for the confusion. Please remind me if I missed other parts.
Hi Junbang. It seems that you are multiplying 1e-4 on the bending coefficients and 1e3 on the stretching coefficients.
https://github.com/williamljb/DifferentiableCloth/blob/master/arcsim/src/conf.cpp#L572 https://github.com/williamljb/DifferentiableCloth/blob/master/arcsim/src/conf.cpp#L578
Is it because you are using different units? Thanks.
Hi xiangdonglai,
This is because I want to scale the material coefficients to around 0~1 when doing material estimation.
As you can see in materials/.json (except for init_mat.json), the stretching parameters are around 1e2 to 1e3, while the bending parameters are around 1e-5 to 1e-6. Using the original scale will cause problems when doing gradient descent on material estimation. So I multiply them by 1e-3 and 1e4 respectively as the new input in the simulation, thereby scale them back to the original scale before the simulation.
This may indeed cause some confusion (e.g. reproducing motion control without a careful check on the material params, simulating with new materials, etc).
Actually, this is one of the very few ways to scale those parameters without destroying something else. During initialization, the stretching parameters will be under further processing to be finally used by the simulation. Given that the parameters have to be registered as Variables, and that resets of the simulation must not change the registration, I think this is the easiest way to scale the parameters with the least code change in the arcsim repo.
Hi Junbang, thank you for the clarification. I was trying to run this code using material parameters given by the original ArcSim project. It produced very strange results so I trace it back to here.
I have a question regarding the material estimation experiment. Did you obtain the observation from the original ArcSim simulator or this differentiable simulator?
In addition, I realize there is some difference between the implementation ArcSim and this one. For example, this simulator does not run
relax_initial_state
during the initialization. Is there a brief description of what has been changed, besides the apparent fact that this one is using torch::Tensor and has gradient computation?Thanks.