# LSTM PYNQ on PYNQ Z1/Z2 for time series forcasting

**URL:** <https://discuss.pynq.io/t/lstm-pynq-on-pynq-z1-z2-for-time-series-forcasting/3105>\
**Category:** Support\
**Created:** [October 6, 2021, 7:15am UTC](https://discuss.pynq.io/t/lstm-pynq-on-pynq-z1-z2-for-time-series-forcasting/3105 "2021-10-06T07:15:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samifry](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/samifry/32/2435_2.png) [@samifry](https://discuss.pynq.io/u/samifry)\
**Post date:** [October 6, 2021, 7:15am UTC](https://discuss.pynq.io/t/lstm-pynq-on-pynq-z1-z2-for-time-series-forcasting/3105/1 "2021-10-06T07:15:40Z")

</div>

Hi!

I’m actually trying to use this repository : [GitHub - Xilinx/LSTM-PYNQ](https://github.com/Xilinx/LSTM-PYNQ)

I want to generate RTL code and IP from a Python LSTM network using pytorch to do time series forcasting in real-time. I want to implement that on a pynq z1 or z2 board. The above repository allows that ? How can I generate automatically Vivado HLS generated RTL and IP from my python lstm network ?

Thanks in advance !  
Sami

---

<div class="post-metadata">

**Author:** ![abdyoyo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/abdyoyo/32/2297_2.png) [@abdyoyo](https://discuss.pynq.io/u/abdyoyo)\
**Post date:** [October 6, 2021, 7:48am UTC](https://discuss.pynq.io/t/lstm-pynq-on-pynq-z1-z2-for-time-series-forcasting/3105/2 "2021-10-06T07:48:38Z")

</div>

> [@samifry](#):
>
> me. I want to implement that on a pynq z1 or z2 board. The above repository allows that ? How can I generate automatically Vivado HLS generated RTL and IP from my python lstm

You are asking two seperate questions.  
The LSTM-PYNQ github repo’s readme will help you guide on how to use it in your use case.

You cannot automatically generate HLS IPs, but you will have to see what math or signal component the lstm network requires and then design the functionality in Vivado HLS.

---

<div class="post-metadata">

**Author:** ![samifry](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/samifry/32/2435_2.png) [@samifry](https://discuss.pynq.io/u/samifry)\
**Post date:** [October 6, 2021, 12:00pm UTC](https://discuss.pynq.io/t/lstm-pynq-on-pynq-z1-z2-for-time-series-forcasting/3105/3 "2021-10-06T12:00:53Z")

</div>

I see, the example model use a common library like pytorch or keras ?

---

<div class="post-metadata">

**Author:** ![samifry](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/samifry/32/2435_2.png) [@samifry](https://discuss.pynq.io/u/samifry)\
**Post date:** [October 7, 2021, 7:44am UTC](https://discuss.pynq.io/t/lstm-pynq-on-pynq-z1-z2-for-time-series-forcasting/3105/4 "2021-10-07T07:44:50Z")

</div>

It is possible to use that example easily for time series forecasting with numerical values ? Can I just change the datasets and the precision or there is some more parameters to adapt. For the moment, I just want to generate an HLS/RTL LSTM model for general time series forecasting.  
After that, if I just need to adapt some specifics values, I think this is not a problem.

Thanks!
