# Passing var\_list parameter in klqp inference

**URL:** <https://discourse.edwardlib.org/t/passing-var-list-parameter-in-klqp-inference/617>\
**Category:** General\
**Created:** [February 13, 2018, 6:24am UTC](https://discourse.edwardlib.org/t/passing-var-list-parameter-in-klqp-inference/617 "2018-02-13T06:24:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://discourse.edwardlib.org/u/hassan)\
**Post date:** [February 13, 2018, 6:24am UTC](https://discourse.edwardlib.org/t/passing-var-list-parameter-in-klqp-inference/617/1 "2018-02-13T06:24:25Z")

</div>

Hello, what is the application of var\_list passed to klqp? I saw it is used in the probabilistic\_pca\_subsampling.py.  
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

```auto
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},
                     var_list=qz_variables,
                     n_samples=5)
inference_z.initialize(scale={x: scale_factor, z: scale_factor},
                     var_list=qw_variables,
                     n_samples=5)

```

> <https://github.com/blei-lab/edward/blob/master/examples/probabilistic_pca_subsampling.py>

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://discourse.edwardlib.org/u/hassan)\
**Post date:** [February 13, 2018, 6:53am UTC](https://discourse.edwardlib.org/t/passing-var-list-parameter-in-klqp-inference/617/2 "2018-02-13T06:53:22Z")

</div>

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 🤔
