Passing var_list parameter in klqp inference


Hello, what is the application of var_list passed to klqp? I saw it is used in the
I guess it is the parameter which is going to be updated in inference, but I can not find a reference to understand when it is needed?
Moreover in the sample it is used reversely (qz_variables for inferring qw and vice versa), is it a bug or I’m missing something here?

Here is the code

inference_w = ed.KLqp({w: qw}, data={x: x_ph, z: qz})
inference_z = ed.KLqp({z: qz}, data={x: x_ph, w: qw})

scale_factor = float(FLAGS.N) / FLAGS.M
inference_w.initialize(scale={x: scale_factor, z: scale_factor},
inference_z.initialize(scale={x: scale_factor, z: scale_factor},


In further examination I found that when I don’t pass var_list (or when I pass qz_variables for qz and qw_variables for qw) the loss does not decrease. So it seems I missed a critical point in this example :thinking: