pybads icon indicating copy to clipboard operation
pybads copied to clipboard

Error converting shapes due to mismatched size of X and s2

Open noraharhen opened this issue 10 months ago • 2 comments

I'm getting this crazy error occasionally while running pybads with specify_target_noise=true. It looks like somehow s2 ends up with more elements than rows of X. Any idea what could be going on here?

Unfortunately, I cant create a reprex—it only happens occasionally with my own model fitting code...

Traceback (most recent call last):
  File "/dfs6/pub/nharhen/foraging/model_fitting/experiment1k_kids/cross_val/bads.py", line 39, in <module>
    result = bads.optimize()
  File "/data/homezvol3/nharhen/.local/lib/python3.9/site-packages/pybads/bads/bads.py", line 1239, in optimize
    ) = self._search_step_(gp)
  File "/data/homezvol3/nharhen/.local/lib/python3.9/site-packages/pybads/bads/bads.py", line 1554, in _search_step_
    gp, gp_exit_flag = local_gp_fitting(
  File "/data/homezvol3/nharhen/.local/lib/python3.9/site-packages/pybads/bads/gaussian_process_train.py", line 402, in local_gp_fitting
    gp, hyp_gp, res, exit_flag = _robust_gp_fit_(
  File "/data/homezvol3/nharhen/.local/lib/python3.9/site-packages/pybads/bads/gaussian_process_train.py", line 542, in _robust_gp_fit_
    new_hyp, _, res = tmp_gp.fit(
  File "/data/homezvol3/nharhen/.local/lib/python3.9/site-packages/gpyreg/gaussian_process.py", line 1008, in fit
    X, y, s2 = self._convert_shapes(X, y, s2)
  File "/data/homezvol3/nharhen/.local/lib/python3.9/site-packages/gpyreg/gaussian_process.py", line 2555, in _convert_shapes
    s2 = s2.reshape(N, 1)
ValueError: cannot reshape array of size 55 into shape (51,1)

noraharhen avatar Apr 09 '24 04:04 noraharhen