{"id":37085224,"url":"https://github.com/jsalbert/biotorch","last_synced_at":"2026-01-14T10:28:36.489Z","repository":{"id":46689041,"uuid":"356718473","full_name":"jsalbert/biotorch","owner":"jsalbert","description":"BioTorch is a PyTorch framework specializing in biologically plausible learning algorithms","archived":false,"fork":false,"pushed_at":"2024-03-05T16:50:29.000Z","size":34611,"stargazers_count":51,"open_issues_count":3,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T08:27:07.828Z","etag":null,"topics":["biologically-inspired-algorithm","biologically-plausible-learning","deep-learning","feedback-alignment","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsalbert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-10T23:12:04.000Z","updated_at":"2025-07-25T09:28:50.000Z","dependencies_parsed_at":"2024-11-16T03:27:19.889Z","dependency_job_id":"d1c04bb5-6c15-40a4-abd5-6acab4d89332","html_url":"https://github.com/jsalbert/biotorch","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"74fad0dd32529e754e4bba8298d4e0fd0a06a886"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jsalbert/biotorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsalbert%2Fbiotorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsalbert%2Fbiotorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsalbert%2Fbiotorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsalbert%2Fbiotorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsalbert","download_url":"https://codeload.github.com/jsalbert/biotorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsalbert%2Fbiotorch/sbom","scorecard":{"id":537532,"data":{"date":"2025-08-11","repo":{"name":"github.com/jsalbert/biotorch","commit":"6d80d2245d99066ad25fdf65a8851a4ef7070c77"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/9 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":"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":"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":"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":"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":"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":"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: Apache License 2.0: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: pipCommand not pinned by hash: script/setup:5","Warn: pipCommand not pinned by hash: script/setup:6","Warn: pipCommand not pinned by hash: script/test:14","Info:   0 out of   3 pipCommand dependencies pinned"],"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":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2013-22 / GHSA-27x4-j476-jp5f","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: PYSEC-2022-43012 / GHSA-r9hx-vwmv-q579"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T07:21:59.979Z","repository_id":46689041,"created_at":"2025-08-20T07:21:59.979Z","updated_at":"2025-08-20T07:21:59.979Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"last_error":"SSL_read: 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":["biologically-inspired-algorithm","biologically-plausible-learning","deep-learning","feedback-alignment","pytorch"],"created_at":"2026-01-14T10:28:35.736Z","updated_at":"2026-01-14T10:28:36.483Z","avatar_url":"https://github.com/jsalbert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003e\n    \u003cimg width=\"580\" alt=\"BioTorch\" src=\"https://user-images.githubusercontent.com/17982112/121555300-2e01ee80-ca13-11eb-878d-a0f7e8b20401.png\"\u003e\n\u003c/h3\u003e\n\n\u003ch3 align=\"center\"\u003e\n    \u003cp\u003eBioTorch is a PyTorch framework specializing in biologically plausible learning algorithms\u003c/p\u003e\n\u003c/h3\u003e\n\n---\n[![Build Status](https://app.travis-ci.com/jsalbert/biotorch.svg?token=961VyHzz93LuqWShsXDX\u0026branch=main)](https://app.travis-ci.com/jsalbert/biotorch)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n\nBioTorch Provides:\n\n🧠 \u0026nbsp; Implementations of layers, models and biologically-motivated learning algorithms. It allows to load existing state-of-the-art models, easy creation of custom models and automatic conversion of existing models.\n\n🧠 \u0026nbsp; A framework to train, evaluate and benchmark different biologically plausible learning algorithms in a selection of datasets. It is focused on the principles of PyTorch design and research reproducibility. Configuration files that include the choice of a fixed seed and deterministic math and CUDA operations are provided. \n\n🧠 \u0026nbsp; A place of colaboration, ideas sharing and discussion.  \n\n## Methods Supported\n\n### Feedback Alignment \n\n| Name  | Mode | Official Implementations|\n| :---:         |     :---:      | :---:      |\n| [Feedback Alignment](https://arxiv.org/abs/1411.0247)    | `'fa'`     | N/A |\n| [Direct Feedback Alignment](https://arxiv.org/abs/1609.01596)    |   `'dfa'`     |[[Torch]](https://github.com/anokland/dfa-torch) |\n| [Sign Symmetry](https://arxiv.org/pdf/1510.05067.pdf) | `['usf', 'brsf', 'frsf']`  | [[PyTorch]](https://github.com/willwx/sign-symmetry)|\n\n## Metrics Supported\n\nLayer Weight Alignment            |  Layer Weight Norm Ratio\n:-------------------------:|:-------------------------:\n![angles_adam](https://github.com/jsalbert/biotorch/blob/main/figures/fa_angles_resnet_56_adam.png?raw=true)  |  ![weight_norm](https://github.com/jsalbert/biotorch/blob/main/figures/fa_weights_resnet_56_adam.png?raw=true)\n\n\n## Quick Tour\n\n### Create a Feedback Aligment (FA) ResNet-18 model\n\n```python\nfrom biotorch.models.fa import resnet18\nmodel = resnet18()\n```\n\n### Create a custom model with uSF layers\n\n```python\nimport torch.nn.functional as F\nfrom biotorch.layers.usf import Conv2d, Linear\n\nclass Model(nn.Module):\n  def __init__(self):\n    super(Model, self).__init__()\n    self.conv1 = Conv2d(in_channels=64, out_channels=128, kernel_size=3)\n    self.fc = Linear(in_features=256, out_features=10)\n\n  def forward(self, x):\n    out = F.relu(self.conv1(x))\n    out = F.avg_pool2d(out, out.size()[3])\n    return self.fc(out)\n    \nmodel = Model()\n```\n\n### Automatically convert AlexNet to use the \"frSF\" algorithm\n\n```python\nfrom torchvision.models import alexnet\nfrom biotorch.module.biomodule import BioModule\n\nmodel = BioModule(module=alexnet(), mode='frsf')\n```\n\n### Run an experiment on the command line\n\n```bash\npython benchmark.py --config benchmark_configs/mnist/fa.yaml\n```\n\nIf you want the experiment to be reproducible, check that you have specified a seed and the parameter `deterministic`is set to true in the configuration file yaml. That will apply all the [PyTorch reproducibility steps](https://pytorch.org/docs/stable/notes/randomness.html). \nIf you are running your experiment on GPU add the extra environment variable [CUBLAS_WORKSPACE_CONFIG](https://docs.nvidia.com/cuda/cublas/index.html#cublasApi_reproducibility).\n\n```bash\nCUBLAS_WORKSPACE_CONFIG=:4096:8 python benchmark.py --config benchmark_configs/mnist/fa.yaml\n```\n\nClick [here](https://github.com/jsalbert/biotorch/blob/main/configuration_file.md) to learn more about the configuration file API. \n\n\n### Run an experiment on a Colab Notebook\n\n- [Benchmark with configuration file](https://github.com/jsalbert/biotorch/blob/main/notebooks/accuracy_benchmark/benchmark_with_config.ipynb)\n\n- [Benchmark with custom model](https://github.com/jsalbert/biotorch/blob/main/notebooks/accuracy_benchmark/benchmark_custom_model.ipynb)\n\n- [Plot alignment metrics](https://github.com/jsalbert/biotorch/blob/main/notebooks/accuracy_benchmark/metrics_visualizations.ipynb)\n\n\n## Installation\n\nWe are hosted in [PyPI](https://pypi.org/), you can install the library using pip:\n\n```bash\npip install biotorch\n```\n\nOr from source:\n\n```bash\ngit clone https://github.com/jsalbert/biotorch.git\ncd biotorch\nscript/setup\n```\n\n## Benchmarks\n\n[MNIST](https://github.com/jsalbert/biotorch/blob/main/Benchmarks.md#mnist--fashion-mnist)\n\n[CIFAR-10](https://github.com/jsalbert/biotorch/blob/main/Benchmarks.md#cifar-10)\n\n[ImageNet](https://github.com/jsalbert/biotorch/blob/main/Benchmarks.md#cifar-10)\n\n## Contributing\n\nIf you want to contribute to the project please read the [CONTRIBUTING](https://github.com/jsalbert/biotorch/blob/main/CONTRIBUTING.md) section. If you found any bug please don't hesitate to comment in the [Issues](https://github.com/jsalbert/biotorch/issues) section.\n\n## Related paper: Benchmarking the Accuracy and Robustness of Feedback Alignment Algorithms\n##### Albert Jiménez Sanfiz, Mohamed Akrout\nBackpropagation is the default algorithm for training deep neural networks due to its simplicity, efficiency and high convergence rate. However, its requirements make it impossible to be implemented in a human brain. In recent years, more biologically plausible learning methods have been proposed. Some of these methods can match backpropagation accuracy, and simultaneously provide other extra benefits such as faster training on specialized hardware (e.g., ASICs) or higher robustness against adversarial attacks. While the interest in the field is growing, there is a necessity for open-source libraries and toolkits to foster research and benchmark algorithms. In this paper, we present BioTorch, a software framework to create, train, and benchmark biologically motivated neural networks. In addition, we investigate the performance of several feedback alignment methods proposed in the literature, thereby unveiling the importance of the forward and backward weight initialization and optimizer choice. Finally, we provide a novel robustness study of these methods against state-of-the-art white and black-box adversarial attacks.\n\n[Preprint here](https://arxiv.org/abs/2108.13446), feedback welcome! \n\nContact: albertjimenez.work@gmail.com\n\nIf you use our code in your research, you can cite our paper:\n\n```\n@misc{sanfiz2021benchmarking,\n      title={Benchmarking the Accuracy and Robustness of Feedback Alignment Algorithms},\n      author={Albert Jiménez Sanfiz and Mohamed Akrout},\n      year={2021},\n      eprint={2108.13446},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsalbert%2Fbiotorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsalbert%2Fbiotorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsalbert%2Fbiotorch/lists"}