I am trying to implement the Gaussian process-based model predictive control, where the Gaussian process is used to model the unmodelled dynamics of the system. I understood the theory behind it but faced difficulty in the implementation, basically in optimising the cost function in code. Please share any reading material or tutorial code with me.