LSTM Method Error - Time Series

All of the type params are obscuring the important part of the MethodError. Here’s what it says with them removed:

ERROR: LoadError: MethodError: no method matching (::Flux.LSTMCell)(_, ::Float32)

So instead of being passed an array, the LSTM is getting individual numbers.

With this, you can work backwards. First, make sure x in eval_model is an array of arrays as expected by Flux. I’d also rename one of the xs in [model(x) for x in x] to avoid confusion.

If everything looks good in eval_model, then move onto loss. Here you’ll want to make sure x and y are in the correct shape. It may be that train! is dividing your input data up in an undesirable way, so if it is I’d recommend using a custom training loop: Training · Flux.

3 Likes