{ "info": { "author": "Floris Laporte", "author_email": "floris.laporte@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# torch_eunn\n\nThis repository contains a simple PyTorch implementation of a Tunable Efficient\nUnitary Neural Network (EUNN) Cell.\n\nThe implementation is loosely based on the tunable EUNN presented in this\npaper: [https://arxiv.org/abs/1612.05231](https://arxiv.org/abs/1612.05231).\n\n\n## Installation\n\n```\n pip install torch_eunn\n```\n\n\n## Usage\n\n```python\n from torch_eunn import EUNN # feed forward layer\n from torch_eunn import EURNN # recurrent unit\n```\n\n#### Note\nThe `hidden_size` ***and*** the `capacity` of the EUNN need to be ***even***, as explained in the section *\"Difference with original implementation\"*.\n\n## Examples\n\n* 00: [Simple Tests](examples/00_simple_tests.ipynb)\n* 01: [Copying Task](examples/01_copying_task.ipynb)\n* 02: [MNIST Task](examples/02_mnist.ipynb)\n\n\n## Requirements\n\n* [PyTorch](http://pytorch.org) >= 0.4.0: `conda install pytorch -c pytorch`\n\n\n## Difference with original implementation\n\n\nThis implementation of the EUNN has a major difference with the original\nimplementation proposed in\n[https://arxiv.org/abs/1612.05231](https://arxiv.org/abs/1612.05231), which is\noutlined below.\n\nIn the original implementation, the first output of the top directional coupler\nof a capacity-2 sublayer skips the second layer of directional couplers\n(indicated with dots in the ascii figure below) to connect to the next\ncapacity-2 sublayer of the EUNN. The reverse happens at the bottom, where the\nfirst layer of the capacity-2 sublayer is skipped. This way, a\n`(2*n+1)`-dimensional unitary matrix representation is created, with `n` the\nnumber of mixing units in each capacity-1 sublayer.\n```\n __ __......\n \\/\n __/\\____ __\n \\/\n __ ____/\\__\n \\/\n __/\\____ __\n \\/\n ......__/\\__\n```\nFor each capacity-1 sublayer with `N=2*n+1` inputs (`N` odd), we thus have `N-1`\nparameters (each mixing unit has 2 parameters). Thus to have a unitary matrix\nrepresentation that spans the full unitary space, one needs `N` capacity-1\nlayers ***and*** `N` *extra* phases appended to the back of the capacity-`N`\nsublayer to bring the total number of parameters in the unitary-matrix\nrepresentation to `N**2` (the total number of independent parameters in a\nunitary matrix).\n\nIn the implementation proposed here, the dots in each capacity-2 sublayer are\nconnected onto themselves (periodic boundaries). This has the implication that\nfor each capacity-1 sublayer with `n` directional couplers, there are `N=2*n`\ninputs and as many independent parameters. This means that we just need `N`\ncapacity-1 sublayers and **no** *extra* phases to span the full unitary space\nwith `N**2` parameters.\n\nThis, however, has the implication that the `hidden_size = N = 2*n` of the\nunitary matrix should always be *even*. Also, because the forward pass is\ndefined per capacity-**2** sublayer (as opposed per capacity-1 sublayer in the\noriginal implementation) the capacity has to be *even* as well.\n\n\n## License\n\n\u00a9 Floris Laporte, 2018-2019.\n\nMade available under the MIT license.\n\n\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/flaport/torch_eunn", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "torch-eunn", "package_url": "https://pypi.org/project/torch-eunn/", "platform": "", "project_url": "https://pypi.org/project/torch-eunn/", "project_urls": { "Homepage": "https://github.com/flaport/torch_eunn" }, "release_url": "https://pypi.org/project/torch-eunn/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "An Efficient Unitary Neural Network implementation for PyTorch", "version": "0.2.0" }, "last_serial": 4693347, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "ea15ff67030153b337ecbc365e7b366a", "sha256": "19f68157a5cb0410ea4331a1c23752322cb4127bf620f4aea0c8023c6e5f04fd" }, "downloads": -1, "filename": "torch_eunn-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "ea15ff67030153b337ecbc365e7b366a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5192, "upload_time": "2018-09-17T14:12:31", "url": "https://files.pythonhosted.org/packages/d6/6f/7d0969f85211f711d2beea0a99ec4784ae97be38158fc02ec6bc543fd880/torch_eunn-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8d918f8eac692279bd2d8de3594123a", "sha256": "3025ddeb76781623c601dd0f1f36d3bfad703517ae1f644d35197dd833e2d8f2" }, "downloads": -1, "filename": "torch_eunn-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b8d918f8eac692279bd2d8de3594123a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5187, "upload_time": "2018-09-14T09:00:39", "url": "https://files.pythonhosted.org/packages/ca/bf/d64b72b38858882476e86a72910ed4fee109db4544634afd5f0280b29fe6/torch_eunn-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c86b271a4a4502e54af5ed18d32a83c", "sha256": "238340ae1741ba963a21cf227eea76c65b702d3f093a9d1bddec2a51833ff019" }, "downloads": -1, "filename": "torch_eunn-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6c86b271a4a4502e54af5ed18d32a83c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4680, "upload_time": "2018-09-14T09:00:40", "url": "https://files.pythonhosted.org/packages/05/34/7c3d4e7029bfd224eec79d61114d61f05b428fe3d99ca712ec2c3d796c68/torch_eunn-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "874275217267dd08b13ad4b5ee14584c", "sha256": "eeb0c4ef9f32f9486ccd5f7e96f29d9a88bff24ba1744f8c86720e85084312f8" }, "downloads": -1, "filename": "torch_eunn-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "874275217267dd08b13ad4b5ee14584c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5319, "upload_time": "2018-09-20T10:48:12", "url": "https://files.pythonhosted.org/packages/f8/e9/fd3d7d7948ab2ab21abf519c964986f1f60448d0c91fc70c4258ba543ccd/torch_eunn-0.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1fbbdfb927939ccdcb1760f23f9842b1", "sha256": "d69dc6bc28eb00e98361ef0e5071f10d270b4ed821621ecf49e493e8d62f6a2e" }, "downloads": -1, "filename": "torch_eunn-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1fbbdfb927939ccdcb1760f23f9842b1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5320, "upload_time": "2018-09-20T10:46:14", "url": "https://files.pythonhosted.org/packages/b6/d0/21937f0dfe5a2d530e50a6a7e7aff7c340afdf2162dcada13668341f98ff/torch_eunn-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ec2f5195548fa1d9af8358cfc2da0edc", "sha256": "bb69a641aaf8aad6b3503e1e4f7a50f28e0f7fc9101a11fac9646974d15ad215" }, "downloads": -1, "filename": "torch_eunn-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ec2f5195548fa1d9af8358cfc2da0edc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4838, "upload_time": "2018-09-20T10:46:16", "url": "https://files.pythonhosted.org/packages/d6/b8/3b366518aa5c934509eabbe5548b09fe9178ab7e92acc0156c2a91d0e85d/torch_eunn-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c06e87d07efe2be2b51d89b16fe894eb", "sha256": "fd7cbd019ddf0fd2db620b6d46f34cd249cad58e41a5174e49e8ec428c6f6f09" }, "downloads": -1, "filename": "torch_eunn-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c06e87d07efe2be2b51d89b16fe894eb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6806, "upload_time": "2019-01-14T09:23:09", "url": "https://files.pythonhosted.org/packages/89/3d/a3a64957a7e3344b33cb2f1c84cebdf875171ed9e63ec18246eb6a1bc7e9/torch_eunn-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70c86816ab3a3be270d78dd6cf67bae4", "sha256": "a7a83ee7dbdc0606082d11fd511437c4f7e5b215766597395cdca8a897c8d2e1" }, "downloads": -1, "filename": "torch_eunn-0.2.0.tar.gz", "has_sig": false, "md5_digest": "70c86816ab3a3be270d78dd6cf67bae4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5498, "upload_time": "2019-01-14T09:23:11", "url": "https://files.pythonhosted.org/packages/14/2b/f28ab3eea55e0fcf4b6a877ea835f1a893ee7e55b1247c9112df4e97b378/torch_eunn-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c06e87d07efe2be2b51d89b16fe894eb", "sha256": "fd7cbd019ddf0fd2db620b6d46f34cd249cad58e41a5174e49e8ec428c6f6f09" }, "downloads": -1, "filename": "torch_eunn-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c06e87d07efe2be2b51d89b16fe894eb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6806, "upload_time": "2019-01-14T09:23:09", "url": "https://files.pythonhosted.org/packages/89/3d/a3a64957a7e3344b33cb2f1c84cebdf875171ed9e63ec18246eb6a1bc7e9/torch_eunn-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70c86816ab3a3be270d78dd6cf67bae4", "sha256": "a7a83ee7dbdc0606082d11fd511437c4f7e5b215766597395cdca8a897c8d2e1" }, "downloads": -1, "filename": "torch_eunn-0.2.0.tar.gz", "has_sig": false, "md5_digest": "70c86816ab3a3be270d78dd6cf67bae4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5498, "upload_time": "2019-01-14T09:23:11", "url": "https://files.pythonhosted.org/packages/14/2b/f28ab3eea55e0fcf4b6a877ea835f1a893ee7e55b1247c9112df4e97b378/torch_eunn-0.2.0.tar.gz" } ] }