title: Improve performance of autograd jacobian
body: <p>I'm wondering how the following code could be faster. At the moment, it seems unreasonably slow, and I suspect I may be using the autograd API wrong. The output I expect is each element of <code>timeline</code> evaluated at the jacobian of f, which I do get, but it takes a long time:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  from autograd import jacobian
  
  
  def f(params):
      mu_, log_sigma_ = params
      Z = timeline * mu_ / log_sigma_
      return Z
  
  
  timeline = np.linspace(1, 100, 40000)
  
  gradient_at_mle = jacobian(f)(np.array([1.0, 1.0]))
  
  </code></pre>
  
  <p>I would expect the following: </p>
  
  <ol>
  <li><code>jacobian(f)</code> returns an function that represents the gradient vector w.r.t. the parameters. </li>
  <li><code>jacobian(f)(np.array([1.0, 1.0]))</code> is the Jacobian evaluated at the point (1, 1). To me, this should be like a vectorized numpy function, so it should execute very fast, even for 40k length arrays.  However, this is not what is happening.</li>
  </ol>
  
  <p>Even something like the following has the same poor performance:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  from autograd import jacobian
  
  
  def f(params, t):
      mu_, log_sigma_ = params
      Z = t * mu_ / log_sigma_
      return Z
  
  
  timeline = np.linspace(1, 100, 40000)
  
  gradient_at_mle = jacobian(f)(np.array([1.0, 1.0]), timeline)
  
  </code></pre>