After #8, we want to make the computations of Root_Dynamics and Leaf_Dynamics efficient.
Assume the general form of a module is y = f(x, p) where, for a single time step, location, and parameter set, the input x, output y, and parameters p are scalars and their shape is [1].
With vectorization, model can handle multiple locations and multiple parameter sets per time step.
A. Data array organization inside a module (think of a chunk):
The idea is to change the crop model’s data structure so it can work with input arrays of any size, scalars, 1D, 2D, 3D, and so on. Ideally, the model should take in the parameters as ndarrays (or tensors) with the same length and return ndarrays (or tensors) in response.
B. Data array organization inside Engine (think of an xarray with Dask):
Currently engine takes care of slicing data over time steps and passes it to each module. n_timestpes will be added to the input/output of the engine. The computations are time-dependent, and the parallelization (or batch processing) is done on other dimensions. see also #30
After #8, we want to make the computations of Root_Dynamics and Leaf_Dynamics efficient.
Assume the general form of a module is
y = f(x, p)where, for a single time step, location, and parameter set, the inputx, outputy, and parameterspare scalars and their shape is [1].With vectorization, model can handle multiple locations and multiple parameter sets per time step.
A. Data array organization inside a module (think of a chunk):
The idea is to change the crop model’s data structure so it can work with input arrays of any size, scalars, 1D, 2D, 3D, and so on. Ideally, the model should take in the parameters as ndarrays (or tensors) with the same length and return ndarrays (or tensors) in response.
B. Data array organization inside Engine (think of an xarray with Dask):
Currently engine takes care of slicing data over time steps and passes it to each module.
n_timestpeswill be added to the input/output of the engine. The computations are time-dependent, and the parallelization (or batch processing) is done on other dimensions. see also #30