Dear all,
I have read many tutorials on how to use PyTorch to make a regression over a data set using  for instance a model composed of several linear layers and the MSE loss.
Well, imagine that a known  function F which depends on a variable x and some unknown parameters (p_j: j=0,…, P-1) with P relatively small,  is a composition of special functions that cannot be modelized by the usual layers. So, my problem is a classical minimization problem knowing the data {x_i,y_i}_i<=N
 C(p_0,p_1,...,p_P) = Sum_i (F(x_i;{p_j}) - y_i)^2 

The “loss”  C({p_j}) that I want to minimize  is the only function that I can call with a set of parameters.
Is there a way to use the PyTorch minimizers to get the minimum of C({p_j}) ?