![](https://secure.gravatar.com/avatar/ec0ce0bbdd0adfa9e448b50cdb9372f0.jpg?s=120&d=mm&r=g)
hello all! I got some problems using the optimize.minimize(method='L-BFGS-B'). I want to fit a 2D Gaussian signal, and I have got the initial guess for x0, ∑, a (the mean vector, covariance matrix, weight). The loss is defined as the L2 norm of the difference between the calculated signal and the original image. But the function 'optimize.minimize' forces me to write the variables into a 1D array, so I have to arrange write it as x_init = [x0[0],x0[1],∑00,∑01,∑11,a]. But these terms have totally different physical meanings, and their values may be in different orders of magnitude. So as expected, no matter what initial values were used, the minimization stopped after only one iteration and the result was incorrect. I want to optimize 3 parameters simultaneously: the mean vector, the covariance matrix, the weight. But the 'optimize.minimize' function forced me to use only one variable. So how should I organize my variables?