{"id":13806732,"url":"https://github.com/n2cholas/jax-resnet","last_synced_at":"2026-01-16T11:48:07.491Z","repository":{"id":38377993,"uuid":"325201910","full_name":"n2cholas/jax-resnet","owner":"n2cholas","description":"Implementations and checkpoints for ResNet, Wide ResNet, ResNeXt, ResNet-D, and ResNeSt in JAX (Flax).","archived":false,"fork":false,"pushed_at":"2022-06-05T23:48:39.000Z","size":51,"stargazers_count":112,"open_issues_count":4,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-20T13:43:48.207Z","etag":null,"topics":["computer-vision","deep-learning","flax","jax","machine-learning","neural-networks","resnet"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/jax-resnet/","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/n2cholas.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":"2020-12-29T06:10:33.000Z","updated_at":"2025-06-23T07:36:39.000Z","dependencies_parsed_at":"2022-08-25T02:12:23.649Z","dependency_job_id":null,"html_url":"https://github.com/n2cholas/jax-resnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/n2cholas/jax-resnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2cholas%2Fjax-resnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2cholas%2Fjax-resnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2cholas%2Fjax-resnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2cholas%2Fjax-resnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n2cholas","download_url":"https://codeload.github.com/n2cholas/jax-resnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2cholas%2Fjax-resnet/sbom","scorecard":{"id":672058,"data":{"date":"2025-08-11","repo":{"name":"github.com/n2cholas/jax-resnet","commit":"5b00735aa0a68ec239af4a728ad4a596c1b551f6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 1/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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Info: no jobLevel write permissions found"],"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":10,"reason":"no dangerous workflow patterns detected","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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/n2cholas/jax-resnet/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/n2cholas/jax-resnet/python-package.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:31","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 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":"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":"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":"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":"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 'main'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T20:27:17.506Z","repository_id":38377993,"created_at":"2025-08-21T20:27:17.506Z","updated_at":"2025-08-21T20:27:17.506Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","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":["computer-vision","deep-learning","flax","jax","machine-learning","neural-networks","resnet"],"created_at":"2024-08-04T01:01:15.380Z","updated_at":"2026-01-16T11:48:07.460Z","avatar_url":"https://github.com/n2cholas.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["New Libraries"],"readme":"# JAX ResNet - Implementations and Checkpoints for ResNet Variants\n\n![Build \u0026 Tests](https://github.com/n2cholas/jax-resnet/workflows/Build%20and%20Tests/badge.svg)\n\nA Flax (Linen) implementation of ResNet (He et al. 2015), Wide ResNet\n(Zagoruyko \u0026 Komodakis 2016), ResNeXt (Xie et al. 2017), ResNet-D (He et al.\n2020), and ResNeSt (Zhang et al. 2020). The code is modular so you can mix and\nmatch the various stem, residual, and bottleneck implementations.\n\n## Installation\n\nYou can install this package from PyPI:\n\n```sh\npip install jax-resnet\n```\n\nOr directly from GitHub:\n\n```sh\npip install --upgrade git+https://github.com/n2cholas/jax-resnet.git\n```\n\n## Usage\n\nSee the bottom of `jax-resnet/resnet.py` for the available aliases/options for\nthe ResNet variants (all models are in [Flax](https://github.com/google/flax))\n\nPretrained checkpoints from\n[`torch.hub`](https://pytorch.org/docs/stable/hub.html) are available for the\nfollowing networks:\n\n- ResNet [18, 34, 50, 101, 152]\n- WideResNet [50, 101]\n- ResNeXt [50, 101]\n- ResNeSt [50-Fast, 50, 101, 200, 269]\n\nThe models are\n[tested](https://github.com/n2cholas/jax-resnet/blob/main/tests/test_pretrained.py)\nto have the same intermediate activations and outputs as the `torch.hub`\nimplementations, except ResNeSt-50 Fast, whose activations don't match exactly\nbut the final accuracy does.\n\nA pretrained checkpoint for ResNetD-50 is available from\n[fast.ai](https://github.com/fastai/fastai).\nThe activations do not match exactly, but the final accuracy matches.\n\n```python\nimport jax.numpy as jnp\nfrom jax_resnet import pretrained_resnest\n\nResNeSt50, variables = pretrained_resnest(50)\nmodel = ResNeSt50()\nout = model.apply(variables,\n                  jnp.ones((32, 224, 224, 3)),  # ImageNet sized inputs.\n                  mutable=False)  # Ensure `batch_stats` aren't updated.\n```\n\nYou must install PyTorch yourself\n([instructions](https://pytorch.org/get-started/locally/)) to use these\nfunctions.\n\n### Transfer Learning\n\nTo extract a subset of the model, you can use\n`Sequential(model.layers[start:end])`.\n\nThe `slice_variables` function (found in in\n[`common.py`](https://github.com/n2cholas/jax-resnet/blob/main/jax_resnet/common.py))\nallows you to extract the corresponding subset of the variables dict. Check out\nthat docstring for more information.\n\n## Checkpoint Accuracies\n\nThe top 1 and top 5 accuracies reported below are on the ImageNet2012\nvalidation split.  The data was preprocessed as in the official [PyTorch\nexample](https://github.com/pytorch/examples/blob/master/imagenet/main.py).\n\n|Model       | Size | Top 1 | Top 5 |\n|------------|-----:|------:|------:|\n|ResNet      |    18| 69.75%| 89.06%|\n|            |    34| 73.29%| 91.42%|\n|            |    50| 76.13%| 92.86%|\n|            |   101| 77.37%| 93.53%|\n|            |   152| 78.30%| 94.04%|\n|Wide ResNet |    50| 78.48%| 94.08%|\n|            |   101| 78.88%| 94.29%|\n|ResNeXt     |    50| 77.60%| 93.70%|\n|            |   101| 79.30%| 94.51%|\n|ResNet-D    |    50| 77.57%| 93.85%|\n\u003c!--\n|ResNeSt |    50| 80.97%| 95.38%|\n|        |   101| 82.17%| 95.97%|\n|        |   200| 82.35%| 96.11%|\n|        |   269| 79.19%| 94.53%|\n--\u003e\n\nThe ResNeSt validation data was preprocessed as in\n[zhang1989/ResNeSt](https://github.com/zhanghang1989/ResNeSt/blob/master/scripts/torch/verify.py).\n\n|Model        | Size | Crop Size | Top 1 | Top 5 |\n|-------------|-----:|----------:|------:|------:|\n|ResNeSt-Fast |    50|        224| 80.53%| 95.34%|\n|ResNeSt      |    50|        224| 81.05%| 95.42%|\n|             |   101|        256| 82.82%| 96.32%|\n|             |   200|        320| 83.84%| 96.86%|\n|             |   269|        416| 84.53%| 96.98%|\n\n## References\n\n- [Deep Residual Learning for Image Recognition. Kaiming He, Xiangyu Zhang,\n  Shaoqing Ren, Jian Sun. _arXiv 2015_.](https://arxiv.org/abs/1512.03385)\n- [Wide Residual Networks. Sergey Zagoruyko, Nikos Komodakis. _BMVC\n  2016_](https://arxiv.org/abs/1605.07146)\n- [Aggregated Residual Transformations for Deep Neural Networks. Saining Xie,\n  Ross Girshick, Piotr Dollár, Zhuowen Tu, Kaiming He. _CVPR\n  2017_.](https://arxiv.org/abs/1611.05431)\n- [Bag of Tricks for Image Classification with Convolutional Neural Networks.\n  Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, Mu Li. _CVPR\n  2019_.](https://arxiv.org/abs/1812.01187)\n- [ResNeSt: Split-Attention Networks. Hang Zhang, Chongruo Wu, Zhongyue Zhang,\n  Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Mueller, R. Manmatha,\n  Mu Li, Alexander Smola. _arXiv 2020_.](https://arxiv.org/abs/2004.08955)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn2cholas%2Fjax-resnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn2cholas%2Fjax-resnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn2cholas%2Fjax-resnet/lists"}