我正在尝试使用gunicorn -w 4 -b 127.0.0.1:4000 myproject:app
来构建mcmc链。这是我的代码:
tensorflow_probability
但是我得到了这个错误:
chain_states, kernel_results = tfp.mcmc.sample_chain(
num_results=tf.constant(1e3, dtype=tf.int32),
num_burnin_steps=tf.constant(1e2, dtype=tf.int32),
parallel_iterations=tf.constant(10, dtype=tf.int32),
current_state=current_state,
kernel=tfp.mcmc.MetropolisHastings(
inner_kernel=tfp.mcmc.HamiltonianMonteCarlo(
target_log_prob_fn=joint_log_prob,
num_leapfrog_steps=tf.constant(2, dtype=tf.int32),
step_size=tf.Variable(1.),
step_size_update_fn=tfp.mcmc.make_simple_step_size_update_policy()
)))