Hi all,
I am getting started with the new version where I want to implement a cognitive model with varying trial number per participant. However, when I try to use meta function, it works when sampling from the simulator. But gives below error and does not do the training.
prior_samples = simulator.sample(50)
f = bf.diagnostics.plots.pairs_samples(
samples=prior_samples,
context="Prior"
)
AttributeError: 'int' object has no attribute 'shape'
Later, I tried the the tutorial notebook, called Linear Regression starter, without changing it and got the same error:
bf.diagnostics.plots.pairs_samples(
samples=sim_draws,
variable_keys=par_keys,
variable_names=par_names
)
plt.show()
AttributeError: 'int' object has no attribute 'shape'
Hi Tuba,
welcome to the forum! We also encountered this problem, but it should now work with the newest version on the dev branch. Please update and check out this notebook which uses the pattern for varying N you are aiming for. For the training, especially the section about the Adapter with the use of .broadcast is important.
At which point of the adaptation from online training to offline training do you encounter problems? What do you observe when you call .fit_offline on your workflow object? This notebook features offline training, please take a look at the sections “Dataset” for producing an offline dataset from the simulator, and “Training” for an example of offline training. In this case, I think the adapter would be the same as for online training, and you would pass it when you create the BasicWorkflow object.