# Variational inference with KLqp for LSTM example

**URL:** <https://discourse.edwardlib.org/t/variational-inference-with-klqp-for-lstm-example/647>\
**Category:** General\
**Created:** [February 25, 2018, 4:26pm UTC](https://discourse.edwardlib.org/t/variational-inference-with-klqp-for-lstm-example/647 "2018-02-25T16:26:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wset2](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.edwardlib.org/wset2/32/125_2.png) [@wset2](https://discourse.edwardlib.org/u/wset2)\
**Post date:** [February 25, 2018, 4:26pm UTC](https://discourse.edwardlib.org/t/variational-inference-with-klqp-for-lstm-example/647/1 "2018-02-25T16:26:12Z")

</div>

Hi

Is there any code available for reference on how to use ed.KLqp() for inference (instead of ed.MAP()) for the LSTM example in https://github.com/blei-lab/edward/blob/master/examples/lstm.py .

I am not sure on how to define the model for wx, wh and b.

Thank you in advance.
