Skip to main content
Files added late

2 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.


DPGMM SubClusters 2d example

DPMMSubClusters

This package is a Python wrapper for the DPMMSubClusters.jl Julia package.

Motivation

Working on a subset of 100K images from ImageNet, containing 79 classes, we have created embeddings using SWAV, and reduced the dimension to 128 using PCA. We have compared our method with the popular scikit-learn GMM and DPGMM with the following results:

Method Timing (sec) NMI (higher is better)
Scikit-learn's GMM (using EM, and given the True K) 2523 0.695
Scikit-learn's DPGMM 6108 0.683
DPMMpython 475 0.705

Installation

pip install dpmmpython

If you already have Julia installed, install PyJulia and add the package DPMMSubClusters to your julia installation.

Make sure Julia path is configured correctly, e.g. you should be able to run julia by typing `julia` from the terminal, unless configured properly, PyJulia wont work.

Installation Shortcut for Ubuntu distributions
If you do not have Julia installed, or wish to create a clean installation for the purpose of using this package. after installing (with pip), do the following:

import dpmmpython
dpmmpython.install()

Optional arguments are install(julia_download_path = 'https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.0-linux-x86_64.tar.gz', julia_target_path = None), where the former specify the julia download file, and the latter the installation path, if the installation path is not specified, $HOME$/julia will be used.
As the install() command edit your .bashrc path, before using the pacakge, the terminal should either be reset, or modify the current environment according to the julia path you specified ($HOME$/julia/julia-1.4.0/bin by default).

Usage Example:

from dpmmpython.dpmmwrapper import DPMMPython
from dpmmpython.priors import niw
import numpy as np

data,gt = DPMMPython.generate_gaussian_data(10000, 2, 10, 100.0)
prior = niw(1,np.zeros(2),4,np.eye(2))
labels,_,sub_labels= DPMMPython.fit(data,100,prior = prior,verbose = True, gt = gt)
Iteration: 1 || Clusters count: 1 || Log posterior: -71190.14226686998 || Vi score: 1.990707323192506 || NMI score: 6.69243345834295e-16 || Iter Time:0.004499912261962891 || Total time:0.004499912261962891
Iteration: 2 || Clusters count: 1 || Log posterior: -71190.14226686998 || Vi score: 1.990707323192506 || NMI score: 6.69243345834295e-16 || Iter Time:0.0038819313049316406 || Total time:0.008381843566894531
...
Iteration: 98 || Clusters count: 9 || Log posterior: -40607.39498126549 || Vi score: 0.11887067921133423 || NMI score: 0.9692247699387838 || Iter Time:0.015907764434814453 || Total time:0.5749104022979736
Iteration: 99 || Clusters count: 9 || Log posterior: -40607.39498126549 || Vi score: 0.11887067921133423 || NMI score: 0.9692247699387838 || Iter Time:0.01072382926940918 || Total time:0.5856342315673828
Iteration: 100 || Clusters count: 9 || Log posterior: -40607.39498126549 || Vi score: 0.11887067921133423 || NMI score: 0.9692247699387838 || Iter Time:0.010260820388793945 || Total time:0.5958950519561768

You can modify the number of processes by using DPMMPython.add_procs(procs_count), note that you can only scale it upwards.

Additional Examples:

Clustering
Multi-Process

Python 3.8

Due to recent issue with the package used as interface between Julia and Python https://github.com/JuliaPy/pyjulia/issues/425 , there might be problems working with Python >= 3.8.

Misc

For any questions: dinari@post.bgu.ac.il

Contributions, feature requests, suggestion etc.. are welcomed.

If you use this code for your work, please cite the following:

@inproceedings{dinari2019distributed,
  title={Distributed MCMC Inference in Dirichlet Process Mixture Models Using Julia},
  author={Dinari, Or and Yu, Angel and Freifeld, Oren and Fisher III, John W},
  booktitle={2019 19th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGRID)},
  pages={518--525},
  year={2019}
}

Metadata

Release files for dpmmpython-trax 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for dpmmpython-trax 0.1.5
File Size Uploaded Provenance Actions
dpmmpython_trax-0.1.5.tar.gz 6.6 kB File added late: Without provenance Details for dpmmpython_trax-0.1.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dpmmpython-trax 0.1.5
File Interpreter ABI Platform Actions
dpmmpython_trax-0.1.5-py3-none-any.whl Python 3 none any Details for dpmmpython_trax-0.1.5-py3-none-any.whl
dpmmpython_trax-0.1.5-py2-none-any.whl Python 2 none any Details for dpmmpython_trax-0.1.5-py2-none-any.whl

Total release size: 22.9 kB

Release files / dpmmpython_trax-0.1.5.tar.gz

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL dpmmpython_trax-0.1.5.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a8e9caaf9039dca60772cda07ee5f78bb92d513feff9b8d847c57f16b862d305
BLAKE2b-256 checksum
How to use checksums
955534b8dd6097c6c466d6b71f07a556bcbe997bb49a74b5e38424b211c4ba3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

Release files / dpmmpython_trax-0.1.5-py3-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL dpmmpython_trax-0.1.5-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd9359b3ff2af9c0cf730f8e617357f6584bf3bf55ddd2c4b01712a3ff917278
BLAKE2b-256 checksum
How to use checksums
43faba5ee4fcc47adad86a154d1ccb8932f329f1cfc30b15678250f487c0c637
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

Release files / dpmmpython_trax-0.1.5-py2-none-any.whl

Download URL dpmmpython_trax-0.1.5-py2-none-any.whl
Size 8.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
457cf5b009b8b388e91a019c540091a4c1a61d794fb65047ac6f81b1b5b0b7c8
BLAKE2b-256 checksum
How to use checksums
247f653a93ad20dc920d2ae3add742387209f1b08de99cc7e5e367e62128df21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.13

Security for dpmmpython-trax 0.1.5

Upload timing

Files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page