title: Inspect internal variables as scipy.optimize.minimize runs?
body: <p>I usually inspect my variables with <code>pdb</code> as my program runs. Now I wish to debug my <code>scipy.optimize.minimize</code> by inspecting the variables as the optimization runs.</p>
  
  <pre><code>result = scipy.optimize.minimize(fun, x0, method='dogleg')
  </code></pre>
  
  <p>I tried using the <code>callback</code> option, but it doesn't give me access to the optimization's internal parameters, such as the Jacobian matrix, etc.</p>
  
  <p>The returned <code>result</code> does have all the information I need, but it's only returned at the end of the entire optimization, but I need the (intermediate) results as the optimization runs.</p>
  
  <p>So my question: how do I return the intermediate optimization parameters (such as Jacobian) as <code>scipy.optimize.minimize</code> runs?</p>