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

Warnings in snmf.py and performance #46

Open
jspark1105 opened this issue Feb 20, 2019 · 0 comments
Open

Warnings in snmf.py and performance #46

jspark1105 opened this issue Feb 20, 2019 · 0 comments

Comments

@jspark1105
Copy link

I'm seeing warning

nimfa/methods/factorization/snmf.py:610: RuntimeWarning: invalid value encountered in power
  np.mat(2 ** np.array(list(range(l_var - 1, -1, -1)))), p_set)

I see this happens when l_var is 64 exceeding int64 range. Shouldn't we use floating point here like

np.mat(2 ** np.array(list(range(l_var - 1, -1, -1)))).astype(np.float64)

I'm also seeing most of time is spent on flatten() function that can be hoisted out like
from

for i in range(len(i_f)):
    alpha[i_f[i], j_f[i]] = t_d.todense().flatten()[0, i]

to

t_d_flattened = t_d.todense().flatten()
for i in range(len(i_f)):
    alpha[i_f[i], j_f[i]] = t_d_flattened[0, i]
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