Giter Site home page Giter Site logo

aai-institute / veriflow Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 2.55 MB

Normalizing flows for neuro-symbolic AI

License: BSD 3-Clause "New" or "Revised" License

Python 99.35% Shell 0.65%
formal-verification neuro-symbolic-ai transferlab flows normalizing-flows research-project

veriflow's Introduction

Veriflow: Generative Flow Based Density Estimators for Neuro-Symbolic Verification

VeriFlow provides a stable and convenient library of flow based general purpose density models with flexibile base distributions, which are specifically tailored towards the use in neuro-symbolic verification procedures. The major goal is to provide models that can represent reference distributions which are suitable for satisfiability based approaches, abstract interpretation, and hypothesis testing simultaneously. The implemented layer are carefully designed to guarntee the following properties:

  • Efficient computation of exact densities as well as efficient sampling.
  • A piece-wise affine log-density function for all models with (leaky-)ReLU nonlinearity and Laplacian base distribution.
  • UDL preserving layers map the upper density level sets of the data distribution to the upper density level sets of the base Distribution.
  • Direct onnx export of log_prob and sampling methods.

Installation

  1. Clone Project:
git clone [email protected]:aai-institute/VeriFlow.git
  1. Install poetry
curl -sSL https://install.python-poetry.org | python3 -
  1. Finally, within the veriflow project directory:
poetry install

Experiments

Veriflow comes with a lightweigt experimentation library that allow effortless configuaration, e.g. of hyperparameter optimzation experiments via yaml config files. Additionally, we define several benchmarking experiments.

Run an experiment

Within the projects script folder you'll find a a script called run_experiment.py. You can use it to conduct an experiment from the a config file.

poetry run python run_experiment.py --config <config file> --report_dir <log dir>

veriflow's People

Contributors

fariedabuzaid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

opcode81

veriflow's Issues

ONNX export

Implement convenience function for onnx support

Improve Testing

VeriFlow

  • linalg
  • networks
  • transforms
  • flows
    • Onnx export

ExpLib

  • config_parser
  • base
  • hyperopt
  • datasets

HyperoptExperiment with NiceFlow on mps

Problem

HyperoptExperiment fails with NiceFlow on mps devices.

Analysis

  • Verified for permutation == "half"
  • Error: Permutations seem to be not on device?!?
  • works with NiceMaskedConvFlow

Onnx export with LU transform not supported

Description

Calling to_onnx on a flow with LU layers raises a NotImplementedError. Reason is that the function linalg_inv is not implemented in onnx

Suggestion

A possible workaround could be to export a surrogate model with precomputed inverse matrix instead.

Refactor documentation

Problem

  • Some of the code documentation is outdated/incomplete/inconsistent format

Todos

VeriFlow

  • linalg
  • networks
  • transforms
  • flows

ExpLib

  • config_parser
  • base
  • hyperopt
  • datasets

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.