title: Implementing Support Vector Machine - EFFICIENTLY computing gram-matrix K
body: <p>I'm implementing SVM for mnist data in Python, for now I'm using cvxopt for solving QP and getting alphas back.</p>
  
  <p>But my problem is computing K-gram matrix ** EFFICIENTLY **, I started with only two class (digits 6 and 0), number of training examples less first 1k, next 10K.</p>
  
  <p>To compute whole 1k x 1k matrix faster, I'm using Process, and giving different raws to compute. But still it takes like 2min- its rbf - gaussian. (10k one is still running!) </p>
  
  <p>If anyone worked on it or may be Python lovers can help me here that would be great!</p>
  
  <p>PS: If someone don't know computing gram-matrix, here is detail:
  Its simple:</p>
  
  <pre><code>for i in range(1k):
      for j in range(1k):
           for K[i,j] = some_fun(x[i], x[j])
  </code></pre>
  
  <p>where some_fun - is dot product or fancy gaussian.</p>
  
  <p>I'm using python 2.7, numpy and Mac Air 4G RAM, 128G Solid state.</p>
  
  <p>[EDIT] If anyone ever comes here! Yes SVM DOES take longer ... and if you are doing multi classification then you have to calculate k-gram matrix again .. so its gonna take long so I would suggest that implement algorithm and check it twice and let it run over night! But you gonna see good result next day thats for sure! :)</p>