Comments (4)
@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.
@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.
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.
@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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gru-d.