Code and real data for the paper "Counterfactual Temporal Point Processes", available at arXiv.

Overview

counterfactual-tpp

This is a repository containing code and real data for the paper Counterfactual Temporal Point Processes.

Pre-requisites

This code depends on the following packages:

  1. networkx
  2. numpy
  3. pandas
  4. matplotlib

to generate map plots:

  1. GeoPandas
  2. geoplot

Code structure

  • src/counterfactual_tpp.py: Contains the code to sample rejected events using the superposition property and the algorithm to calculate the counterfactuals.
  • src/gumbel.py: Contains the utility functions for the Gumbel-Max SCM.
  • src/sampling_utils.py: Contains the code for the Lewis' thinning algorithm (thinning_T function) and some other sampling utilities.
  • src/hawkes/hawkes.py: Contains the code for sampling from the hawkes process using the superposition property of tpps. It also includes the algorithm for sampling a counterfactual sequence of events given a sequence of observed events for a Hawkes process.
  • src/hawkes/hawkes_example.ipynb: Contains an example of running algorithm 3 (in the paper) for both cases where we have (1) both observed and un-observed events, and (2) the case that we have only the observed events.
  • ebola/graph_generation.py: Contains code to build the Ebola network based on the network of connected districts. This code is adopted from the disease-control project.
  • ebola/dynamics.py: Contains code for sampling counterfactual sequence of infections given a sequence of observed infections from the SIR porcess (the calculate_counterfactual function). The rest of the code is adopted from the disease-control project, which simulates continuous-time SIR epidemics with exponentially distributed inter-event times.

The directory ebola/data/ebola contains the information about the Ebola network adjanceny matrix and the cleaned ebola outbreak data adopted from the disease-control project.

The directory ebola/map/geojson contains the geographical information of the districts studied in the Ebola outbreak dataset. The geojson files are obtained from Nominatim.

The directory ebola/map/overall_data contains data for generating the geographical maps in the paper, and includs the overall number of infection under applying different interventions.

The directories src/data_hawkes and src/data_inhomogeneous contain observational data used to generate Synthetic plots in the paper. You can use this data to re-generate paper's plots. Otherwise, you can simply generate new random samples by the code.

Experiments

Synthetic

Epidemiological

Citation

If you use parts of the code in this repository for your own research, please consider citing:

@article{noorbakhsh2021counterfactual,
        title={Counterfactual Temporal Point Processes},
        author={Noorbakhsh, Kimia and Gomez-Rodriguez, Manuel},
        journal={arXiv preprint arXiv:2111.07603},
        year={2021}
}
Owner
Networks Learning
Networks Learning group at MPI-SWS
Networks Learning
Video2x - A lossless video/GIF/image upscaler achieved with waifu2x, Anime4K, SRMD and RealSR.

Official Discussion Group (Telegram): https://t.me/video2x A Discord server is also available. Please note that most developers are only on Telegram.

K4YT3X 5.9k Dec 31, 2022
Learning to Self-Train for Semi-Supervised Few-Shot

Learning to Self-Train for Semi-Supervised Few-Shot Classification This repository contains the TensorFlow implementation for NeurIPS 2019 Paper "Lear

86 Dec 29, 2022
The comma.ai Calibration Challenge!

Welcome to the comma.ai Calibration Challenge! Your goal is to predict the direction of travel (in camera frame) from provided dashcam video. This rep

comma.ai 697 Jan 05, 2023
ROS support for Velodyne 3D LIDARs

Overview Velodyne1 is a collection of ROS2 packages supporting Velodyne high definition 3D LIDARs3. Warning: The master branch normally contains code

ROS device drivers 543 Dec 30, 2022
Official Code for "Constrained Mean Shift Using Distant Yet Related Neighbors for Representation Learning"

CMSF Official Code for "Constrained Mean Shift Using Distant Yet Related Neighbors for Representation Learning" Requirements Python = 3.7.6 PyTorch

4 Nov 25, 2022
Referring Video Object Segmentation

Awesome-Referring-Video-Object-Segmentation Welcome to starts โญ & comments ๐Ÿ’น & sharing ๐Ÿ˜€ !! - 2021.12.12: Recent papers (from 2021) - welcome to ad

Explorer 57 Dec 11, 2022
Putting NeRF on a Diet: Semantically Consistent Few-Shot View Synthesis

Putting NeRF on a Diet: Semantically Consistent Few-Shot View Synthesis Website | ICCV paper | arXiv | Twitter This repository contains the official i

Ajay Jain 73 Dec 27, 2022
Authors implementation of LieTransformer: Equivariant Self-Attention for Lie Groups

LieTransformer This repository contains the implementation of the LieTransformer used for experiments in the paper LieTransformer: Equivariant self-at

35 Oct 18, 2022
Pytorch implementation for the Temporal and Object Quantification Networks (TOQ-Nets).

TOQ-Nets-PyTorch-Release Pytorch implementation for the Temporal and Object Quantification Networks (TOQ-Nets). Temporal and Object Quantification Net

Zhezheng Luo 9 Jun 30, 2022
Multi-objective constrained optimization for energy applications via tree ensembles

Multi-objective constrained optimization for energy applications via tree ensembles

Cโš™G - Imperial College London 1 Nov 19, 2021
22 Oct 14, 2022
Experiments for Operating Systems Lab (ETCS-352)

Operating Systems Lab (ETCS-352) Experiments for Operating Systems Lab (ETCS-352) performed by me in 2021 at uni. All codes are written by me except t

Deekshant Wadhwa 0 Sep 06, 2022
Code for the Shortformer model, from the paper by Ofir Press, Noah A. Smith and Mike Lewis.

Shortformer This repository contains the code and the final checkpoint of the Shortformer model. This file explains how to run our experiments on the

Ofir Press 138 Apr 15, 2022
A python library for self-supervised learning on images.

Lightly is a computer vision framework for self-supervised learning. We, at Lightly, are passionate engineers who want to make deep learning more effi

Lightly 2k Jan 08, 2023
Gradient Inversion with Generative Image Prior

Gradient Inversion with Generative Image Prior This repository is an implementation of "Gradient Inversion with Generative Image Prior", accepted to N

MLLab @ Postech 25 Jan 09, 2023
Official code base for the poster "On the use of Cortical Magnification and Saccades as Biological Proxies for Data Augmentation" published in NeurIPS 2021 Workshop (SVRHM)

Self-Supervised Learning (SimCLR) with Biological Plausible Image Augmentations Official code base for the poster "On the use of Cortical Magnificatio

Binxu 8 Aug 17, 2022
Semantic Image Synthesis with SPADE

Semantic Image Synthesis with SPADE New implementation available at imaginaire repository We have a reimplementation of the SPADE method that is more

NVIDIA Research Projects 7.3k Jan 07, 2023
Hybrid Neural Fusion for Full-frame Video Stabilization

FuSta: Hybrid Neural Fusion for Full-frame Video Stabilization Project Page | Video | Paper | Google Colab Setup Setup environment for [Yu and Ramamoo

Yu-Lun Liu 430 Jan 04, 2023
PyTorch code for EMNLP 2021 paper: Don't be Contradicted with Anything! CI-ToD: Towards Benchmarking Consistency for Task-oriented Dialogue System

Donโ€™t be Contradicted with Anything!CI-ToD: Towards Benchmarking Consistency for Task-oriented Dialogue System This repository contains the PyTorch im

Libo Qin 25 Sep 06, 2022
[ACL 20] Probing Linguistic Features of Sentence-level Representations in Neural Relation Extraction

REval Table of Contents Introduction Overview Requirements Installation Probing Usage Citation License ๐ŸŽ“ Introduction REval is a simple framework for

13 Jan 06, 2023