{"id":15037022,"url":"https://github.com/torchensemble-community/ensemble-pytorch","last_synced_at":"2025-12-14T20:07:36.921Z","repository":{"id":38538043,"uuid":"207798725","full_name":"TorchEnsemble-Community/Ensemble-Pytorch","owner":"TorchEnsemble-Community","description":"A unified ensemble framework for PyTorch to improve the performance and robustness of your deep learning model.","archived":false,"fork":false,"pushed_at":"2024-06-16T13:18:31.000Z","size":1637,"stargazers_count":1020,"open_issues_count":33,"forks_count":94,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-15T07:02:51.317Z","etag":null,"topics":["bagging","deep-learning","deeplearning","ensemble","ensemble-learning","gradient-boosting","neural-networks","pytorch","pytorch-tutorial","voting-classifier"],"latest_commit_sha":null,"homepage":"https://ensemble-pytorch.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TorchEnsemble-Community.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.rst","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-11T11:44:58.000Z","updated_at":"2025-05-01T12:40:57.000Z","dependencies_parsed_at":"2023-02-15T07:20:51.319Z","dependency_job_id":"8d6b1dfa-ee8f-4b6e-8260-b02df59736d0","html_url":"https://github.com/TorchEnsemble-Community/Ensemble-Pytorch","commit_stats":{"total_commits":378,"total_committers":15,"mean_commits":25.2,"dds":"0.16402116402116407","last_synced_commit":"68723b045e9a1feed039964bffb78ad9ca07660b"},"previous_names":["aaronx121/ensemble-pytorch"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorchEnsemble-Community%2FEnsemble-Pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorchEnsemble-Community%2FEnsemble-Pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorchEnsemble-Community%2FEnsemble-Pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorchEnsemble-Community%2FEnsemble-Pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TorchEnsemble-Community","download_url":"https://codeload.github.com/TorchEnsemble-Community/Ensemble-Pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291961,"owners_count":22046424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bagging","deep-learning","deeplearning","ensemble","ensemble-learning","gradient-boosting","neural-networks","pytorch","pytorch-tutorial","voting-classifier"],"created_at":"2024-09-24T20:33:04.498Z","updated_at":"2025-12-14T20:07:31.529Z","avatar_url":"https://github.com/TorchEnsemble-Community.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: ./docs/_images/badge_small.png\n\n|github|_ |readthedocs|_ |codecov|_ |license|_\n\n.. |github| image:: https://github.com/TorchEnsemble-Community/Ensemble-Pytorch/workflows/torchensemble-CI/badge.svg\n.. _github: https://github.com/TorchEnsemble-Community/Ensemble-Pytorch/actions\n\n.. |readthedocs| image:: https://readthedocs.org/projects/ensemble-pytorch/badge/?version=latest\n.. _readthedocs: https://ensemble-pytorch.readthedocs.io/en/latest/index.html\n\n.. |codecov| image:: https://codecov.io/gh/TorchEnsemble-Community/Ensemble-Pytorch/branch/master/graph/badge.svg?token=2FXCFRIDTV\n.. _codecov: https://codecov.io/gh/TorchEnsemble-Community/Ensemble-Pytorch\n\n.. |license| image:: https://img.shields.io/github/license/TorchEnsemble-Community/Ensemble-Pytorch\n.. _license: https://github.com/TorchEnsemble-Community/Ensemble-Pytorch/blob/master/LICENSE\n\nEnsemble PyTorch\n================\n\nA unified ensemble framework for pytorch_ to easily improve the performance and robustness of your deep learning model. Ensemble-PyTorch is part of the `pytorch ecosystem \u003chttps://pytorch.org/ecosystem/\u003e`__, which requires the project to be well maintained.\n\n* `Document \u003chttps://ensemble-pytorch.readthedocs.io/\u003e`__\n* `Experiment \u003chttps://ensemble-pytorch.readthedocs.io/en/stable/experiment.html\u003e`__\n\nInstallation\n------------\n\n.. code:: bash\n\n    pip install torchensemble\n\nExample\n-------\n\n.. code:: python\n\n    from torchensemble import VotingClassifier  # voting is a classic ensemble strategy\n\n    # Load data\n    train_loader = DataLoader(...)\n    test_loader = DataLoader(...)\n\n    # Define the ensemble\n    ensemble = VotingClassifier(\n        estimator=base_estimator,               # estimator is your pytorch model\n        n_estimators=10,                        # number of base estimators\n    )\n\n    # Set the optimizer\n    ensemble.set_optimizer(\n        \"Adam\",                                 # type of parameter optimizer\n        lr=learning_rate,                       # learning rate of parameter optimizer\n        weight_decay=weight_decay,              # weight decay of parameter optimizer\n    )\n    \n    # Set the learning rate scheduler\n    ensemble.set_scheduler(\n        \"CosineAnnealingLR\",                    # type of learning rate scheduler\n        T_max=epochs,                           # additional arguments on the scheduler\n    )\n\n    # Train the ensemble\n    ensemble.fit(\n        train_loader,\n        epochs=epochs,                          # number of training epochs\n    )\n\n    # Evaluate the ensemble\n    acc = ensemble.evaluate(test_loader)         # testing accuracy\n\nSupported Ensemble\n------------------\n\n+------------------------------+------------+---------------------------+-----------------------------+\n|       **Ensemble Name**      |  **Type**  |      **Source Code**      |          **Problem**        |\n+==============================+============+===========================+=============================+\n|            Fusion            |    Mixed   |         fusion.py         | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|          Voting [1]_         |  Parallel  |         voting.py         | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|         Neural Forest        |  Parallel  |         voting.py         | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|         Bagging [2]_         |  Parallel  |         bagging.py        | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|    Gradient Boosting [3]_    | Sequential |    gradient_boosting.py   | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|    Snapshot Ensemble [4]_    | Sequential |    snapshot_ensemble.py   | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|   Adversarial Training [5]_  |  Parallel  |  adversarial_training.py  | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n| Fast Geometric Ensemble [6]_ | Sequential |     fast_geometric.py     | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n|  Soft Gradient Boosting [7]_ |  Parallel  | soft_gradient_boosting.py | Classification / Regression |\n+------------------------------+------------+---------------------------+-----------------------------+\n\nDependencies\n------------\n\n-  scikit-learn\u003e=0.23.0\n-  torch\u003e=1.4.0\n-  torchvision\u003e=0.2.2\n\nReference\n---------\n\n.. [1] Zhou, Zhi-Hua. Ensemble Methods: Foundations and Algorithms. CRC press, 2012.\n\n.. [2] Breiman, Leo. Bagging Predictors. Machine Learning (1996): 123-140.\n\n.. [3] Friedman, Jerome H. Greedy Function Approximation: A Gradient Boosting Machine. Annals of Statistics (2001): 1189-1232.\n\n.. [4] Huang, Gao, et al. Snapshot Ensembles: Train 1, Get M For Free. ICLR, 2017.\n\n.. [5] Lakshminarayanan, Balaji, et al. Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles. NIPS, 2017.\n\n.. [6] Garipov, Timur, et al. Loss Surfaces, Mode Connectivity, and Fast Ensembling of DNNs. NeurIPS, 2018.\n\n.. [7] Feng, Ji, et al. Soft Gradient Boosting Machine. ArXiv, 2020.\n\n.. _pytorch: https://pytorch.org/\n\n.. _pypi: https://pypi.org/project/torchensemble/\n\nThanks to all our contributors\n------------------------------\n\n|contributors|\n\n.. |contributors| image:: https://contributors-img.web.app/image?repo=TorchEnsemble-Community/Ensemble-Pytorch\n.. _contributors: https://github.com/TorchEnsemble-Community/Ensemble-Pytorch/graphs/contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorchensemble-community%2Fensemble-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorchensemble-community%2Fensemble-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorchensemble-community%2Fensemble-pytorch/lists"}