Skip to content

PyTorch-Lightning implementation of Meta Temporal Point Processes

Notifications You must be signed in to change notification settings

BorealisAI/meta-tpp

Repository files navigation

Meta Temporal Point Processes

[Paper][Poster][OpenReview]

Datasets

We provide the compressed datasets: Stack Overflow, Mooc, Reddit, Wiki, Sin, Uber, NYC Taxi, in this link. Unzip the compressed file and locate it in the $ROOT directory.

Setup

Setup the pipeline by installing dependencies using the following command. pretrained models and utils.

pip install -r requirements.txt

For nfe pacakge, install the package in neural flows repo using

pip install -e .

Pre-trained models

We also provide the checkpoints for Intensity free, THP+ and Attentive TPP on all the datasets. Please download the compress file in this link, unzip it and locate it in the $ROOT directory.

Train

A model can be trained using the following command.

python src/train.py data/datasets=$DATASET model=$MODEL

$DATASET can be chosen from {so_fold1, mooc, reddit, wiki, sin, uber_drop, taxi_times_jan_feb} and $MODEL can be chosen from {intensity_free,thp_mix,attn_lnp}. Other configurations can be also easily modified using hydra syntax. Please refer to hydra for further details.

Eval

A model can be evaluated on test datasets using the following command.

python src/eval.py data/datasets=$DATASET model=$MODEL

Here, the default checkpoint paths are set to the ones in checkpoints directory we provided above. To use different checkpoints, please chagne ckpt_path argument in configs/eval.yaml.

Modifications

We made some modifications during code refactorization after ICLR 2023. For the NLL metric, we took out L2 norm of model params, which we had to include for implementation purpose using the internal pipeline. Note that since our proposed model contains stricly more number of parameters, this change is on favor of our method. For the RMSE metric, we divide MSE by the number events for which we previously included the first events but not anymore. We made this change because we do not make predictions on the first events. Note that it is applied the same way for every model. These changes do not change the rank of models nor the narrative of the paper.

Citation

If you use this code or model for your research, please cite:

@inproceedings{bae2023meta,
  title = {Meta Temporal Point Processes},
  author = {Bae, Wonho and Ahmed, Mohamed Osama and Tung, Frederick and Oliveira, Gabriel L},
  booktitle={The International Conference on Learning Representations (ICLR)},
  year={2023}
}

Acknowledgment

The pipeline is built on PyTorch-Lightning Hydra Template. Intensity free is based on the original implementation and THP+ is based on (the corrected version of THP](https://github.com/yangalan123/anhp-andtt).