title: What is the fastest way to compute an RBF kernel in python?
body: <p>I would like to compute an RBF or "Gaussian" kernel for a data matrix <code>X</code> with <code>n</code> rows and <code>d</code> columns. The resulting square kernel matrix is given by:</p>
  
  <pre><code>K[i,j] = var * exp(-gamma * ||X[i] - X[j]||^2)
  </code></pre>
  
  <p><code>var</code> and <code>gamma</code> are scalars.</p>
  
  <p>What is the fastest way to do this in python?</p>