# Recommended packages for numerical optimization with symbolic calculus

I'd like to train a model $\widehat{y}_i = F(x_i, \theta)$, by minimizing the sum of a loss function, $L(\widehat{y}_i, y_i, \theta)$.

I'd like to input $\{x_i, y_i\}, F, L$ into a software package and have it perform a gradient-based optimization algorithm to find a good $\theta$.

I don't want to symbolically compute the gradient/Hessian function by hand, as the software should be able to do that. I don't want the software to approximate the gradient with finite differences, since that'd be lazy on the software's part.

Can anyone recommend a good package for this? I'm having trouble finding software that does both symbolic algebra/calculus and numerical optimization.