Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Issues with layer_likelihood (sparse matrix representation) #50

Open
verginer opened this issue Mar 19, 2018 · 1 comment
Open

Comments

@verginer
Copy link
Member

verginer commented Mar 19, 2018

The layer_likelihood function in tests has a bottleneck the indexing of the transition matrix

transition_matrix = self.transition_matrices[l]
factor_ = paths.paths[k][p][1]
for s in range(len(nodes)-1):
idx_s1 = indexmaps[l][nodes[s + 1]]
idx_s0 = indexmaps[l][nodes[s]]
trans_mat = transition_matrix[idx_s1, idx_s0]
likelihood += np.log(trans_mat) * factor_

Some stats changing the type of sparse matrix used:

dense lil csr csc
layer_likelihood 2.8 3.5 10 27
estimate_order 16.8 17.6 24 42
with instantiation 29.1 30 41 51
@IngoScholtes
Copy link
Collaborator

Kamino cloned this issue to uzhdag/pathpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants