Giter Club home page Giter Club logo

Comments (4)

2M-kotb avatar 2M-kotb commented on July 4, 2024

@zhiyongc Another thing, when computing x_last_obsv we need to make a copy of speed_squences array by using np.copy() because using assignment makes a reference.

(line 71 in main):
X_last_obsv = speed_sequences
should be:
X_last_obsv = np.copy(speed_sequences)

Many thanks to you for this great code, really helpful

from gru-d.

2M-kotb avatar 2M-kotb commented on July 4, 2024

@zhiyongc When you generate Mask, Delta, and Last_observed_X in the code, you shuffle them twice, while you shuffle speed_sequences and speed_label once.
The first time when you create them and the second time when you expand their dimension as shown in the following

if masking:
        X_last_obsv = X_last_obsv[index] #---->   1st time
        Mask = Mask[index] #----> 1st time
        Delta = Delta[index] #-----> 1st time
        speed_sequences = np.expand_dims(speed_sequences, axis=1)
        X_last_obsv = np.expand_dims(X_last_obsv[index], axis=1) #---> 2nd time
        Mask = np.expand_dims(Mask[index], axis=1) #------> 2nd time
        Delta = np.expand_dims(Delta[index], axis=1) #-------> 2nd time
        dataset_agger = np.concatenate((speed_sequences, X_last_obsv, Mask, Delta), axis = 1)

So, I think we need to shuffle them once also

if masking:
        X_last_obsv = X_last_obsv[index]
        Mask = Mask[index]
        Delta = Delta[index]
        speed_sequences = np.expand_dims(speed_sequences, axis=1)
        X_last_obsv = np.expand_dims(X_last_obsv, axis=1)
        Mask = np.expand_dims(Mask, axis=1)
        Delta = np.expand_dims(Delta, axis=1)
        dataset_agger = np.concatenate((speed_sequences, X_last_obsv, Mask, Delta), axis = 1)


from gru-d.

zhiyongc avatar zhiyongc commented on July 4, 2024

Hi @DeepWolf90,
I agree with you in terms of the issues you posted. All the three issues are fixed in the new version of the code. As I tested, the prediction accuracy improved by using the updated code.
Thanks again for your kind help and the comprehensive descriptions of the issues!

from gru-d.

2M-kotb avatar 2M-kotb commented on July 4, 2024

@zhiyongc Sorry if the following question sounds naive, but I'm new to pytorch

In forward function, line 144:
outputs = None

Based on my understanding you don't apply any prediction layer you just used the hidden state to compute the loss.

why don't you use a linear activation fully connected layer as a prediction layer?

from gru-d.

Related Issues (8)

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.