Errors with Flux RNN set

The comment character should be a # not a %.

You didn’t define n_hidden, I added n_hidden=10 to test.

Your loss function expects to be passed the entire dataset at once, you can call loss(x, y) and get a value. Flux.train iterates over the value provided for data and calls either loss(d) (or loss(d...) if d is a tuple) with each element. With the data shapes in your example, that results in passing scalars to your model since you have now zipped twice (once creating data and once inside loss). I suspect what you meant to do is:

function loss(x, y)
     Flux.reset!(m)
     Flux.mse(m(x), y)
end

Which works as expected in the train! loop.

You can test this with

loss(first(zip(x, y))...)