Skip to content

Latest commit

 

History

History
79 lines (50 loc) · 1.87 KB

README.md

File metadata and controls

79 lines (50 loc) · 1.87 KB

CSP_Graph

This is the python code of "Graph Based Database Generation from Query Constraints". [Paper] [Code]

The goal is to leverage graph method (GCN) to learn the Cumulative Density Function (CDF) of synthetic database generation problem. The query workloads are considered as Constraint Satisfaction Problems (CSPs).

Datasets

  • census
  • wine

Basic Usage

Our model - GCN

python train.py --dataset wine-3 --query-size 10000 --channels 2,16,1 --num_layers 3 --epochs 3000 --bs 1000 --lr 1e-2 --opt adam --loss MSE

Baseline - PGM

python PGM.py --dataset wine-3 --query-size 10

Baseline - SMT

python SMT_z3.py --dataset wine-3 --query-size 10

File Structure

  • dataset.py : Process the datasets.
  • utils.py / plot_util.py / ce_util.py : Utilitiy functions.
  • preprocessing.py : Build the graph
  • models.py : Build the GCN model.
  • run_experiments.py: Script for PGM / SMT baseline to collect results.
  • demo.py : simple 2D demo for proposal.

Require environment

  • Python
  • PyTorch
  • torch_geometric
  • Networkx