I saw what you wrote about your dot product speed issue. Did you try using NumPy's einsum function? http://docs.scipy.org/doc/numpy/reference/generated/numpy.ei...
It's really fast for this kind of stuff. Happy to give details about how to use it if you need.