torchheat


Nametorchheat JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryDiffusion based distances in PyTorch
upload_time2024-03-07 03:12:38
maintainer
docs_urlNone
authorGuillaume Huguet
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Guillaume Huguet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords torch diffusion distances heat kernel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # heatdist
Implementation of diffusion-based distances in torch.

```python
from torchheat.heat_kernel import HeatKernelGaussian, HeatKernelKNN
import torch    

data = torch.randn(100, 5)
# Heat kernel for a gaussian affinity matrix
heat_op = HeatKernelGaussian(sigma=1.0, t=1.0)
dist = heat_op.fit(data, dist_type="var") # ["var", "phate", "diff"]

# Heat kernel for a k-nearest neighbor affinity matrix
heat_op = HeatKernelKNN(k=5, t=1.0)
dist = heat_op.fit(data, dist_type="var") # ["var", "phate", "diff"]
```

Below is an example of distance matrices from a line embedded in two dimensions. The Euclidean distance between the two sets of points highlighted in green does not reflect the true distances on the one dimensional line.
![image](https://github.com/guillaumehu/torchheat/assets/57917099/89b845a1-1625-4f36-9e8c-d3db62281e2c)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "torchheat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "torch,diffusion,distances,heat,kernel",
    "author": "Guillaume Huguet",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/97/5a/c6a09a040ae935c35f75a66467220f30ec6af99b51ae269989ef1ee8e97c/torchheat-0.1.0.tar.gz",
    "platform": null,
    "description": "# heatdist\nImplementation of diffusion-based distances in torch.\n\n```python\nfrom torchheat.heat_kernel import HeatKernelGaussian, HeatKernelKNN\nimport torch    \n\ndata = torch.randn(100, 5)\n# Heat kernel for a gaussian affinity matrix\nheat_op = HeatKernelGaussian(sigma=1.0, t=1.0)\ndist = heat_op.fit(data, dist_type=\"var\") # [\"var\", \"phate\", \"diff\"]\n\n# Heat kernel for a k-nearest neighbor affinity matrix\nheat_op = HeatKernelKNN(k=5, t=1.0)\ndist = heat_op.fit(data, dist_type=\"var\") # [\"var\", \"phate\", \"diff\"]\n```\n\nBelow is an example of distance matrices from a line embedded in two dimensions. The Euclidean distance between the two sets of points highlighted in green does not reflect the true distances on the one dimensional line.\n![image](https://github.com/guillaumehu/torchheat/assets/57917099/89b845a1-1625-4f36-9e8c-d3db62281e2c)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Guillaume Huguet  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Diffusion based distances in PyTorch",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [
        "torch",
        "diffusion",
        "distances",
        "heat",
        "kernel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b83c5f6f904d3e437bf5aa95bce9e33d97ccad49c3f59ca40e1dda4432712cf",
                "md5": "9caddf5ce560f9a648dad282419059ff",
                "sha256": "f0eaa49d976bfeaaf6fd179de8abe5dc6e5bd5c07f281d23873440fd23ed4e15"
            },
            "downloads": -1,
            "filename": "torchheat-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9caddf5ce560f9a648dad282419059ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5634,
            "upload_time": "2024-03-07T03:12:35",
            "upload_time_iso_8601": "2024-03-07T03:12:35.546128Z",
            "url": "https://files.pythonhosted.org/packages/6b/83/c5f6f904d3e437bf5aa95bce9e33d97ccad49c3f59ca40e1dda4432712cf/torchheat-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "975ac6a09a040ae935c35f75a66467220f30ec6af99b51ae269989ef1ee8e97c",
                "md5": "dcee0da9fa2386eea3f4a78690fd8194",
                "sha256": "f960964a0fff339941540d95dc5762c5dbaabef4c49576e53e04da78c758b85e"
            },
            "downloads": -1,
            "filename": "torchheat-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "dcee0da9fa2386eea3f4a78690fd8194",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7240,
            "upload_time": "2024-03-07T03:12:38",
            "upload_time_iso_8601": "2024-03-07T03:12:38.680696Z",
            "url": "https://files.pythonhosted.org/packages/97/5a/c6a09a040ae935c35f75a66467220f30ec6af99b51ae269989ef1ee8e97c/torchheat-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 03:12:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "torchheat"
}
        
Elapsed time: 0.21968s