Skip to content

Latest commit

 

History

History
34 lines (32 loc) · 1018 Bytes

File metadata and controls

34 lines (32 loc) · 1018 Bytes

stoch-predict-with-Tranformer-LSTM

stock predict with MLP,CNN,RNN,LSTM,Transformer and Transformer-LSTM
Environment

1.Python 3.8  
2.PyTorch  
3.TorchVision

Install

Create a virtual environment and activate it.

conda create -n stock_predict python=3.8  
conda activate stock_predict  

The code has been tested with PyTorch 1.8 and Cudatoolkit 11.1.

conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia  
pip3 install pandas  
pip3 install matplotlib  
pip3 install tqdm  
pip3 install tensorboardX 
pip3 install opencv-python

Train/evaluate

To train and evaluate our model, you can run

python3 main.py

Plot

To plot the figure of stoch predict,you can run

python3 plot.py  

image