GithubHelp home page GithubHelp logo

for0nething / face-a-normalizing-flow-based-cardinality-estimator Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 5.0 7 MB

A pytorch implementation for FACE: A Normalizing Flow based Cardinality Estimator

License: MIT License

Jupyter Notebook 19.87% Makefile 0.19% Batchfile 0.23% Python 76.85% TeX 2.86%
cardinality-estimation deep-generative-model density-estimation learned-database learned-database-components normalizing-flow query-optimization unsupervised-learning

face-a-normalizing-flow-based-cardinality-estimator's Introduction

FACE

This is a pytorch implementation for the VLDB 2022 paper FACE: A Normalizing Flow based Cardinality Estimator [Citation]. Our codes are built based on nflows and torchquad.


Folder Structure

.
├── torchquadMy     # A modified pytorch implementation of adaptive importance sampling.
├── utils           # A wrapper for datasets, used to generate queries, define error metrics, etc.
├── data            # A directory for storing data. Downloaded data can be stored here.
├── train           # Codes for training normalizing flow models.
├── evaluate        # Evaluate trained models on real-world datasets for cardinality estimation.
├── environment.yml # Configuration file used to build conda environment.
└── README.md               

Quick Start

The real-world datasets can be downloaded from dataset link. We use power and BJAQ as concrete examples to illustrate how to use FACE for cardinality estimation.

  • Step 1: Build conda environment with conda env create -f environment.yml.
  • Step 2: Switch to the installed environment by conda activate testenv.
  • Step 3: Install modified torchquad by cd ./torchquadMy, and then pip install . .
  • Step 4: Download the datasets from dataset link, and then place the data into data directory.
  • Step 5: After properly setting the paths of datasets, models, etc, you can use the notebook files under train and evaluate directories to conduct experiments.

Notes:

  • Before running the codes, make sure the path variable PROJECT_PATH is set properly. This variable should be set as the path of the project root directory.
  • Current codes may be incompatible with machines that do not have GPUs.
  • For GPUs with memory less than 2080Ti (11GB), some parameters need to be set smaller, which will bring some performance loss.

License

The project is available under the MIT license.

Citation

If our work is helpful to you, please cite our paper:

@article{DBLP:journals/pvldb/WangCLL21,
  author    = {Jiayi Wang and
               Chengliang Chai and
               Jiabin Liu and
               Guoliang Li},
  title     = {{FACE:} {A} Normalizing Flow based Cardinality Estimator},
  journal   = {Proc. {VLDB} Endow.},
  volume    = {15},
  number    = {1},
  pages     = {72--84},
  year      = {2021},
  url       = {http://www.vldb.org/pvldb/vol15/p72-li.pdf},
  doi       = {10.14778/3485450.3485458},
  timestamp = {Thu, 21 Apr 2022 17:09:21 +0200},
  biburl    = {https://dblp.org/rec/journals/pvldb/WangCLL21.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

face-a-normalizing-flow-based-cardinality-estimator's People

Contributors

for0nething avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.