data-driven-advection icon indicating copy to clipboard operation
data-driven-advection copied to clipboard

explicit time dependence

Open yohai opened this issue 5 years ago • 2 comments

https://github.com/googleprivate/pde-superresolution-2d/blob/6981ff1ee8a1bc99275d34d5f835213d02b174f8/pde_superresolution_2d/core/equations.py#L159-L161 @shoyer @JiaweiZhuang I think we might want to change the signature of equation.time_derivative to include the time:

 def time_derivative( 
     self, time, grid: grids.Grid, **inputs: tf.Tensor 
 ) -> Dict[str, tf.Tensor]:

For cases where the equation depends explicitly on time (e.g time-dependent forcing)

yohai avatar Jun 17 '19 03:06 yohai

Yes, indeed. The other option would be to put "time" as a variable in **inputs. I'll need to think about this a little more...

shoyer avatar Jun 17 '19 15:06 shoyer

I considered that, but I think this is more natural since time is a very generic parameter. It also follows the logic of odeint of scipy and the such (ode45 of MATLAB etc). Also, if grid (which is space) is special enough to be a mandatory named argument then time should also be.

yohai avatar Jun 17 '19 15:06 yohai