torchheat


Nametorchheat JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryDiffusion based distances in PyTorch
upload_time2024-06-28 13:20:46
maintainerNone
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": null,
    "name": "torchheat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "torch, diffusion, distances, heat, kernel",
    "author": "Guillaume Huguet",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/6c/d6/2ff623db053c89157003a1fcd4ce6ee38648eb3f83ee48fafcf570eb5c2c/torchheat-0.2.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.2.0",
    "project_urls": null,
    "split_keywords": [
        "torch",
        " diffusion",
        " distances",
        " heat",
        " kernel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb2c0a4cb0ea3f45580d92d7c86db480209d2ab9d5f5853a970d7bfd90460ec5",
                "md5": "d546ddd3dbacab1e81658989b986c97e",
                "sha256": "31a67b060888591e63b4d1a390978fe7192e501c5c7c7fe931a88c3853dafba2"
            },
            "downloads": -1,
            "filename": "torchheat-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d546ddd3dbacab1e81658989b986c97e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5656,
            "upload_time": "2024-06-28T13:20:44",
            "upload_time_iso_8601": "2024-06-28T13:20:44.689588Z",
            "url": "https://files.pythonhosted.org/packages/eb/2c/0a4cb0ea3f45580d92d7c86db480209d2ab9d5f5853a970d7bfd90460ec5/torchheat-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cd62ff623db053c89157003a1fcd4ce6ee38648eb3f83ee48fafcf570eb5c2c",
                "md5": "b3d897b07665ac0802d9c89ef52a8ac3",
                "sha256": "22d9838f5dfda7c0756c3e4d5ff12ede77c11b1823ffb26e05ab63ba7dd6333b"
            },
            "downloads": -1,
            "filename": "torchheat-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b3d897b07665ac0802d9c89ef52a8ac3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7308,
            "upload_time": "2024-06-28T13:20:46",
            "upload_time_iso_8601": "2024-06-28T13:20:46.007350Z",
            "url": "https://files.pythonhosted.org/packages/6c/d6/2ff623db053c89157003a1fcd4ce6ee38648eb3f83ee48fafcf570eb5c2c/torchheat-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-28 13:20:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "torchheat"
}
        
Elapsed time: 0.30313s