Git Product home page Git Product logo

Comments (8)

deanmckee007 avatar deanmckee007 commented on June 27, 2024 1

@dfalbel @Ax3man ,

Worked perfectly - time to tune.

Thanks again.

from keras.

dfalbel avatar dfalbel commented on June 27, 2024

I'm not sure this is very different form the examples.
I would input this as a 3D array:

  • dimension 1 is n: the number of observations you have (probably you wont have to specify this for now)
  • dimension 2 is 2: the time step (t0 and t1)
  • dimension 3 is 110: the features you have

You will input a matrix for each individual/observation in your dataset.
Does it make sense for you?

from keras.

Ax3man avatar Ax3man commented on June 27, 2024

Hi Dean,

There is a lot of python examples out there, and most of them can be quite understandable and translatable to R, even if you don't much about Python per se (like me).

I think you supply X as a 3D array of dimensions [samples, timesteps, features]. So you would have [samples, 2, 110]. Y is then a matrix without time dimension (you are predicting a single value), and so has dimension [samples, features]. For a binary outcome you could have a model that looks like:

keras_model_sequential() %>%
  layer_lstm(units = 16, input_shape = c(2, 110))  %>%
  layer_dense(units = 1) %>%
  layer_activation('sigmoid') %>%
  compile(loss = 'binary_crossentropy', 
          optimizer = 'adam', 
          metrics = 'accuracy')

from keras.

deanmckee007 avatar deanmckee007 commented on June 27, 2024

@dfalbel @Ax3man

Trying to make a run at your suggestions today. Thanks for the feedback - very helpful.

from keras.

jigyasu10 avatar jigyasu10 commented on June 27, 2024

Hey, I am also trying to work around a similar thing but I am getting an error :
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: No data provided for "gru_21_input". Need data for each key in: ['gru_21_input']

Will it be possible for you to share a detailed snippet around how do you define a shape of the data before one runs the model fit on the training dataset?

Thanks

from keras.

skeydan avatar skeydan commented on June 27, 2024

Hello,
I'd suggest you provide a minimal executable example so we can see what goes wrong in your case?

from keras.

mioan-gr avatar mioan-gr commented on June 27, 2024
dimension 1 is n: the number of observations you have (probably you wont have to specify this for now)
dimension 2 is 2: the time step (t0 and t1)
dimension 3 is 110: the features you have

For dimension 2, I did not find any information mentioning if the sequence should be in chronological or reverse chronological order. For example if we have 5 time steps, in cell [1,1,1] we should have today's sample and in cell [1,5,1] the oldest sample of our timeframe window? Or it should be in the opposite order?

from keras.

t-kalinowski avatar t-kalinowski commented on June 27, 2024

@mioan-gr Please open a new issue if you're encountering problems, and include a link to this issue if appropriate. This issue was closed 7 years ago!

from keras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.