# \#lstm

**URL:** https://discourse.julialang.org/tag/lstm/469.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Improve performance in Flux.jl](https://discourse.julialang.org/t/improve-performance-in-flux-jl/127939)

<div class="topic-metadata">

**Author:** [@Wuaphi](https://discourse.julialang.org/u/Wuaphi)\
**Replies:** 0\
**Last updated:** [April 10, 2025, 4:42pm UTC](https://discourse.julialang.org/t/improve-performance-in-flux-jl/127939 "2025-04-10T16:42:33Z")

</div>

I tried to train a LSTM model in Flux.jl, but whatever I do, the gpu usage only reaches about 50%. But I can’t make the batchsize bigger, as the vram is nearly full. I would appreciate any kind of help. module Lstm …

---

## [A conformal LSTM classifier to detect anomalies](https://discourse.julialang.org/t/a-conformal-lstm-classifier-to-detect-anomalies/127580)

<div class="topic-metadata">

**Author:** [@Unnathi\_R\_Shaiva](https://discourse.julialang.org/u/Unnathi_R_Shaiva)\
**Replies:** 1\
**Last updated:** [April 2, 2025, 11:45am UTC](https://discourse.julialang.org/t/a-conformal-lstm-classifier-to-detect-anomalies/127580 "2025-04-02T11:45:26Z")

</div>

a conformal LSTM classifier to detect anomalies: and here is the code can somebody help me with the code correction I am new to julia: Install required packages using Pkg Pkg.add(\[“Flux”, “ConformalPrediction”, “DataFr…

---

## [Timeseries model training using Lux.jl](https://discourse.julialang.org/t/timeseries-model-training-using-lux-jl/121618)

<div class="topic-metadata">

**Author:** [@Rosejoycrocker](https://discourse.julialang.org/u/Rosejoycrocker)\
**Replies:** 0\
**Last updated:** [October 22, 2024, 10:36pm UTC](https://discourse.julialang.org/t/timeseries-model-training-using-lux-jl/121618 "2024-10-22T22:36:06Z")

</div>

Hi, I’m using the Lux.jl simple LSTM classifier example ( Training a Simple LSTM | Lux.jl Docs ) to try and train a simple LSTM to predict timeseries data. I’m having issues however, as the LSTM model example is design…

---

## [Training Flux LSTM on GPU is slower than on CPU](https://discourse.julialang.org/t/training-flux-lstm-on-gpu-is-slower-than-on-cpu/114250)

<div class="topic-metadata">

**Author:** [@dtramtn](https://discourse.julialang.org/u/dtramtn)\
**Replies:** 1\
**Last updated:** [May 16, 2024, 11:51am UTC](https://discourse.julialang.org/t/training-flux-lstm-on-gpu-is-slower-than-on-cpu/114250 "2024-05-16T11:51:26Z")

</div>

Hi, I’m trying to train an LSTM with timeseries data using Flux and attempting to speed it up by training on the GPU, but it takes longer than on the CPU. The data is an n\_features x n\_observation matrix as generated i…

---

## [Lux.jl LSTM timeseries prediction: AD / optimization does not start](https://discourse.julialang.org/t/lux-jl-lstm-timeseries-prediction-ad-optimization-does-not-start/107553)

<div class="topic-metadata">

**Author:** [@OliverWallscheid](https://discourse.julialang.org/u/OliverWallscheid)\
**Replies:** 2\
**Last updated:** [February 14, 2024, 10:50pm UTC](https://discourse.julialang.org/t/lux-jl-lstm-timeseries-prediction-ad-optimization-does-not-start/107553 "2024-02-14T22:50:50Z")

</div>

Hey there, I am trying to compile a training session of a simple time series prediction example using a LSTM cell within a Lux chain. My model is model = Lux.Chain(Lux.Dense(2 =\> 2), Lux.Recurrence(Lux.LSTMCell(2 =\> 2…

---

## [IO error message while training an LSTM model but no operation on a file is being performed](https://discourse.julialang.org/t/io-error-message-while-training-an-lstm-model-but-no-operation-on-a-file-is-being-performed/110040)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 2\
**Last updated:** [February 13, 2024, 7:09pm UTC](https://discourse.julialang.org/t/io-error-message-while-training-an-lstm-model-but-no-operation-on-a-file-is-being-performed/110040 "2024-02-13T19:09:58Z")

</div>

I am currently getting an IO error message (see below), and I don’t understand why. This error has popped up haphazardly as I run a function I wrote to train an LSTM model with Flux.jl. The function reshapes the data in…

---

## [Understanding \`Flux.Data.DataLoader\` when training an LSTM model](https://discourse.julialang.org/t/understanding-flux-data-dataloader-when-training-an-lstm-model/109581)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 1\
**Last updated:** [February 2, 2024, 3:34am UTC](https://discourse.julialang.org/t/understanding-flux-data-dataloader-when-training-an-lstm-model/109581 "2024-02-02T03:34:36Z")

</div>

Hello, folks For a while I have been playing with Flux.jl to learn how to put together ML models, train them, and use them for predictive tasks. At the moment, I am stuck with the training stage of an LSTM model. Probl…

---

## [Are there guidelines or rules of thumb on how to stack hidden layers in a RNN?](https://discourse.julialang.org/t/are-there-guidelines-or-rules-of-thumb-on-how-to-stack-hidden-layers-in-a-rnn/107307)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 5\
**Last updated:** [December 14, 2023, 10:25pm UTC](https://discourse.julialang.org/t/are-there-guidelines-or-rules-of-thumb-on-how-to-stack-hidden-layers-in-a-rnn/107307 "2023-12-14T22:25:03Z")

</div>

I’m currently working on the prediction of chaotic data and I have decided to see how well would an RNN, namely an LSTM, would do. I am fairly new to the topic of Neural Networks, but I have found a spate of helpful reso…

---

## [LSTM training for a sequence of multiple features using a batch size 30](https://discourse.julialang.org/t/lstm-training-for-a-sequence-of-multiple-features-using-a-batch-size-30/63238)

<div class="topic-metadata">

**Author:** [@reemmasoud123](https://discourse.julialang.org/u/reemmasoud123)\
**Replies:** 10\
**Last updated:** [November 22, 2023, 11:18am UTC](https://discourse.julialang.org/t/lstm-training-for-a-sequence-of-multiple-features-using-a-batch-size-30/63238 "2023-11-22T11:18:34Z")

</div>

I am trying to do batch training using LSTM for a time series data with multiple features. Assuming I have 5000 samples and 5 features for each sample. The input uses 14 days into the past and the output is a single val…

---

## [Forecasting with LSTM + MLJ How to ? (A detailed guide or tutorial is needed)](https://discourse.julialang.org/t/forecasting-with-lstm-mlj-how-to-a-detailed-guide-or-tutorial-is-needed/94835)

<div class="topic-metadata">

**Author:** [@huqedato](https://discourse.julialang.org/u/huqedato)\
**Replies:** 1\
**Last updated:** [February 25, 2023, 2:35pm UTC](https://discourse.julialang.org/t/forecasting-with-lstm-mlj-how-to-a-detailed-guide-or-tutorial-is-needed/94835 "2023-02-25T14:35:08Z")

</div>

For a future task/project (starting this late spring) we will be required to create and deploy a network for predictive analysis on a large time-series dataset with multiple complex features. The tools of work (set by m…

---

## [LSTM with convolution instead of matrix multiplication (ConvLSTM)](https://discourse.julialang.org/t/lstm-with-convolution-instead-of-matrix-multiplication-convlstm/86315)

<div class="topic-metadata">

**Author:** [@Dieter](https://discourse.julialang.org/u/Dieter)\
**Replies:** 1\
**Last updated:** [August 25, 2022, 11:24pm UTC](https://discourse.julialang.org/t/lstm-with-convolution-instead-of-matrix-multiplication-convlstm/86315 "2022-08-25T23:24:45Z")

</div>

Hello Community I have already used Julia for many tasks but not for machine learning purposes. Now, I would need a LSTM network, which uses internal convolutional operations (not convolved matrices as input). Such a n…

---

## [LoadError: MethodError while training LSTM model in Julia](https://discourse.julialang.org/t/loaderror-methoderror-while-training-lstm-model-in-julia/73774)

<div class="topic-metadata">

**Author:** [@sherlock\_holmes](https://discourse.julialang.org/u/sherlock_holmes)\
**Replies:** 0\
**Last updated:** [December 29, 2021, 6:11pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-while-training-lstm-model-in-julia/73774 "2021-12-29T18:11:07Z")

</div>

I’m trying to train an LSTM model to predict number of real roots of polynomials. x\_train and y\_train include array of arrays such as \[\[-204, 20, 13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…

---

## [Issue with LSTM with Flux](https://discourse.julialang.org/t/issue-with-lstm-with-flux/73563)

<div class="topic-metadata">

**Author:** [@Vishal\_Sharma1](https://discourse.julialang.org/u/Vishal_Sharma1)\
**Replies:** 0\
**Last updated:** [December 23, 2021, 11:54pm UTC](https://discourse.julialang.org/t/issue-with-lstm-with-flux/73563 "2021-12-23T23:54:41Z")

</div>

I am new to Flux and trying to get LSTM model for a time series prediction working but currently stuck at an error which I dont seem to understand. train\_data, train\_labels, test\_data, test\_labels = getData(df) model …

---

## [Am I using LSTMs wrong?](https://discourse.julialang.org/t/am-i-using-lstms-wrong/70339)

<div class="topic-metadata">

**Author:** [@Michaela\_Maskova](https://discourse.julialang.org/u/Michaela_Maskova)\
**Replies:** 2\
**Last updated:** [October 25, 2021, 4:45pm UTC](https://discourse.julialang.org/t/am-i-using-lstms-wrong/70339 "2021-10-25T16:45:58Z")

</div>

Hi, everyone. I have a question about the usage of LSTM and other RNN cells with Flux for prediction of data sequences. I’m playing around with Kaggle competition data (Google Brain - Ventilator Pressure Prediction | Ka…

---

## [RNN (LSTM) Training issues with loss function](https://discourse.julialang.org/t/rnn-lstm-training-issues-with-loss-function/53483)

<div class="topic-metadata">

**Author:** [@jparcinski](https://discourse.julialang.org/u/jparcinski)\
**Replies:** 0\
**Last updated:** [January 17, 2021, 12:11pm UTC](https://discourse.julialang.org/t/rnn-lstm-training-issues-with-loss-function/53483 "2021-01-17T12:11:36Z")

</div>

Hi, I have problem with understanding 1 issue, maybe someone will help me. I’m trying to build LSTM or simple RNN for predicting price values. To start understand how to do it in Julia I used the example from here: A Ba…

---

## [How to implement LSTM base meta relearning by Flux?](https://discourse.julialang.org/t/how-to-implement-lstm-base-meta-relearning-by-flux/47164)

<div class="topic-metadata">

**Author:** [@nuclear718](https://discourse.julialang.org/u/nuclear718)\
**Replies:** 0\
**Last updated:** [September 23, 2020, 11:38pm UTC](https://discourse.julialang.org/t/how-to-implement-lstm-base-meta-relearning-by-flux/47164 "2020-09-23T23:38:32Z")

</div>

In LSTM meta learning approach, we have a base leaner and update base learner’s parameters by another learner (single cell LSTM). The base learner’s parameters is LSTM’s cell state and will input LSTM one by one, the ou…

---

## [Using LSTM with Conv layers](https://discourse.julialang.org/t/using-lstm-with-conv-layers/46007)

<div class="topic-metadata">

**Author:** [@nantonel](https://discourse.julialang.org/u/nantonel)\
**Replies:** 0\
**Last updated:** [September 3, 2020, 1:32pm UTC](https://discourse.julialang.org/t/using-lstm-with-conv-layers/46007 "2020-09-03T13:32:16Z")

</div>

I was wondering what is the best practice to use a LSTM (or any RNN) together with some convolutional layers using Flux and in general how to unite recurrent networks with other blocks. Say I have this simple problem wh…
