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 ran into another problem with the experimental JAX-based sampler on the pymc3jax branch:
I am playing around with a hierarchical model where I am simulating something like a hierarchical Gaussian mixture process, i.e. I have 3 clusters with associated cluster_means and std around them and then I simulate a number of instantiations for each cluster, where each instance has its own mean and a fixed std.
This is the code to simulate the data
importpandasaspdimportnumpyasnpimportpymc3aspmimportarvizasazimportpylabasplnp.random.seed(123)
N_clusters=3# Number of clustersN_samples= [10, 5, 0] # Number of samples per clustertotal_samples=sum(N_samples)
N=100# Number of samples per samplecluster_means= [1., 2., 3.] # Mean of means within clustercluster_means_std= [0.1, 0.1, 0.1] # Std of means within clusterstd=0.5data= []
true_means= []
foriinrange(N_clusters):
ifN_samples[i] >0:
means=np.random.normal(loc=cluster_means[i], scale=cluster_means_std[i], size=N_samples[i])
true_means=np.append(true_means, means)
data.append(np.array([np.random.normal(means[j], std, N) forjinrange(N_samples[i])]))
data=np.vstack(data)
clusters= []
foriinrange(N_clusters):
clusters+= [i] *N_samples[i]
data=data.reshape(-1)
c=np.repeat(clusters, N).reshape(-1)
sample=np.repeat(np.arange(sum(N_samples)), N)
Description of your problem
I ran into another problem with the experimental JAX-based sampler on the
pymc3jax
branch:I am playing around with a hierarchical model where I am simulating something like a hierarchical Gaussian mixture process, i.e. I have 3 clusters with associated cluster_means and std around them and then I simulate a number of instantiations for each cluster, where each instance has its own mean and a fixed std.
This is the code to simulate the data
Using these data, I am creating this model:
and then I want to use the sampler to do inference:
Please provide the full traceback.
Running this code, I am getting this error:
Versions and main components
The text was updated successfully, but these errors were encountered: