<div align="center">
<img src="https://raw.githubusercontent.com/TorchEI/TorchEI/main/assets/torchei.svg" alt="torchei_logo" align="center" style="width:30%;" />
</div>
<h1 style = "margin:0;" align="center">TorchEI⚡</h1>
<div align = "center" style="font-weight: bold;"><a href="#introduction">Intro</a> ● <a href="#quick-example">Usage</a> ● <a href="https://TorchEI.github.com.io/TorchEI/">Doc</a> ● <a href="#citation">Cite</a> ● <a href="#contribution" >Contribution</a> ● <a href="#license">License</a></div>
------
<div align = "center">
<a href = "https://github.com/TorchEI/TorchEI/actions/workflows/pytest-cov.yml">
<img src="https://github.com/TorchEI/TorchEI/actions/workflows/pytest-cov.yml/badge.svg"/></a>
<a href = "https://github.com/TorchEI/TorchEI/actions/workflows/doc-deploy.yml">
<img src="https://github.com/TorchEI/TorchEI/actions/workflows/doc-deploy.yml/badge.svg"/></a>
<a href="https://codecov.io/gh/TorchEI/TorchEI" >
<img src="https://codecov.io/gh/TorchEI/TorchEI/branch/main/graph/badge.svg?token=0ADLQFHLCJ"/></a>
<a href="https://www.codacy.com/gh/TorchEI/TorchEI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=TorchEI/TorchEI&utm_campaign=Badge_Grade">
<img src="https://app.codacy.com/project/badge/Grade/c4067d004b934d49bb4386b650c57808"/></a>
<a href="https://pypi.org/project/torchei/" target=”_blank”>
<img src="https://img.shields.io/pypi/v/torchei" alt="Pypi"></a>
<a href="https://pypi.org/project/torchei/" target=”_blank”>
<img src="https://pepy.tech/badge/torchei"/></a>
<a href="#license">
<img src="https://img.shields.io/github/license/torchei/torchei" alt="License"></a>
</div>
[中文](./README-zh.md)
## Introduction
👋TorchEI, pronounced*/ˈtôrCHər/*(like torture), short for Pytorch Error Injection, is a high-speed toolbox for DNN Reliability's Research and Development. TorchEI enables you quickly and simply inject errors into DNN, collects information you needed, and harden your DNN.
## Features
- Full typing system supported
- Implemented methods from papers
- Highly customizable
## Quick Example
Here we gonna show you a quick example, or you can try [interactive demo](https://colab.research.google.com/github/TorchEI/TorchEI/blob/main/example.ipynb) and [online editor](https://github.dev/TorchEI/TorchEI).
#### Installing
Install public distribution using `pip3 install torchei` or [download](https://github.com/TorchEI/TorchEI/archive/refs/heads/main.zip) it.
#### Example
Init fault model
```python
import torch
from torchvision import models
import torchei
model = models.resnet18(pretrained=True)
data = torch.load('data/ilsvrc_valid8.pt')
fault_model = torchei.fault_model(model,data)
```
Calc reliability using emat method
```python
fault_model.emat_attack(10,1e-3)
```
Calc reliability using [SERN](https://dl.acm.org/doi/abs/10.1145/3386263.3406938)
```python
fault_model.sern_calc(output_class=1000)
```
Harden DNN by ODR
```python
fault_model.outlierDR_protection()
fault_model.emat_attack(10,1e-3)
```
## Contribution
![contributors](https://img.shields.io/github/contributors/torchei/torchei)
If you found🧐 any bugs or have🖐️ any suggestions, please tell us.
This repo is open to everyone wants to maintain together.
You can helps us with follow things:
- PR your implemented methods in your or others' papers
- Complete our project
- Translate our docs to your language
- Other
We want to build TorchEI to best toolbox in DNN Reliability for bit flip, adversarial attack, and others.
:e-mail: forcessless@foxmail.com
## Citation
Our paper is under delivering.
## License
> [MIT](https://github.com/TorchEI/TorchEI/blob/main/LICENSE) License.
> Copyright:copyright:2022/5/23-present, Hao Zheng.
Raw data
{
"_id": null,
"home_page": "https://github.com/TorchEI/TorchEI",
"name": "torchei",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pytorch,reliability,ErrorInjection,FaultInjection,BitFlip",
"author": "",
"author_email": "forcelesszheng@foxmail.com",
"download_url": "https://files.pythonhosted.org/packages/b0/b6/842985da49651f33234da3ffbd14d3db8c84f1cabb250a45057694182558/torchei-1.0.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\r\n <img src=\"https://raw.githubusercontent.com/TorchEI/TorchEI/main/assets/torchei.svg\" alt=\"torchei_logo\" align=\"center\" style=\"width:30%;\" />\r\n</div>\r\n\r\n<h1 style = \"margin:0;\" align=\"center\">TorchEI\u26a1</h1>\r\n\r\n<div align = \"center\" style=\"font-weight: bold;\"><a href=\"#introduction\">Intro</a> \u25cf <a href=\"#quick-example\">Usage</a> \u25cf <a href=\"https://TorchEI.github.com.io/TorchEI/\">Doc</a> \u25cf <a href=\"#citation\">Cite</a> \u25cf <a href=\"#contribution\" >Contribution</a> \u25cf <a href=\"#license\">License</a></div>\r\n\r\n------\r\n\r\n<div align = \"center\">\r\n <a href = \"https://github.com/TorchEI/TorchEI/actions/workflows/pytest-cov.yml\">\r\n <img src=\"https://github.com/TorchEI/TorchEI/actions/workflows/pytest-cov.yml/badge.svg\"/></a>\r\n <a href = \"https://github.com/TorchEI/TorchEI/actions/workflows/doc-deploy.yml\">\r\n <img src=\"https://github.com/TorchEI/TorchEI/actions/workflows/doc-deploy.yml/badge.svg\"/></a>\r\n <a href=\"https://codecov.io/gh/TorchEI/TorchEI\" >\r\n <img src=\"https://codecov.io/gh/TorchEI/TorchEI/branch/main/graph/badge.svg?token=0ADLQFHLCJ\"/></a>\r\n <a href=\"https://www.codacy.com/gh/TorchEI/TorchEI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=TorchEI/TorchEI&utm_campaign=Badge_Grade\">\r\n <img src=\"https://app.codacy.com/project/badge/Grade/c4067d004b934d49bb4386b650c57808\"/></a>\r\n <a href=\"https://pypi.org/project/torchei/\" target=\u201d_blank\u201d>\r\n <img src=\"https://img.shields.io/pypi/v/torchei\" alt=\"Pypi\"></a>\r\n <a href=\"https://pypi.org/project/torchei/\" target=\u201d_blank\u201d>\r\n <img src=\"https://pepy.tech/badge/torchei\"/></a>\r\n <a href=\"#license\">\r\n <img src=\"https://img.shields.io/github/license/torchei/torchei\" alt=\"License\"></a>\r\n</div>\r\n\r\n[\u4e2d\u6587](./README-zh.md)\r\n\r\n## Introduction\r\n\r\n\ud83d\udc4bTorchEI, pronounced*/\u02c8t\u00f4rCH\u0259r/*(like torture), short for Pytorch Error Injection, is a high-speed toolbox for DNN Reliability's Research and Development. TorchEI enables you quickly and simply inject errors into DNN, collects information you needed, and harden your DNN.\r\n\r\n## Features\r\n\r\n- Full typing system supported\r\n- Implemented methods from papers\r\n- Highly customizable\r\n\r\n## Quick Example\r\n\r\nHere we gonna show you a quick example, or you can try [interactive demo](https://colab.research.google.com/github/TorchEI/TorchEI/blob/main/example.ipynb) and [online editor](https://github.dev/TorchEI/TorchEI).\r\n\r\n#### Installing\r\n\r\nInstall public distribution using `pip3 install torchei` or [download](https://github.com/TorchEI/TorchEI/archive/refs/heads/main.zip) it.\r\n\r\n#### Example\r\n\r\nInit fault model\r\n\r\n```python\r\nimport torch\r\nfrom torchvision import models\r\nimport torchei\r\nmodel = models.resnet18(pretrained=True)\r\ndata = torch.load('data/ilsvrc_valid8.pt')\r\nfault_model = torchei.fault_model(model,data)\r\n```\r\n\r\nCalc reliability using emat method\r\n\r\n```python\r\nfault_model.emat_attack(10,1e-3)\r\n```\r\n\r\nCalc reliability using [SERN](https://dl.acm.org/doi/abs/10.1145/3386263.3406938)\r\n\r\n```python\r\nfault_model.sern_calc(output_class=1000)\r\n```\r\n\r\nHarden DNN by ODR\r\n\r\n```python\r\nfault_model.outlierDR_protection()\r\nfault_model.emat_attack(10,1e-3)\r\n```\r\n\r\n## Contribution\r\n\r\n ![contributors](https://img.shields.io/github/contributors/torchei/torchei)\r\n\r\nIf you found\ud83e\uddd0 any bugs or have\ud83d\udd90\ufe0f any suggestions, please tell us.\r\n\r\nThis repo is open to everyone wants to maintain together.\r\n\r\nYou can helps us with follow things:\r\n\r\n- PR your implemented methods in your or others' papers\r\n- Complete our project\r\n- Translate our docs to your language\r\n- Other\r\n\r\nWe want to build TorchEI to best toolbox in DNN Reliability for bit flip, adversarial attack, and others.\r\n\r\n:e-mail: forcessless@foxmail.com\r\n\r\n## Citation\r\n\r\nOur paper is under delivering.\r\n\r\n## License\r\n\r\n> [MIT](https://github.com/TorchEI/TorchEI/blob/main/LICENSE) License.\r\n> Copyright:copyright:2022/5/23-present, Hao Zheng.\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A toolbox about DNN Reliability",
"version": "1.0.0",
"split_keywords": [
"pytorch",
"reliability",
"errorinjection",
"faultinjection",
"bitflip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ff63f20c1f462f3bdb6198e6da85197315687ee7372d3d9aa3ab5b7d7ca92db4",
"md5": "ab86fa5ab999bc04424f3570e797a591",
"sha256": "64a46519fd95beddae6a11eb01a62bd9d29e8af1d728bc54d68404a4d601bef4"
},
"downloads": -1,
"filename": "torchei-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ab86fa5ab999bc04424f3570e797a591",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11252,
"upload_time": "2023-03-13T07:42:56",
"upload_time_iso_8601": "2023-03-13T07:42:56.059173Z",
"url": "https://files.pythonhosted.org/packages/ff/63/f20c1f462f3bdb6198e6da85197315687ee7372d3d9aa3ab5b7d7ca92db4/torchei-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0b6842985da49651f33234da3ffbd14d3db8c84f1cabb250a45057694182558",
"md5": "42c5051d4f1db3447d1211f10bb477d2",
"sha256": "832def2401bff3542135427da12c83c7e435c1efdde542fa3a3d0df34cef2c78"
},
"downloads": -1,
"filename": "torchei-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "42c5051d4f1db3447d1211f10bb477d2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12396,
"upload_time": "2023-03-13T07:42:58",
"upload_time_iso_8601": "2023-03-13T07:42:58.872646Z",
"url": "https://files.pythonhosted.org/packages/b0/b6/842985da49651f33234da3ffbd14d3db8c84f1cabb250a45057694182558/torchei-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-13 07:42:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "TorchEI",
"github_project": "TorchEI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "torchei"
}