Skip to content

Joaggi/demande

Repository files navigation

DEMANDE: Density Matrix Neural Density Estimation

DEMANDE (Density Matrix NEural Density Estimation) is a neural density estimation method based on density matrices and adaptive Fourier features. It provides a flexible machine-learning approach to estimate probability density functions from data, grounded in the mathematical formalism of density matrices commonly used in quantum mechanics. (Semantic Scholar)


📌 Overview

Traditional density estimation methods like Kernel Density Estimation (KDE) scale poorly with dimensionality and dataset size. DEMANDE models densities using density matrices combined with adaptive Fourier feature maps, yielding a scalable, data-driven estimator that can be integrated with deep learning tools and evaluated efficiently. (Semantic Scholar)


🔍 Features

  • Density matrix representation of probability distributions
  • Adaptive Fourier features to approximate kernels and embed data
  • Python implementation with example notebooks
  • Modular and extensible for research and experiments
  • Includes tests and baseline usage examples

🚀 Getting Started

Setup

Installation

Install Miniconda from here and then run the following commands to create the learning_with_density_matrices environment:

conda env create -f environment.yml

conda activate learning-with-density-matrices

Next, install the package:

pip install -e .

or if you want development dependencies as well:

pip install -e .[dev]

Gitsubmodules update

This repository rely on some gitsubmodules. To update them run:

git submodule update --init --recursive

Ml-flow

All the experiments will be saved on Ml-flow in the following path using sqlite: mlflow/

mkdir mlflow/

After running your experiments, you can launch the ml-flow dashboard by running the following command:

mlflow ui --port 8080 --backend-store-uri sqlite:///mlflow/tracking.db

📁 Repository Structure

📦 demande
├── src/                    # Core implementation
├── notebooks/             # Python scripts to run demos
├── tests/                  # Unit and integration tests
├── data/                   # Example dataset
├── pyproject.toml
├── README.md
└── LICENSE


🧪 Testing

Run the test suite:

pytest tests/

📚 Related Work

DEMANDE builds on the idea of density matrices as probability density estimators, with roots in kernel and random Fourier feature methods. (Semantic Scholar)


📄 Citation

If you use this code in your research, please cite:

@article{gallego2023demande,
  title={DEMANDE: Density Matrix Neural Density Estimation},
  author={Gallego-Meji{\'a}, Joseph A. and Gonz{\'a}lez, Fabio A.},
  journal={IEEE Access},
  year={2023}
}

(This is a placeholder citation — adjust to the official published version and BibTeX entry.) (ResearchGate)


🧑‍🔬 Contributing

Contributions are welcome! Please open issues for bugs, feature requests, or improvements.

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for new behavior
  4. Submit a pull request

📜 License

This project is licensed under the MIT License.


If you want, I can also generate badges (e.g., build status, PyPI, citations) or add installation via pip/Conda and API reference sections to the README.

About

This paper presents a novel method for neural density estimation based on density matrices and adaptive Fourier features.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors