GWeindel / hmp

Repository for the hmp python package
BSD 3-Clause "New" or "Revised" License
35 stars 8 forks source link

Re-organizing the cross-correlated values is now done at the init phase instead of repeatedly on each EM() call #62

Closed GWeindel closed 1 year ago

GWeindel commented 1 year ago

Current behavior: At each call of EM() the crosscorrelated data (all_samples X n_dimensions) in self.event is re-organized into a by-trial matrix (max_samples X n_trials X n_dimensions).

Problem: Given that the cross-correlated data is not susceptible to change once hmp.models.hmp() is initialized, the most efficient way is to do it only once at the init call.

Consequence: speed up is very modest for single call of EM() but function making repeated calls (hmp.fit(), hmp.sliding_event, hmp.backward_estimation) the speed up can be as high as x2

possible problems:

Will be shipped with issue #61