{ "info": { "author": "Philipp Jund", "author_email": "jundp@cs.uni-freiburg.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering" ], "description": "# Tensorflow Quaternion\nAn implementation of quaternions for tensorflow. Fully differentiable.\n\nThe tfquaternion module provides an implementation of quaternions as a\ntensorflow graph.\n`tfquaternion` offers module functions for the basic quaternion arithmetic\noperations as well as a `Quaternion` class which supports the relevant magic\nmethods. This is similar to the tensorflow API, e.g. `tfq.quaternion_multiply`\nvs. `tf.multiply` and `tfq.Quaternion` vs `tf.Tensor`. Note that all functions\nstarting with `tf.quaternion_...` assume that it's arguments are `tf.Tensor`s\n(or `tfq.Quaternion`s) that can be casted to `tfq.Quaternion`, i.e. the shape\nmust be (..., 4).\n\nThis implementation is mostly compatible with a small subset of\n[moble's quaternion implementation](https://github.com/moble/quaternion/)\n(ensured by using slightly adapted versions of his tests). HOwever, there are\nat least two major differences: First, tfquaternion is type specific as is\ntensorflow, i.e. two quaternions of different dtypes can not be multiplied.\nSecond, tfquaternion supports operations on arrays of quaternions.\n\n### Installation\nYou can either use pypi\n```\npip install tfquaternion\n```\nor install the latest version from git as development package:\n```\ngit clone https://github.com/PhilJd/tf-quaternion.git\ncd tf-quaternion\npip install -e .\n```\nThe -e option only links the working copy to the python site-packages,\nso to upgrade, you only need to run `git pull`.\n\n\n### Usage\n\nBefore getting started, an important note on the division:\nThis library resembles the division behaviour of\n[moble's quaternion](https://github.com/moble/quaternion/). While in\ngeneral the division operator is not defined (from the notation q1/q2 one can\nnot conclude if q1/q2 = q1 * q2^-1 or q1/q2 = q2^-1 * q1), we follow moble's\nimplementation, i.e. `tfq.quaternion_divide` and `Quaternion.__truediv__`\ncompute `q1/q2 = q1 * 1/q2`.\n\n\n#### Example\nA simple rotation by a quaternion can look like this:\n```\n>>> import tfquaternion as tfq\n>>> import tensorflow as tf\n>>> s = tf.Session()\n>>> points = tf.constant([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=tf.float32)\n>>> quat = tfq.Quaternion([0, 1, 0, 0]) rotate by 180 degrees around x axis\n>>> s.run(tf.matmul(quat.as_rotation_matrix(), points))\narray([[ 1., 0., 0.], [ 0., -1., 0.], [ 0., 0., -1.]], dtype=float32)\n```\n\n#### API\n\n##### class Quaternion\nThe usage of the `*`-Operator depends on the multiplier. If the multiplier is a\nQuaternion, quaternion multiplication is performed while multiplication with\na tf.Tensor uses tf.multiply. The behaviour of division is similar, except if\nthe dividend is a scalar, then the inverse of the quaternion is computed.\n```\ntfq.Quaternion([1, 0, 0, 0]) * tfq.Quaternion([0, 4, 0, 0])\n>>> tfq.Quaternion([0, 4, 0, 0)\ntfq.Quaternion([1, 0, 0, 0]) * tf.Tensor([0, 4, 0, 0])\n>>> tf.Quaternion([0, 0, 0, 0)\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PhilJd/tf-quaternion", "keywords": "quaternion tensorflow differentiable", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "tfquaternion", "package_url": "https://pypi.org/project/tfquaternion/", "platform": "", "project_url": "https://pypi.org/project/tfquaternion/", "project_urls": { "Homepage": "https://github.com/PhilJd/tf-quaternion" }, "release_url": "https://pypi.org/project/tfquaternion/0.1.6/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "A differentiable quaternion implementation in tensorflow.", "version": "0.1.6" }, "last_serial": 4845233, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "59b453f6fd0a4b69ced5797b3f5b635a", "sha256": "d0b67bb818784a3886e51b3a2d25e9eaf9a5962bbd8673688921d7bc89da76cc" }, "downloads": -1, "filename": "tfquaternion-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "59b453f6fd0a4b69ced5797b3f5b635a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14259, "upload_time": "2017-12-22T10:01:57", "url": "https://files.pythonhosted.org/packages/b4/69/f74f97f979f461869c7725289aa60d02147c6ed506694d93d603db25c192/tfquaternion-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64353d1916e0852262fba01a922ec1e3", "sha256": "502562c3904d66a8af02606cae887957755491cf079ff88d0670ed32fb836c31" }, "downloads": -1, "filename": "tfquaternion-0.1.tar.gz", "has_sig": false, "md5_digest": "64353d1916e0852262fba01a922ec1e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10526, "upload_time": "2017-12-22T10:01:59", "url": "https://files.pythonhosted.org/packages/f3/8c/c13c7d54a48980e9fedab657c57b925f65adc7193e5f4881e1e11d56912d/tfquaternion-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a51ca5302476cd3ba9a1aa6836e3ba87", "sha256": "1207064b14667bf8c97aaa4cf4d920445f09cca32f845d93b2de1f6079f4a4a2" }, "downloads": -1, "filename": "tfquaternion-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a51ca5302476cd3ba9a1aa6836e3ba87", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14277, "upload_time": "2017-12-22T16:46:44", "url": "https://files.pythonhosted.org/packages/0b/11/04df992a4eb090cdb442fc997e2d08034857db0331ab3ff00a5be36fa7f0/tfquaternion-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e4d40ab86e42f92ddd161dfcfbfdfbb9", "sha256": "a44a70a666b71b148e8d828e91303dca7c98537e866f6db169a2c6dc49363fda" }, "downloads": -1, "filename": "tfquaternion-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e4d40ab86e42f92ddd161dfcfbfdfbb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10325, "upload_time": "2017-12-22T16:47:42", "url": "https://files.pythonhosted.org/packages/14/5b/8ca70edb4d1a2e70a59aa73ccc85ecfef992146124fa27bd2250dc347513/tfquaternion-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "df70e82418ddbdfe76c377475620ccb1", "sha256": "0f69f68544a69bef72806781f39b38b23dc7e2475cea8627c5789c544d7f1792" }, "downloads": -1, "filename": "tfquaternion-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "df70e82418ddbdfe76c377475620ccb1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14304, "upload_time": "2018-01-02T15:41:28", "url": "https://files.pythonhosted.org/packages/d6/4e/66dfbc5b090cde098892ce63c2803dbb25e6a697dad429be617046a37a38/tfquaternion-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ae71f9fc61f93efcd53e399327099a72", "sha256": "2f0a35a7d254c362828f3a6de64996c109b017518789e22d2e15633a243c56a8" }, "downloads": -1, "filename": "tfquaternion-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ae71f9fc61f93efcd53e399327099a72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10555, "upload_time": "2018-01-02T15:41:31", "url": "https://files.pythonhosted.org/packages/63/88/9c9320a8a9cc849574919f3ad05f929dd8bfd565a9308e86ab10168beeea/tfquaternion-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2e99ad24b56d6abf26b4ca88413186da", "sha256": "5d671bdbd8186c97a0041e884b650aab45bcd08c3a0e990289ed12fd76cd3e98" }, "downloads": -1, "filename": "tfquaternion-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e99ad24b56d6abf26b4ca88413186da", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14592, "upload_time": "2018-02-05T08:34:40", "url": "https://files.pythonhosted.org/packages/5e/a9/e875cf60396b38a64154c02e6d8542315be22d3bd9f2cee03a1593664f58/tfquaternion-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "77d8a40a8e033f30907e81af26b93668", "sha256": "4d211bc837b5724507f40f858adf170886b76506b7ef584cef0e817335782273" }, "downloads": -1, "filename": "tfquaternion-0.1.3.tar.gz", "has_sig": false, "md5_digest": "77d8a40a8e033f30907e81af26b93668", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10835, "upload_time": "2018-02-05T08:34:42", "url": "https://files.pythonhosted.org/packages/37/c1/21a8ec2129dbda3fbaf981f848e6a868efa679f749d12fc1ca05a63cebca/tfquaternion-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "4016a4ed8003c438e429f8a4e811b769", "sha256": "0fe930d3cd1a41de913564d8f85b67cb131516214c247c94f1e58290d14200c0" }, "downloads": -1, "filename": "tfquaternion-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4016a4ed8003c438e429f8a4e811b769", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14585, "upload_time": "2018-02-09T09:36:51", "url": "https://files.pythonhosted.org/packages/88/9a/968c2bdbb6bf7193479f91c0bdda65108d9cfeceb0871a8659e9b8154954/tfquaternion-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a486be4bdc02ccadf1c427a10a1973f8", "sha256": "c48d28844c934ed084d4fd9a54d1bf6a1c6ba12d5226cc6fb817650200914273" }, "downloads": -1, "filename": "tfquaternion-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a486be4bdc02ccadf1c427a10a1973f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11063, "upload_time": "2018-02-09T09:36:52", "url": "https://files.pythonhosted.org/packages/c5/ad/bdc9a34779293f934a91aa00c03dc0d12f1d03f9671eb0bdc6144c5a8ebb/tfquaternion-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "1b5c9ba20d10972b9375b072a892e9aa", "sha256": "92b6c80dc36dd9b355f87fefc9f04f7182ebb2136fc758a484554cb5b404b889" }, "downloads": -1, "filename": "tfquaternion-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1b5c9ba20d10972b9375b072a892e9aa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14808, "upload_time": "2018-02-15T17:15:54", "url": "https://files.pythonhosted.org/packages/75/3d/863ba1eecddea5fd6e0cf6502807cfad0f0dab55f1b7052850a5fa7a3bc2/tfquaternion-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c95837fd17b7120292b388eca92387d", "sha256": "610be06b329db2b95185aebc5652ded94bda0b5b3c7055a8f7fd5961776024f3" }, "downloads": -1, "filename": "tfquaternion-0.1.5.tar.gz", "has_sig": false, "md5_digest": "0c95837fd17b7120292b388eca92387d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11299, "upload_time": "2018-02-15T17:15:55", "url": "https://files.pythonhosted.org/packages/ba/74/37ccb84da3af3104a18f660075632fe9a511622674e4faeefefe9fd18636/tfquaternion-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "6eb6b617b82ef9ae842cea4d54051edb", "sha256": "ad64d86032bd371c713343e923580354d67755ee7b11ca7c4d0509d190bd9c66" }, "downloads": -1, "filename": "tfquaternion-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6eb6b617b82ef9ae842cea4d54051edb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16699, "upload_time": "2019-02-20T12:29:43", "url": "https://files.pythonhosted.org/packages/8b/07/e89478b7816ffaefed054c162adb71741055ad53570f1b6c21d2d14f32c4/tfquaternion-0.1.6-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6eb6b617b82ef9ae842cea4d54051edb", "sha256": "ad64d86032bd371c713343e923580354d67755ee7b11ca7c4d0509d190bd9c66" }, "downloads": -1, "filename": "tfquaternion-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6eb6b617b82ef9ae842cea4d54051edb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16699, "upload_time": "2019-02-20T12:29:43", "url": "https://files.pythonhosted.org/packages/8b/07/e89478b7816ffaefed054c162adb71741055ad53570f1b6c21d2d14f32c4/tfquaternion-0.1.6-py2.py3-none-any.whl" } ] }