holl- / PDE-Control

Code for the ICLR 2020 paper "Learning to Control PDEs"
MIT License
31 stars 9 forks source link

Correspondence between legacy code and article for indirect control incompressible fluid #5

Closed kuwt closed 2 years ago

kuwt commented 3 years ago

I am a little bit confused about the correspondence between the article LEARNING TO CONTROL PDES WITH DIFFERENTIABLE PHYSICS and the legacy code for the case of indirect control incompressible fluid. Therefore, I would like clarifications for the following questions:

image

  1. Method "Straight trajectory" corresponds to the file smokeik_indirect_refine.py. In this method, the data are generated in the way that the smoke in the centre is moved to one of the three bucket in a straight lines. All the densities in the "straight line" sequence are passed to the CFE for the inference of the masked velocity field at each time step. The loss is just the final frame density loss, since the force loss is set to zero here. image

In this case, only CFE is trained and it is trained in a way in order to move the smoke in the centre to the bucket, with the help of the prediction of the density in a straight line direction at each time step. With this method, 89.5+-2.6 % of smoke is able to get to the bucket.

  1. Method "Staggered predictions" corresponds to smokesm_indirect_refine.py. In this method, the same dataset as before is used but only the initial frame and final frame of a sequence is utilized. In this case, both CFE and OPn are used to inference the masked velocity field at each time step. However, only OPn are trained here while CFE is just loaded as an already trained network by the "straight trajectory example". The OPn are first pretrained using the with supervised loss. After that, the OPn are trained with the final density loss and the force loss. This means the OPn are trained in a way in order to minimize the force exerted by the CFE while keeping the density deviation at the center frame small. With this method, 99.22+-0.15% of smoke is able to reach the bucket. Since both OPn and CFE are enabled, the inference time doubles.

  2. Why is the velocity vector potential method not used in the case of indirect control incompressible fluid?

  3. The method "Iterative optim." is not shown in this repository. But it can be seen from the paper that the performance is really bad and much poorer than the learning case. I am curious why with such a result we can still arrive at the conclusion that "we do not believe that learning approaches will replace iterative optimization". Is it that iterative optim does not require training data the reason behind the statement?

holl- commented 3 years ago
  1. and 2. are correct, as far as I can tell.

  2. The vector potential trick only works when there are no obstacles. This trick also goes under the name of stream functions. If you're interested, you can also see it being used here.

  3. While the learning models outperform the iterative optimization in this case, this is not generally true. In the fluid example without obstacles, the iterative optimizer would eventually outperform the network. Additionally, they can be used in combination, with the network providing an initial guess for the optimizer. So while machine learning has great potential, iterative optimization is here to stay.

kuwt commented 3 years ago

I have a follow up question for question 1. Why is the force loss set to zero? I imagine that turning on the force loss might further enhance the performance.

holl- commented 3 years ago

I imagine that turning on the force loss might further enhance the performance.

First of all, looking at the code, it seems like I tested it with and without the force loss. I guess the version without performed better... The force loss works towards a different objective. While the two objectives don't exclude each other, I don't think adding the force loss would help the other objective.

kuwt commented 2 years ago

I would like to know do you have any idea why "The vector potential trick only works when there are no obstacles"? Are there any reference?

holl- commented 2 years ago

Honestly, I'm not sure whether you can make it work. Consider the pressure field which is the complementary (curl-free) potential to stream functions. The pressure cannot be well-defined inside obstacles if you take the obstacle boundaries as fixed. I guess it is similar with the vector potential but I havn't looked into it.

Maybe these links will help: https://physics.stackexchange.com/questions/154252/pressure-coefficient-on-fluid-mechanics https://engineering.stackexchange.com/questions/13405/boundary-conditions-for-stream-function-vorticity-method

kuwt commented 2 years ago

Oh. I get the point. Do you mean we cannot define a potential when some points in the space are invalid?