GithubHelp home page GithubHelp logo

attentioned-dual-stage-stock-prediction's Introduction

DA-LSTM

This is an implementation of paper "A Dual-Stage Attention-Based Recurrent Neural Network for Time Series Prediction". I only did a test to predict the price of AAPL.US by its historical data as well as the price of its opponent MSFT.US.

Dataset

Downloaded from NASDAQ 100 STOCK DATA.

Argument

-e, --epoch - the number of epochs

-b, --batch - the batch size

-s, --split - the split ratio of train and test set

-i, --interval - save models every interval epochs

-l, --lrate - learning rate of optimizor

-t, —test - test phase

-m, —model - if in test phase, the models name(if model name is "encoder50" and decoder50", inptut 50)

Sample train

Traing 500 epochs, with batch-size 128, save models every 100 epochs.

Python3 trainer -e 500 -b 128 -i 100

Sample test

Test data use model "encoder50" and "decoder50"

Python3 trainer -t -m 50

attentioned-dual-stage-stock-prediction's People

Contributors

ysn2233 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  avatar  avatar  avatar  avatar

attentioned-dual-stage-stock-prediction's Issues

How can I solve "RuntimeError:"?

When I ran the code in test phase, I got this error

Traceback (most recent call last):
File "trainer.py", line 152, in
trainer.test(mname, batch_size)
File "trainer.py", line 66, in test
y_pred_train = self.predict(x_train, y_train, y_seq_train, batch_size)
File "trainer.py", line 90, in predict
y_res = self.decoder(code, var_y_input)
File "/home/tatsuhiro/PycharmProjects/untitled/venv/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/tatsuhiro/PycharmProjects/untitled/attentioned-dual-stage-stock-prediction-master/model.py", line 101, in forward
ct = torch.bmm(beta_t.unsqueeze(1), h)
RuntimeError: invalid argument 6: wrong matrix size at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:477

I do not change any of programs.
How can I solve this problem?

模型不易扩展

这种写法,只适合外部驱动序列只有一个的情况,如果多个,模型要修改的地方很多,不适合扩展性。

Attention求教

老哥,能不能在代码中对照着论文大概解释一下两个阶段的Attention啊?

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.