# Simple Flux LSTM for Time Series

**URL:** https://discourse.julialang.org/t/simple-flux-lstm-for-time-series/35494
**Category:** Machine Learning
**Tags:** question, flux, time-series, machine-learning
**Created:** [March 4, 2020, 1:10am UTC](https://discourse.julialang.org/t/simple-flux-lstm-for-time-series/35494 "2020-03-04T01:10:12Z")
**Posts on this page:** 1
**Showing post:** 57

<div class="post-metadata">

### Author: ![JLDC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jldc/32/17627_2.png) [@JLDC](https://discourse.julialang.org/u/JLDC)
#### Post date: [April 10, 2022, 7:57pm UTC](https://discourse.julialang.org/t/simple-flux-lstm-for-time-series/35494/57 "2022-04-10T19:57:37Z")

</div>

I wanted to restart writing blog posts and figured this might be a good start and I wrote up a few sentences this afternoon. Perhaps this can be of use to you: [A Simple Recurrent Model in Flux | Jonathan Chassot](https://www.jldc.ch/posts/recurrent-models-in-flux/)

If self-promotion is not tolerated I’ll make sure to remove it, but I think it explains how to work out the case with both `X` and `y`. In general, you just want to reshape your `X` and not necessarily your `y`.

To summarize, I just keep both my `X` and `y` separated and I don’t use the `Flux.train!()` function but rather compute the gradients and use `Flux.update!()`. This is [something that was suggested to me by someone more knowledgeable about RNNs](https://discourse.julialang.org/t/sequence-to-one-modelling-and-flux-reset/70815).

---

_[View the full topic](https://discourse.julialang.org/t/simple-flux-lstm-for-time-series/35494)._
