Open mynanshan opened 4 months ago
You mentioned that the modified optimization procedure was not faster than the old one. It is probably due to the implementation. Generally speaking, matrix-vector operations with Numpy are fast as they can be computed in a parallel fashion. However, in the current code snippet, there is a for-loop with nested numerical integration treating each component in c
separately, which means the computation-demanding part has to be computed sequentially. We can discuss how to optimize this part of the codes.
What is the actual algorithm used by the
minimize
?https://github.com/yizeli020/Benjaminlee1/blob/2e4059e7f5fc32de30e6a8836858f0736a0cfd56/demo-ODEparamEst-spline.py#L56
This optimization step takes a while to be finished. The consumed time is too long for this simple ODE model. Try to switch to a better algorithm. It will usually be good to use explicitly calculated gradients, instead of just providing the objective function to a minimizer.