-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSTM-FNN example does not work anymore #1391
Comments
Thanks for reporting. I am able to reproduce the error, and am able to run the example after two edits: # optimizer <- optimizer_adam(learning_rate = 1e-3)
optimizer <- tf$keras$optimizers$legacy$Adam(learning_rate = 1e-3) and # top_indices <- top_k[[1]]
top_indices <- top_k$indices (this is on TF version 2.15, Ubuntu 22.04) > tf_config()
TensorFlow v2.15.0 (~/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/tensorflow)
Python v3.9 (~/.virtualenvs/r-tensorflow/bin/python) |
Thanks @t-kalinowski for your quick response.
for multiple features or do you have any recommendation to use any other function for that? I have tried with the following:
But it produces NA that I can't remove. The problem is also due to the fact that in R, subsetting a vector produces NA if the dimensions are exceeded, that is not the case of array where you get the message that index is out of bounds. As a consequence, the following does not give me any error but it produces NA during training:
|
I think you can redefine gen_timesteps <- function(x, n_timesteps) {
ds <- timeseries_dataset_from_array(
x, NULL,
sequence_length = n_timesteps,
batch_size = NROW(x)
)
ds |>
as_array_iterator() |>
iter_next()
}
x <- 1:40
gen_timesteps(x, 10)
out <- gen_timesteps(cbind(x * .1, x, x * 10), 10)
out[1, , ] # first datapoint |
Ok thanks @t-kalinowski , it seems to work.
gives me the following warning at the end of training:
what is it all about? |
Somewhere you're calling You can trace which call it is by setting See |
Hello,
I took my code from Posit AI Blog:
https://blogs.rstudio.com/ai/posts/2020-07-20-fnn-lstm/
the code is the following:
In my installation is failing with the following error:
is this related to a problem in my installation or this model is not working anymore?
The text was updated successfully, but these errors were encountered: