currently the gradient_descent function is full of "non-gradient-descent" related function.
it bothers with a lot of ode related structure. this makes is less universal and the code more complicated to read as it does no seperate the code into proper "units of meaning".
rewrite the function such that it only takes position and range of the free parameters as input
and a where (name of parser) to ask for the cost at a given point.
the parser then handles the communication between the ode system and the grad system which are then completely independent of each other and therefore easier to maintain
currently the gradient_descent function is full of "non-gradient-descent" related function. it bothers with a lot of ode related structure. this makes is less universal and the code more complicated to read as it does no seperate the code into proper "units of meaning".
rewrite the function such that it only takes position and range of the free parameters as input and a where (name of parser) to ask for the cost at a given point. the parser then handles the communication between the ode system and the grad system which are then completely independent of each other and therefore easier to maintain