This repository contains codes for my quant research on utilizing different deep learning for stock return prediction based on alpha factors. How to apply shapley values to quantify factors' contribution in the deep learning models is also included. Alpha factors data are not included here for confidential reasons.
main.py
: The overall training process. Shapley calculation is also included here.model.py
: Different deep learning models written in Pytorchutils.py
: Auxiliary functions such as dataset processing and performance evaluationconfig.py
: configurations for models and training processBN_LSTM.py
: It is a rather independent file which displays how I build LSTM from scratch so that I can apply the Batch normalization method for LSTM discribed in this paper: Recurrent Batch Normalization. I also include drawing functions that can depict the gradient changes and value changes of all time steps in the training process so that problems like gradient vanishing can be detected.