This repo contains the Python code implementation for my undergraduate thesis paper. The paper empirically validated Chen et al. (2021)'s GAN model in the UK LSE 1998-2017 data.
Chen et al. (2021)'s GAN model implemented based on TensorFlow v1 can be found in their GitHub repo In this repo we implemented the model using TensorFlow v2.
Chen, L., Pelger, M., & Zhu, J. (2021). Deep learning in asset pricing. Research Methods & Methodology in Accounting eJournal.
We used Python 3.9.0 during development.
Please install all the required libraries with
$ pip3 install -r requirements.txt
To reproduce the results, please follow the following procedure:
- Load all required data in any folder
- Change the data path in
ap/common.py
- Perform ETL with scripts in
etl
in the following order:yprice.sync.py
fundamental.sync.py
factors.sync.py
etl.sync.py
- Perform training with
training/gan_UK.sync.py
Models folder contains all the model implementation.
To change the training settings, there are two files to change:
- config.json
- common.py
config.json
contains the training config while common.py
contains the common variables shared across different
scripts.
We separate the project into the following structure, in the order to replicate the results
- ETL
- Training
- AP
ETL
contains the scripts used to transform the raw data.
All transformed data will be saved in a folder named
data
.
Training
contains the scripts used to conduct different
trainings presented in the paper. The most relevant script
is gan_UK.sync.py
which trains the GAN model based on UK
data.
AP
contains the GAN implementation.