I’m trying to use neural network as my model for finding input x by means of plain bayes for observation y,like this:
with pm.Model() as multi_objective_model:
para1=pm.Uniform('para1',lower=[-10,-10,-10],upper=[10,10,10])
para2=pm.Uniform('para2',lower=[-10,-10,-10],upper=[10,10,10])
para3=pm.Uniform('para3',lower=[-10,-10,-10],upper=[10,10,10])
sigmas=pm.HalfCauchy('sigmas',[1,1,1])
y_observed=pm.Normal(
"y_observed",
mu=neural network(X,para1,para2,para3),
sigma=sigmas,
observed=Y,
)
prior = pm.sample_prior_predictive()
posterior=pm.sample(draws=4000,tune=2000,target_accept=0.9,chains=4)
I don’t know how to combine neural network built by pytorch or tensorflow with pymc, after all, both tensorflow/pytorch and pytensor have strict shape requirements. Is there any similar example or interface? Is there any similar example or interface?