[Numpy-discussion] Python implementation of HMM

Alexandre Alexandre.Fayolle at logilab.fr
Tue Mar 15 23:04:26 EST 2005


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20050315/e04bdf7e/attachment-0001.sig>


More information about the NumPy-Discussion mailing list