{"id":37084465,"url":"https://github.com/benoitmartin88/pytorchtrainer","last_synced_at":"2026-01-14T10:20:16.931Z","repository":{"id":57457955,"uuid":"190197781","full_name":"benoitmartin88/pytorchtrainer","owner":"benoitmartin88","description":"Train your PyTorch model without having to write the boring code","archived":false,"fork":false,"pushed_at":"2019-10-10T15:13:32.000Z","size":94,"stargazers_count":16,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-07T02:41:19.097Z","etag":null,"topics":["deep-learning","python","pytorch"],"latest_commit_sha":null,"homepage":"","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/benoitmartin88.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-04T12:34:24.000Z","updated_at":"2022-12-29T01:00:29.000Z","dependencies_parsed_at":"2022-09-07T03:41:28.737Z","dependency_job_id":null,"html_url":"https://github.com/benoitmartin88/pytorchtrainer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/benoitmartin88/pytorchtrainer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitmartin88%2Fpytorchtrainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitmartin88%2Fpytorchtrainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitmartin88%2Fpytorchtrainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitmartin88%2Fpytorchtrainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitmartin88","download_url":"https://codeload.github.com/benoitmartin88/pytorchtrainer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitmartin88%2Fpytorchtrainer/sbom","scorecard":{"id":233510,"data":{"date":"2025-08-11","repo":{"name":"github.com/benoitmartin88/pytorchtrainer","commit":"7d73acd0802e00c3589d28bce6c42a489dcd46ea"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 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":"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":"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":"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":"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":"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: 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":-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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 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-17T05:13:26.882Z","repository_id":57457955,"created_at":"2025-08-17T05:13:26.882Z","updated_at":"2025-08-17T05:13:26.882Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:18:03.274Z","status":"ssl_error","status_checked_at":"2026-01-14T10:16:11.865Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["deep-learning","python","pytorch"],"created_at":"2026-01-14T10:20:16.346Z","updated_at":"2026-01-14T10:20:16.926Z","avatar_url":"https://github.com/benoitmartin88.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch trainer\n\n[![CircleCI](https://circleci.com/gh/benoitmartin88/pytorchtrainer/tree/master.svg?style=svg)](https://circleci.com/gh/benoitmartin88/pytorchtrainer/tree/master)\n\nAre you tired of writing those same epoch and data-loader loops to train your PyTorch module ?\nLook no further, PyTorch trainer is a library that hides all those boring training lines of code that should be native to PyTorch. \n\nYou will also benefit from the following features:\n\n- Early stopping: stop training after a period of stagnation\n- Checkpointing: save model and estimator at regular intervals\n- CSV file writer to output logs\n- Several metrics are available: all default PyTorch loss functions, Accuracy, MAE\n- Progress bar from console\n- SIGINT handling: handle CTRL-C\n- Model's data type (`float32`, `float64`) \n\n\n## Example\n\nCode examples can be found in the [example folder](https://github.com/benoitmartin88/pytorchtrainer/tree/master/examples).\n\nHere is a simple example:\n\n``` python\n\nimport torch\nimport pytorchtrainer as ptt\n\n\n# Your usual model, optimizer, loss function and data loaders\nmodel = MyModel()\noptimizer = torch.optim.Adam(self.model.parameters(), lr=1e-3)\ncriterion = torch.nn.MSELoss()\ntrain_loader = MyTrainDataloader()\nvalidation_loader = MyValidationDataloader()\n\n\n# instantiate a default trainer\ntrainer = ptt.create_default_trainer(model, optimizer, criterion)\n\n# optionally save a checkpoint after every 10 epochs\ntrainer.register_post_epoch_callback(ptt.checkpoint.SaveCheckpointCallback(save_every=10))\n\n# optionally compute validation loss after every epoch\nvalidation_callback = ptt.callback.ValidationCallback(validation_loader, ptt.metric.TorchLoss(criterion), validate_every=1)\ntrainer.register_post_epoch_callback(validation_callback)\n\n# optionally save training and validation loss after every iteration using default save directory\ntrainer.register_post_iteration_callback(ptt.callback.CsvWriter(save_every=1,\n                                                                extra_header=[validation_callback.state_attribute_name],\n                                                                callback=lambda state: [state.get(validation_callback.state_attribute_name)]))\n# run the training\ntrainer.train(train_loader, max_epochs=100)\n\n```\n\n## Dependencies\n\n- python \u003e 3.5\n- pytorch \u003e 1.0.0 (install instructions from the official [PyTorch website](https://pytorch.org/get-started/locally))\n\n\n## Contributing\n\nFeel free to submit an issue or pull request. But before you do please read the [contributing guidelines](CONTRIBUTING.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitmartin88%2Fpytorchtrainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitmartin88%2Fpytorchtrainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitmartin88%2Fpytorchtrainer/lists"}