
On Tue, Mar 15, 2005 at 02:32:06PM -0800, Ralf Juengling wrote:
dot = multiarray.matrixpultiply sum = add.reduce and rewriting outerproduct as a array multiplication (using appropriately reshaped arrays; outerproduct does not occur in forward but in another HMM function)
I got a speedup close to 3 over my prototype implementation for the Baum-Welch algorithm (which calls forward). The idea is to specialize a function and avoid dispatching code in the loop. I guess that a factor of 5 to 10 is reasonable to achieve by specializing other functions in the loop, too.
Hi, this is only side-related to your problem, but are you aware of the existence of http://www.logilab.org/projects/hmm/ ? It may not be very fast (we mainly looked for clarity in the code, and ended with something "fast enough" for our needs), but maybe it will match yours. Or it may provide a starting poing for your implementation. -- Alexandre Fayolle LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org