fabianp / hrf_estimation

HRF estimation
13 stars 6 forks source link

error in running function rank_one #7

Open RuoJZ opened 5 years ago

RuoJZ commented 5 years ago

Hi Fabian, Thanks for sharing the toolbox! I understand that the package is not actively maintained at the moment but thought I would give a try asking the question. I was trying to work through the example that you provided for hrf_estimation. However I ran into this error message (pasted below) when trying to run rankone.py. I'm fairly new to python programming and have not yet been able to figure out why the error has occurred. I would much appreciate if you'd share any thoughts. Thanks!

Traceback (most recent call last):

File "", line 1, in out = he.rank_one(design, a, n_basis, drifts=drifts)

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/hrf_estimation/rankone.py", line 261, in rank_one **kwargs)

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/scipy/optimize/lbfgsb.py", line 199, in fmin_l_bfgs_b **opts)

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/scipy/optimize/lbfgsb.py", line 335, in _minimize_lbfgsb f, g = func_and_grad(x)

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/scipy/optimize/lbfgsb.py", line 285, in func_and_grad f = fun(x, *args)

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/scipy/optimize/optimize.py", line 292, in function_wrapper return function(*(wrapper_args + args))

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/scipy/optimize/optimize.py", line 63, in call fg = self.fun(x, *args)

File "/Users/zhour/anaconda3/lib/python3.6/site-packages/hrf_estimation/rankone.py", line 65, in f_grad res = Y.ravel() - X.dot(np.outer(u, v).ravel('F')).ravel() - drifts.dot(bias)

ValueError: operands could not be broadcast together with shapes (23520,) (20160,)