Kernel Stein Discrepancy Descent
Sampling by optimization of the Kernel Stein Discrepancy
The paper is available at arxiv.org/abs/2105.09994.
The code uses Pytorch, and a numpy backend is available for svgd.
Install
The code is available on pip:
$ pip install ksddescent
Documentation
The documentation is at pierreablin.github.io/ksddescent/.
Example
The main function is ksdd_lbfgs, which uses the fast L-BFGS algorithm to converge quickly. It takes as input the initial position of the particles, and the score function. For instance, to samples from a Gaussian (where the score is identity), you can use these simple lines of code:
>>> import torch
>>> from ksddescent import ksdd_lbfgs
>>> n, p = 50, 2
>>> x0 = torch.rand(n, p) # start from uniform distribution
>>> score = lambda x: x # simple score function
>>> x = ksdd_lbfgs(x0, score) # run the algorithm
Reference
If you use this code in your project, please cite:
Anna Korba, Pierre-Cyril Aubin-Frankowski, Simon Majewski, Pierre Ablin Kernel Stein Discrepancy Descent International Conference on Machine Learning, 2021
Bug reports
Use the github issue tracker to report bugs.
Metadata
Release files for ksddescent 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ksddescent-0.3.tar.gz | 13.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ksddescent-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.7 kB
Release files / ksddescent-0.3.tar.gz
| Download URL | ksddescent-0.3.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8104173b61049244aa6649e6f2970398c8d5aabc3b70a4d1ce8f4de9955a771f
|
|
BLAKE2b-256 checksum How to use checksums |
76720a9bf5e7ceae33c77e09c51f72d6bb9be9bb8ef6cdc381f08da82ac576ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7
|
Release files / ksddescent-0.3-py3-none-any.whl
| Download URL | ksddescent-0.3-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
093e32135cb48f2b711d4d4c407738d47bf93b050204054a126e7176b7404c31
|
|
BLAKE2b-256 checksum How to use checksums |
8d6fd96f19bbaae7e7a89c7a66e4192bce38d43f783570a4b76ee537ef4381fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7
|
Security for ksddescent 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.