The code has been tested in the following environment:
| Package | Version |
|---|---|
| Python | 3.8 |
| PyTorch | 2.5.1 |
| CUDA | 12.1 |
| PyTorch Geometric | 2.6.1 |
| TensorFlow | 2.13.1 |
| NumPy | 1.24.3 |
# Create and activate the environment
conda create -n timemar python=3.10 -y
conda activate timemar
# Install dependencies
pip install -r requirements.txtThe trained model checkpoints will be saved in a directory such as log/vq_stock/version_0/checkpoints.
python train_vqvae.pySet the path to the trained VQ-VAE model in the load_dir field of the configuration file configs/train_var_stock.yaml.
python train_ar.pySpecify the path to the trained VQ-VAE model in the var_path: load_dir field of configs/train_sample_stock.yaml. The generated data will be saved in a directory like output/stock/generated_samples/24/.
python sample.pyEvaluate the quality of the generated data.
Pass the path to the generated data as the second argument to the eval() function in eval.py.
# Inside eval.py
eval("stock", "output/stock/generated_samples/24/20xx-xx-xx_xx-xx-xx/manual_generate.npy")
python eval.py