{ "info": { "author": "Joan Puigcerver", "author_email": "joapuipe@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Image Recognition", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# prob-phoc\n\n[![Build Status](https://travis-ci.com/jpuigcerver/prob-phoc.svg?branch=master)](https://travis-ci.com/jpuigcerver/prob-phoc)\n\nPyTorch functions to compute meaningful probabilistic relevance scores from\nPHOC (Pyramid of Histograms of Characters) embeddings.\nAlthough they are called Pyramid of Histograms of Characters, in practice\nthey are a Pyramid of Bag of Characters. At the end, each word is\nrepresented by a high-dimensional binary vector.\n\nSee the [wiki](https://github.com/jpuigcerver/prob-phoc/wiki)\nfor additional details.\n\n## Usage\n\nThe library provides two functions: `cphoc` and `pphoc`, which are\nsimilar to SciPy's `cdist` and `pdist`:\n\nBoth functions can operate with PHOC embeddings in the probability space (where\neach dimension is a real number in the range [0, 1]), or in the log-probability\nspace (where each dimension is the logarithm of a probability). These are also\nsometimes refered to as the Real and Log semirings.\n\n```python\nimport torch\nfrom prob_phoc import cphoc, pphoc\n\nx = torch.Tensor(...)\ny = torch.Tensor(...)\n\n# Compute the log-relevance scores between all pairs of rows in x, y.\n# Note: x and y must have the PHOC log-probabilities.\nlogprob = cphoc(x, y)\n\n# This is equivalent to:\nlogprob = cphoc(x, y, method=\"sum_prod_log\")\n\n# If your matrices have probabilities instead of log-probabilities, use:\nprob = cphoc(x, y, method=\"sum_prob_real\")\n\n# Compute the log-relevance scores between all pairs of distinct rows in x.\n# Note: The output is a vector with N * (N - 1) / 2 elements.\nlogprob = pphoc(x)\n```\n\n## Installation\n\nThe easiest way is to install the package from PyPI:\n\n```bash\npip install prob-phoc\n```\n\nIf you want to install the latest version from the repository, clone it\nand use the setup.py script to compile and install the library.\n\n```bash\npython setup.py install\n```\n\nYou will need a C++11 compiler (tested with GCC 4.9).\nIf you want to compile with CUDA support, you will also need to install\nthe CUDA Toolkit (tested with versions 8.0, 9.0 and 10.0)\n\n## Tests and benchmarks\n\nAfter the installation, you can run the tests to ensure that everything is\nworking fine.\n\n```bash\npython -m prob_phoc.test\n```\n\nI have also some benchmarks to compare CPU vs. CUDA, for different matrix\nsizes and float precision. These take quite a long to run, so don't hold\nyour breath.\n\n```bash\npython -m prob_phoc.benchmark\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jpuigcerver/prob_phoc", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "prob-phoc", "package_url": "https://pypi.org/project/prob-phoc/", "platform": "", "project_url": "https://pypi.org/project/prob-phoc/", "project_urls": { "Homepage": "https://github.com/jpuigcerver/prob_phoc" }, "release_url": "https://pypi.org/project/prob-phoc/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Functions to compute probabilistic relevance scores from PHOC embeddings", "version": "0.2.0" }, "last_serial": 4793621, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "16a625380d83d4fee20b6c9bf2149418", "sha256": "7b0cc8f200064f9172eddcaeb63f3bfa57e91da739eab4355419dea56ea3311d" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "16a625380d83d4fee20b6c9bf2149418", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 1304980, "upload_time": "2019-02-08T00:16:40", "url": "https://files.pythonhosted.org/packages/21/88/97a1b244175b124423b2a96bfbbc34cf3a267a81beda2b2523bc5ef14656/prob_phoc-0.2.0-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "b4a359e78d35a85358a1b012fe72fa83", "sha256": "525c8a7393e1ca25974bb559bb0f5f961ed4a549711237bbd7529ebb3a5dd419" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "b4a359e78d35a85358a1b012fe72fa83", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 1304697, "upload_time": "2019-02-08T00:16:46", "url": "https://files.pythonhosted.org/packages/fb/bd/3535d1c23a7e9d42b980ddf1d4f03f38203f1dd4ccb1a6f5aded89de8f5c/prob_phoc-0.2.0-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6a30b9ee33888a91312763cd10a4c1b5", "sha256": "9dd89673b63d2c52e2eab302b720041b47ff364ff99dfbab5ed8bcacdeaec48d" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "6a30b9ee33888a91312763cd10a4c1b5", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 1304072, "upload_time": "2019-02-08T00:16:49", "url": "https://files.pythonhosted.org/packages/7a/95/d110c5a7af200e28d6850f5251abed6d07dc93090271958ad3b5a458b045/prob_phoc-0.2.0-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "d00b1164931bd684940ff537090b8bcd", "sha256": "494d378ac352935af226a0ffcf680b38cd30b97381a0339806261b0615314f21" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "d00b1164931bd684940ff537090b8bcd", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 1306874, "upload_time": "2019-02-08T00:16:51", "url": "https://files.pythonhosted.org/packages/e3/e7/c57b0e33e3f2acb7ea312a1a82ecf127f51fd69eefcf9cd536727cd91f44/prob_phoc-0.2.0-cp37-cp37m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f858c4591cacaa29bc8cc7e4b8dd4abe", "sha256": "9a6143f9cfdbbd94d53b97a88bd506b1c917dfce6b1bc9b45291931cf8253c22" }, "downloads": -1, "filename": "prob_phoc-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f858c4591cacaa29bc8cc7e4b8dd4abe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10155, "upload_time": "2019-02-08T00:15:41", "url": "https://files.pythonhosted.org/packages/b6/30/b218c6e430b7b22e368bd6fa67b7a8e74f993e9b3ac08b3f2acf1ee99145/prob_phoc-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "16a625380d83d4fee20b6c9bf2149418", "sha256": "7b0cc8f200064f9172eddcaeb63f3bfa57e91da739eab4355419dea56ea3311d" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "16a625380d83d4fee20b6c9bf2149418", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 1304980, "upload_time": "2019-02-08T00:16:40", "url": "https://files.pythonhosted.org/packages/21/88/97a1b244175b124423b2a96bfbbc34cf3a267a81beda2b2523bc5ef14656/prob_phoc-0.2.0-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "b4a359e78d35a85358a1b012fe72fa83", "sha256": "525c8a7393e1ca25974bb559bb0f5f961ed4a549711237bbd7529ebb3a5dd419" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "b4a359e78d35a85358a1b012fe72fa83", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 1304697, "upload_time": "2019-02-08T00:16:46", "url": "https://files.pythonhosted.org/packages/fb/bd/3535d1c23a7e9d42b980ddf1d4f03f38203f1dd4ccb1a6f5aded89de8f5c/prob_phoc-0.2.0-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6a30b9ee33888a91312763cd10a4c1b5", "sha256": "9dd89673b63d2c52e2eab302b720041b47ff364ff99dfbab5ed8bcacdeaec48d" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "6a30b9ee33888a91312763cd10a4c1b5", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 1304072, "upload_time": "2019-02-08T00:16:49", "url": "https://files.pythonhosted.org/packages/7a/95/d110c5a7af200e28d6850f5251abed6d07dc93090271958ad3b5a458b045/prob_phoc-0.2.0-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "d00b1164931bd684940ff537090b8bcd", "sha256": "494d378ac352935af226a0ffcf680b38cd30b97381a0339806261b0615314f21" }, "downloads": -1, "filename": "prob_phoc-0.2.0-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "d00b1164931bd684940ff537090b8bcd", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 1306874, "upload_time": "2019-02-08T00:16:51", "url": "https://files.pythonhosted.org/packages/e3/e7/c57b0e33e3f2acb7ea312a1a82ecf127f51fd69eefcf9cd536727cd91f44/prob_phoc-0.2.0-cp37-cp37m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f858c4591cacaa29bc8cc7e4b8dd4abe", "sha256": "9a6143f9cfdbbd94d53b97a88bd506b1c917dfce6b1bc9b45291931cf8253c22" }, "downloads": -1, "filename": "prob_phoc-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f858c4591cacaa29bc8cc7e4b8dd4abe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10155, "upload_time": "2019-02-08T00:15:41", "url": "https://files.pythonhosted.org/packages/b6/30/b218c6e430b7b22e368bd6fa67b7a8e74f993e9b3ac08b3f2acf1ee99145/prob_phoc-0.2.0.tar.gz" } ] }