{"id":18508861,"url":"https://github.com/flaport/torch_eunn","last_synced_at":"2026-03-10T22:02:39.117Z","repository":{"id":57476490,"uuid":"142434482","full_name":"flaport/torch_eunn","owner":"flaport","description":"A Pytorch implementation of an efficient unitary neural network (https://arxiv.org/abs/1612.05231)","archived":false,"fork":false,"pushed_at":"2020-08-03T12:47:44.000Z","size":72,"stargazers_count":33,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-29T00:54:08.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flaport.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-26T11:55:39.000Z","updated_at":"2024-11-18T17:41:39.000Z","dependencies_parsed_at":"2022-09-12T14:33:50.400Z","dependency_job_id":null,"html_url":"https://github.com/flaport/torch_eunn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flaport/torch_eunn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Ftorch_eunn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Ftorch_eunn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Ftorch_eunn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Ftorch_eunn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flaport","download_url":"https://codeload.github.com/flaport/torch_eunn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Ftorch_eunn/sbom","scorecard":{"id":402581,"data":{"date":"2025-08-11","repo":{"name":"github.com/flaport/torch_eunn","commit":"ea337ec97a805551a5772efd618b9cdeba420c08"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T20:24:40.753Z","repository_id":57476490,"created_at":"2025-08-18T20:24:40.753Z","updated_at":"2025-08-18T20:24:40.753Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30357614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T15:15:39.013Z","updated_at":"2026-03-10T22:02:39.102Z","avatar_url":"https://github.com/flaport.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# torch_eunn\n\nThis repository contains a simple PyTorch implementation of a Tunable\nEfficient Unitary Neural Network (EUNN) Cell.\n\nThe implementation is loosely based on the tunable EUNN presented in\nthis paper:\n[https://arxiv.org/abs/1612.05231](https://arxiv.org/abs/1612.05231).\n\n## Installation\n\n```\n    pip install torch_eunn\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\n\nThe `hidden_size` of the EUNN needs to be **_even_**, as explained in\nthe 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## Requirements\n\n- [PyTorch](http://pytorch.org) \u003e= 0.4.0: `conda install pytorch -c pytorch`\n\n## Difference with original implementation\n\nThis implementation of the EUNN has a major difference with the\noriginal implementation proposed in\n[https://arxiv.org/abs/1612.05231](https://arxiv.org/abs/1612.05231),\nwhich is outlined below.\n\nIn the original implementation, the first output of the top mixing\nunit of a capacity-2 sublayer skips the second layer of mixing units\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,\nwhere the first layer of the capacity-2 sublayer is skipped. This way,\na `(2*n+1)`-dimensional unitary matrix representation is created, with\n`n` the number of mixing units in each capacity-1 sublayer.\n\n```\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\nhave `N-1` parameters (each mixing unit has 2 parameters). Thus to\nhave a unitary matrix representation which spans the full unitary\nspace, one needs `N` capacity-1 layers **_and_** `N` _extra_ phases\nappended to the back of the capacity-`N` sublayer to bring the total\nnumber of parameters in the unitary-matrix representation to `N**2`\n(the total number of independent parameters in a unitary matrix).\n\nIn the implementation proposed here, the dots in each capacity-2\nsublayer are connected onto themselves (periodic boundaries). This has\nthe implication that for each capacity-1 sublayer with `n` mixing\nunits, there are `N=2*n` inputs and as many independent parameters.\nThis means that we just need `N` capacity-1 sublayers and **no**\n_extra_ phases to span the full unitary space with `N` parameters.\n\nThis, however, has the implication that the `hidden_size = N = 2*n` of\nthe unitary matrix should always be _even_. Moreover, this periodic\nboundary representation removes the physical interpretability, where\nthe mixing units can for example be represented by Mach Zehnder\nintereferometers, as physically, it's practically infeasible to make\nconnections from the top of the mesh to the bottom of the mesh.\nHowever, from a purely Machine Learning point of view, the\nrepresentation used here is _more stable_ and _converges faster_.\n\n## License\n\n© Floris Laporte, MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaport%2Ftorch_eunn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaport%2Ftorch_eunn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaport%2Ftorch_eunn/lists"}