pytorch-iga


Namepytorch-iga JSON
Version 0.0.3 PyPI version JSON
download
home_page
SummaryA pytorch model training protocol for environment invariant deployment
upload_time2023-09-20 01:54:45
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords one two
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            This is a PyTorch implementation of the Inter-environmental Gradient Alignment algorithm proposed by Koyama and Yamaguchi in their paper [Out-of-Distribution Generalization
with Maximal Invariant Predictor](https://arxiv.org/pdf/2008.01883v1.pdf)

## Quick start
Install pytorch-iga in the terminal:
```bash
pip install pytorch-iga
```

Import IGA in python:

```python
from iga import IGA
```

IGA is defined with the following parameters:

```python
IGA(model, optimizer, criterion, data, num_epochs, batch_size, lamda, verbose=10, device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
)
```

Parameters:
>    model (torch.nn.Module): neural network model to be trained/tuned
    optimizer (torch.optim): pytorch optimizer object such as torch.optim.SGD
    criterion (function): loss function for model evaluation
    data (list(torch.utils.Dataset)): a list of Datasets for each environment
    num_epochs (int): number of training epochs
    batch_size (int): number of data points per batch
    lamda (float): importance weight of inter-environmental variance
    verbose (int): number of iterations in each progress log
    device (torch.device): optional, torch.device object, defaults to 'cuda' or 'cpu'

Returns:
>    model (torch.nn.Module): updated torch model
    IGA_loss (float): ending loss value
    
## Example
to be continued...

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pytorch-iga",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "one,two",
    "author": "",
    "author_email": "Calvin Boyce <calvinrboyce1@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/87/43/dc9251e266e68895ff4544e699210696ff77d930c30ce306f3e3c6d1bcc5/pytorch-iga-0.0.3.tar.gz",
    "platform": null,
    "description": "This is a PyTorch implementation of the Inter-environmental Gradient Alignment algorithm proposed by Koyama and Yamaguchi in their paper [Out-of-Distribution Generalization\nwith Maximal Invariant Predictor](https://arxiv.org/pdf/2008.01883v1.pdf)\n\n## Quick start\nInstall pytorch-iga in the terminal:\n```bash\npip install pytorch-iga\n```\n\nImport IGA in python:\n\n```python\nfrom iga import IGA\n```\n\nIGA is defined with the following parameters:\n\n```python\nIGA(model, optimizer, criterion, data, num_epochs, batch_size, lamda, verbose=10, device=torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\"),\n)\n```\n\nParameters:\n>    model (torch.nn.Module): neural network model to be trained/tuned\n    optimizer (torch.optim): pytorch optimizer object such as torch.optim.SGD\n    criterion (function): loss function for model evaluation\n    data (list(torch.utils.Dataset)): a list of Datasets for each environment\n    num_epochs (int): number of training epochs\n    batch_size (int): number of data points per batch\n    lamda (float): importance weight of inter-environmental variance\n    verbose (int): number of iterations in each progress log\n    device (torch.device): optional, torch.device object, defaults to 'cuda' or 'cpu'\n\nReturns:\n>    model (torch.nn.Module): updated torch model\n    IGA_loss (float): ending loss value\n    \n## Example\nto be continued...\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A pytorch model training protocol for environment invariant deployment",
    "version": "0.0.3",
    "project_urls": null,
    "split_keywords": [
        "one",
        "two"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e6bde1917be8a4381353c7a1c6dcd42d5559c1ca44ddb835c6d5ec4c8f5ce71",
                "md5": "4212db0cf4ffb0e8cf50a4f7bff6f2e8",
                "sha256": "fa7d83670f3c9d965c6bf58f2f18d7f2fc6197e2d05814fedf097bbe8d704e39"
            },
            "downloads": -1,
            "filename": "pytorch_iga-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4212db0cf4ffb0e8cf50a4f7bff6f2e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3848,
            "upload_time": "2023-09-20T01:54:43",
            "upload_time_iso_8601": "2023-09-20T01:54:43.653853Z",
            "url": "https://files.pythonhosted.org/packages/1e/6b/de1917be8a4381353c7a1c6dcd42d5559c1ca44ddb835c6d5ec4c8f5ce71/pytorch_iga-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8743dc9251e266e68895ff4544e699210696ff77d930c30ce306f3e3c6d1bcc5",
                "md5": "f1eee0c488221ada1a6a6dbc98d94fbd",
                "sha256": "6e43ce378b0d6022f7f99d460beb850d591b29eb32a56efbd99c947d526d2732"
            },
            "downloads": -1,
            "filename": "pytorch-iga-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f1eee0c488221ada1a6a6dbc98d94fbd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4257,
            "upload_time": "2023-09-20T01:54:45",
            "upload_time_iso_8601": "2023-09-20T01:54:45.108261Z",
            "url": "https://files.pythonhosted.org/packages/87/43/dc9251e266e68895ff4544e699210696ff77d930c30ce306f3e3c6d1bcc5/pytorch-iga-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-20 01:54:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pytorch-iga"
}
        
Elapsed time: 0.12649s