Giter VIP home page Giter VIP logo

time-series-prediction-lstm-pytorch's Introduction

time-series-prediction-lstm-pytorch's People

Contributors

spdin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

time-series-prediction-lstm-pytorch's Issues

python3 problems with self.lstm call

The line ula, (h_out, _) = self.lstm(x, (h_0, c_0)) causes an exception to be thrown on my machine, i replaced that line with ula, (h_out, _) = self.lstm(x.view(len(x), self.seq_length, -1), (h_0, c_0)). The dimension of the input x should be 3 dimensions while the first line provides only two, the latter line actually modifies the dimension.

lstm input is wrong

Inside LSTM class:

change this:

ula, (h_out, _) = self.lstm(x, (h_0, c_0))
h_out = h_out.view(-1, self.hidden_size)

to this:

h_out, _ = self.lstm(x, (h_0, c_0))
h_out = h_out.view(-1,x.size(1),self.hidden_size)[-1] 

also, when you train/predict the model, use dataX.transpose(0,1) as input

Check https://pytorch.org/docs/stable/nn.html?highlight=lstm#torch.nn.LSTM for reference on input/output formatting for LSTM layer

Now you can use multiple layers.

forward always make hidden state zeros

I think there is something missing. İf I understand correctly implementation of forward is wrong.
At code of forward of LSTM model, we see h_0=torch.zeros(...) and c_0 = torch.zeros(...) which means you set state everytime same, not get any information of sequence state. İs there anything ı am missing?

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.