pytorchse3


Namepytorchse3 JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/eigenvivek/pytorchse3
SummaryNumerically stable implementations of batched SE(3) exp and log maps
upload_time2023-12-07 18:48:40
maintainer
docs_urlNone
authorVivek Gopalakrishnan
requires_python>=3.7
licenseMIT License
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pytorchse3
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install pytorchse3
```

## How to use

``` python
import torch

from pytorchse3.se3 import se3_exp_map, se3_log_map
```

Here are two transformation matrices for which `PyTorch3D` recovers the
wrong log map (see [this
issue](https://github.com/facebookresearch/pytorch3d/issues/1609?notification_referrer_id=NT_kwDOAcYOvLM3MzY1NTAxMTY0OjI5NzU3MTE2#issuecomment-1839450529)).

``` python
T = torch.Tensor(
    [
        [
            [-0.7384057045, 0.3333132863, -0.5862244964, 0.0000000000],
            [0.3520625532, -0.5508944392, -0.7566816807, 0.0000000000],
            [-0.5751599669, -0.7651259303, 0.2894364297, 0.0000000000],
            [-0.1840534210, -0.1836946011, 0.9952554703, 1.0000000000],
        ],
        [
            [-0.7400283217, 0.5210028887, -0.4253400862, 0.0000000000],
            [0.5329059958, 0.0683888718, -0.8434065580, 0.0000000000],
            [-0.4103286564, -0.8508108258, -0.3282552958, 0.0000000000],
            [-0.1197679043, 0.1799146235, 0.5538908839, 1.0000000000],
        ],
    ],
).transpose(-1, -2)
```

`pytorchse3` computes the correct log map.

``` python
log_T_vee = se3_log_map(T)
log_T_vee
```

    tensor([[ 1.1319,  1.4831, -2.5131, -0.8503, -0.1170,  0.7346],
            [ 1.1288,  2.2886, -1.8147, -0.8812,  0.0367, -0.1004]])

Exponentiating the log map recovers the original transformation matrix
with 1e-4 absolute error.

``` python
eq_T = se3_exp_map(log_T_vee)
assert torch.allclose(T, eq_T, atol=1e-4)
```

``` python
T - eq_T
```

    tensor([[[-9.2983e-06, -2.3842e-07,  1.1504e-05,  2.9802e-08],
             [-5.1558e-06,  8.5235e-06, -8.6427e-06, -2.9802e-08],
             [ 8.6427e-06, -6.4373e-06,  4.4703e-07,  0.0000e+00],
             [ 0.0000e+00,  0.0000e+00,  0.0000e+00,  0.0000e+00]],

            [[ 8.0466e-06,  1.6212e-05,  6.0201e-06, -3.7253e-08],
             [ 4.5896e-06,  8.6352e-06,  3.3975e-06,  2.9802e-08],
             [-8.5831e-06,  1.0610e-05, -1.6809e-05,  0.0000e+00],
             [ 0.0000e+00,  0.0000e+00,  0.0000e+00,  0.0000e+00]]])

## References

- `pytorchse3` implements log/exp maps defined in Section 2 and 3 of
  [Ethan Eade’s tutorial](https://ethaneade.com/lie.pdf)
- Our numerically stable
  [`so3_log_map`](https://vivekg.dev/pytorchse3/so3.html#so3_log_map) is
  a PyTorch port of
  [`pytransform3d`](https://github.com/dfki-ric/pytransform3d/blob/c45e817c4a7960108afe9f5259542c8376c0e89a/pytransform3d/rotations/_conversions.py#L1719-L1787)
- Taylor expansions for some coefficients in
  [`se3_log_map`](https://vivekg.dev/pytorchse3/se3.html#se3_log_map)
  are taken from
  [`H2-Mapping`](https://github.com/SYSU-STAR/H2-Mapping/blob/11b8ab15f3302ccb2b4b3d2b30f76d86dcfcde2c/mapping/src/se3pose.py#L89-L118)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eigenvivek/pytorchse3",
    "name": "pytorchse3",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nbdev jupyter notebook python",
    "author": "Vivek Gopalakrishnan",
    "author_email": "vivekg@mit.edu",
    "download_url": "https://files.pythonhosted.org/packages/0c/fd/af35bf585b82124c31ae8aa2fea4c20ed5e0e113d985156d9fa60bc04ce8/pytorchse3-0.0.3.tar.gz",
    "platform": null,
    "description": "pytorchse3\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Install\n\n``` sh\npip install pytorchse3\n```\n\n## How to use\n\n``` python\nimport torch\n\nfrom pytorchse3.se3 import se3_exp_map, se3_log_map\n```\n\nHere are two transformation matrices for which `PyTorch3D` recovers the\nwrong log map (see [this\nissue](https://github.com/facebookresearch/pytorch3d/issues/1609?notification_referrer_id=NT_kwDOAcYOvLM3MzY1NTAxMTY0OjI5NzU3MTE2#issuecomment-1839450529)).\n\n``` python\nT = torch.Tensor(\n    [\n        [\n            [-0.7384057045, 0.3333132863, -0.5862244964, 0.0000000000],\n            [0.3520625532, -0.5508944392, -0.7566816807, 0.0000000000],\n            [-0.5751599669, -0.7651259303, 0.2894364297, 0.0000000000],\n            [-0.1840534210, -0.1836946011, 0.9952554703, 1.0000000000],\n        ],\n        [\n            [-0.7400283217, 0.5210028887, -0.4253400862, 0.0000000000],\n            [0.5329059958, 0.0683888718, -0.8434065580, 0.0000000000],\n            [-0.4103286564, -0.8508108258, -0.3282552958, 0.0000000000],\n            [-0.1197679043, 0.1799146235, 0.5538908839, 1.0000000000],\n        ],\n    ],\n).transpose(-1, -2)\n```\n\n`pytorchse3` computes the correct log map.\n\n``` python\nlog_T_vee = se3_log_map(T)\nlog_T_vee\n```\n\n    tensor([[ 1.1319,  1.4831, -2.5131, -0.8503, -0.1170,  0.7346],\n            [ 1.1288,  2.2886, -1.8147, -0.8812,  0.0367, -0.1004]])\n\nExponentiating the log map recovers the original transformation matrix\nwith 1e-4 absolute error.\n\n``` python\neq_T = se3_exp_map(log_T_vee)\nassert torch.allclose(T, eq_T, atol=1e-4)\n```\n\n``` python\nT - eq_T\n```\n\n    tensor([[[-9.2983e-06, -2.3842e-07,  1.1504e-05,  2.9802e-08],\n             [-5.1558e-06,  8.5235e-06, -8.6427e-06, -2.9802e-08],\n             [ 8.6427e-06, -6.4373e-06,  4.4703e-07,  0.0000e+00],\n             [ 0.0000e+00,  0.0000e+00,  0.0000e+00,  0.0000e+00]],\n\n            [[ 8.0466e-06,  1.6212e-05,  6.0201e-06, -3.7253e-08],\n             [ 4.5896e-06,  8.6352e-06,  3.3975e-06,  2.9802e-08],\n             [-8.5831e-06,  1.0610e-05, -1.6809e-05,  0.0000e+00],\n             [ 0.0000e+00,  0.0000e+00,  0.0000e+00,  0.0000e+00]]])\n\n## References\n\n- `pytorchse3` implements log/exp maps defined in Section 2 and 3 of\n  [Ethan Eade\u2019s tutorial](https://ethaneade.com/lie.pdf)\n- Our numerically stable\n  [`so3_log_map`](https://vivekg.dev/pytorchse3/so3.html#so3_log_map) is\n  a PyTorch port of\n  [`pytransform3d`](https://github.com/dfki-ric/pytransform3d/blob/c45e817c4a7960108afe9f5259542c8376c0e89a/pytransform3d/rotations/_conversions.py#L1719-L1787)\n- Taylor expansions for some coefficients in\n  [`se3_log_map`](https://vivekg.dev/pytorchse3/se3.html#se3_log_map)\n  are taken from\n  [`H2-Mapping`](https://github.com/SYSU-STAR/H2-Mapping/blob/11b8ab15f3302ccb2b4b3d2b30f76d86dcfcde2c/mapping/src/se3pose.py#L89-L118)\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Numerically stable implementations of batched SE(3) exp and log maps",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/eigenvivek/pytorchse3"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c50f3c7770978ece4c9947da3d60636d9d812cc470007eed69e5c4dc94741f58",
                "md5": "710d2861f6ef5f7e2b95beafba875a4a",
                "sha256": "07cdca16dcdf3561d1be2fe9f586262d21f84c3291b02a097c630eec7e2fac78"
            },
            "downloads": -1,
            "filename": "pytorchse3-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "710d2861f6ef5f7e2b95beafba875a4a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6728,
            "upload_time": "2023-12-07T18:48:37",
            "upload_time_iso_8601": "2023-12-07T18:48:37.957497Z",
            "url": "https://files.pythonhosted.org/packages/c5/0f/3c7770978ece4c9947da3d60636d9d812cc470007eed69e5c4dc94741f58/pytorchse3-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cfdaf35bf585b82124c31ae8aa2fea4c20ed5e0e113d985156d9fa60bc04ce8",
                "md5": "0faad13c18c1de1cbd3caa489d6bf1e1",
                "sha256": "ecda68926ea06ab746172db588d0ed7bd87793c25346ce7a52c8a6631302d87b"
            },
            "downloads": -1,
            "filename": "pytorchse3-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0faad13c18c1de1cbd3caa489d6bf1e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6706,
            "upload_time": "2023-12-07T18:48:40",
            "upload_time_iso_8601": "2023-12-07T18:48:40.601018Z",
            "url": "https://files.pythonhosted.org/packages/0c/fd/af35bf585b82124c31ae8aa2fea4c20ed5e0e113d985156d9fa60bc04ce8/pytorchse3-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-07 18:48:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eigenvivek",
    "github_project": "pytorchse3",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytorchse3"
}
        
Elapsed time: 2.30392s