google-deepmind / deepmind-research

This repository contains implementations and illustrative code to accompany DeepMind publications
Apache License 2.0
13.12k stars 2.58k forks source link

Questions about rigid obstacles in "Learning to Simulate Complex Physics with Graph Networks" #162

Open kracon7 opened 3 years ago

kracon7 commented 3 years ago

Hi, Thanks for sharing the work 'Learning to Simulate Complex Physics with Graph Networks". The results looks awesome and I'm trying to re-implement it myself.

However I came across a question about the rigid obstacles in the task WATER-RAMP, specifically the particles in these obstacles. As far as I understand the edges in the constructed graph are directional and each pair of particles has two edges such that the information is propagated in both ways. This makes sense for fluid particles. However for the particles in the rigid obstacles, their positions, velocities and accelerations are supposed to remain constant, and therefore the latent representations as well. In the paper the authors mentioned that "Those particles are treated identical to regular particles, but they are masked out of the loss". So I'm curious why the information is propagated towards these fixed particles from particles of other materials. Wouldn't this change the latent representations of the obstacles particles at every propagation step and affect the other particles at the following propagation steps? Thanks in advance!

piba941 commented 3 years ago

Hi @kracon7, As you mentioned that you are trying to re-implement the work. I might need some help here.

I am trying to train the model using my own dataset that i generated using mantaflow(MPM). However, I am not sure how the data is encoded into tfrecord format. Could you please help me that ?

kracon7 commented 3 years ago

Hi @kracon7, As you mentioned that you are trying to re-implement the work. I might need some help here.

I am trying to train the model using my own dataset that i generated using mantaflow(MPM). However, I am not sure how the data is encoded into tfrecord format. Could you please help me that ?

Hi @piba941, Sorry for the late reply. I used pytorch for my reimplementation.

tianyuzelin commented 3 years ago

Hi, I also try to re-implement this code with Pytorch, but I found that the model can not learn the boundary information. do you have same questions? The same method to deal with boundary in tf can not work in my code.

kracon7 commented 3 years ago

Hi, I also try to re-implement this code with Pytorch, but I found that the model can not learn the boundary information. do you have same questions? The same method to deal with boundary in tf can not work in my code.

Hi @tianyuzelin By boundary do you mean planes like the side wall of the box? If you were talking about the static obstacles made of particles, I simply disabled the propagation from other particles to the particles of static obstacles. And I masked them out while computing loss. So I didn't observe a lot penetration violation. I did have problem with rigid objects keeping their shape during the forward prediciton. As mentioned in the paper the rigid objects can maintain shapes for hundreds of steps, but in my case I was only able to achieve 20-30 steps.

kracon7 commented 3 years ago

Hi, I read the paper many times and was pretty sure that I have followed most of the details of the paper while re-implementing the network. The differences between mine and their work are 1) I was using only one rigid object and no fluid particles 2) I collected my data from MuJoCo 3) the information propagation from/to fixed particles. Not sure whether these will make a lot of difference but in my case the accuracy is far away from 10e-7. That's the reason why my rigid object was only able to maintain its shape in the rollout for 20-30 steps.

On Mon, Apr 26, 2021 at 9:03 PM Guangsi SHI @.***> wrote:

Hi, Thanks for your reply. I also find the obstacles have same questions. More importantly, however, the boundary of the box(side wall of the box ) can not stop the particles fly out of the box. Do you have the same MSE accuracy in your training or evaluation process compared with that paper? In his paper, they mentioned that one-step accuracy have at least 10e-7 and rollout 10e-2 but when using the tf code, I found the loss is 10e-2. In my case the accuracy can not reach that 10e-7 now. Can you re-implement the graph networks as the paper mentioned completely? Thank you and waiting for your reply.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deepmind/deepmind-research/issues/162#issuecomment-827256508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRLCIO2AW3F2JXKZ7GIODLTKYLQVANCNFSM4WRECLWA .

tianyuzelin commented 3 years ago

Hi, I also try to re-implement this code with Pytorch, but I found that the model can not learn the boundary information. do you have same questions? The same method to deal with boundary in tf can not work in my code.

Hi @tianyuzelin By boundary do you mean planes like the side wall of the box? If you were talking about the static obstacles made of particles, I simply disabled the propagation from other particles to the particles of static obstacles. And I masked them out while computing loss. So I didn't observe a lot penetration violation. I did have problem with rigid objects keeping their shape during the forward prediciton. As mentioned in the paper the rigid objects can maintain shapes for hundreds of steps, but in my case I was only able to achieve 20-30 steps.

Hi,

Hi, I read the paper many times and was pretty sure that I have followed most of the details of the paper while re-implementing the network. The differences between mine and their work are 1) I was using only one rigid object and no fluid particles 2) I collected my data from MuJoCo 3) the information propagation from/to fixed particles. Not sure whether these will make a lot of difference but in my case the accuracy is far away from 10e-7. That's the reason why my rigid object was only able to maintain its shape in the rollout for 20-30 steps. On Mon, Apr 26, 2021 at 9:03 PM Guangsi SHI @.***> wrote: Hi, Thanks for your reply. I also find the obstacles have same questions. More importantly, however, the boundary of the box(side wall of the box ) can not stop the particles fly out of the box. Do you have the same MSE accuracy in your training or evaluation process compared with that paper? In his paper, they mentioned that one-step accuracy have at least 10e-7 and rollout 10e-2 but when using the tf code, I found the loss is 10e-2. In my case the accuracy can not reach that 10e-7 now. Can you re-implement the graph networks as the paper mentioned completely? Thank you and waiting for your reply. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#162 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRLCIO2AW3F2JXKZ7GIODLTKYLQVANCNFSM4WRECLWA .

Hi, Yes, I think we may not understand all tricks in the code, so I hope you can re-implement it and have further discussion with you.

tianyuzelin commented 3 years ago

Hi, How do you implement the graph neural networks mentioned in the tf code - Interaction Networks in deepmind's graph_nets library (https://github.com/deepmind/graph_nets).