In a low-research day the most fun I had was working in pair-code mode to speed up Fadely's mixture of factor analyzers code, now published on PyPI. Most of our speed-up came from realizing that (somewhere inside a pretty complicated expression)
(where
c = numpy.diag(a[:, None] * b[None, :])
a
and b
are one-dimensional numpy
arrays of the same length) is exactly equivalent to
Duh! That embarrassment aside, I think we have some pretty useful code now. Time to test it out. Please help!
c = a * b
2012-10-11
speeding up code
Labels:
code,
data,
model,
not research,
practice
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment