Closed alexbw closed 11 years ago
The problem might be on my end, but I'm re-running code that I haven't changed, that worked previously. Looking into it.
I believe the API we'd set was that I was supposed to pass in nans, and they'd get removed, right? I'm going up the chain, and in
return scipy.linalg.solve_triangular(L,b,overwrite_b=overwrite_b,lower=True), L
L
has no nans, but b
is the original data, with nans in their original locations.
https://github.com/mattjj/pyhsmm/blob/d586146f310bd36cffacfb83a6ca605166b535a9/util/general.py#L13
Going up one step,
xs,LT = util.general.solve_chofactor_system(sigma,x.T,overwrite_b=True)
x is just like the data, with nans in the original locations
https://github.com/mattjj/pybasicbayes/blob/a50fb55024d9921f6bab990247541832df217cca/distributions.py#L81
I'll go back to earlier commits to find if and when the nans were originally removed.
Right now, I'm just going to throw in a data[np.isnan(data).sum(1) > 0] = 0
before I call add_data.
Can you grep for nan_to_num
in the code you're working on? On my master and dev branches there's a call at line 149 of library_models.py which turns nans into zeros in _aBl (and hence they act like hidden data).
Oh sorry, I read the issue badly; it's not getting there because a lower method is failing on nan's instead of just passing the nan's along. I think I fixed this issue in an update to pybasicbayes that I haven't pulled into this repo. I'm on it...
This is working now.
ValueError Traceback (most recent call last)