You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just want to add a tiny comment that is not very relevant to this PR: initial point will be set to a `np.array` type if not specified, through [_get_default_initial_point](https://github.com/CUQI-DTU/CUQIpy/blob/4a07108f2bb3505dfa8b5db2a8b7ba1a1fde766d/cuqi/experimental/mcmc/_sampler.py#L389C1-L391C28); if specified, it will be set to whatever the user gives, a scalar in this case. I wonder if we should add something to check if the user specified initial point is compatible and possibly convert it to a uniform format, like `np.array`.
A somehow related scenario, with the current test case, if we set the initial point of x to be a list, list(0.5*np.ones(10)), it will lead to an error:
File ~/CUQIpy/cuqi/experimental/mcmc/_gibbs.py:156, in HybridGibbs.sample(self, Ns)
154 """ Sample from the joint distribution using Gibbs sampling """
155 for_in progressbar(range(Ns)):
--> 156 self.step()
157 self._store_samples()
File ~/CUQIpy/cuqi/experimental/mcmc/_gibbs.py:206, in HybridGibbs.step(self)
203 sampler.step()
205 # Extract samples (Ensure even 1-dimensional samples are 1D arrays)
--> 206 self.current_samples[par_name] = sampler.current_point.reshape(-1)
AttributeError: 'list' object has no attribute 'reshape'
A somehow related scenario, with the current test case, if we set the initial point of
x
to be a list,list(0.5*np.ones(10))
, it will lead to an error:Originally posted by @chaozg in #484 (comment)
The text was updated successfully, but these errors were encountered: