torchvinecopulib


Nametorchvinecopulib JSON
Version 2024.4.2 PyPI version JSON
download
home_pagehttps://github.com/TY-Cheng/torchvinecopulib
Summaryyet another vine copula library for PyTorch.
upload_time2024-04-30 08:16:36
maintainerXiaosheng You
docs_urlNone
authorTuoyuan Cheng
requires_python<4.0,>=3.10
licenseGNU GPLv3
keywords vine copula copula torch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TorchVineCopuLib

[![Python package](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/python-package.yml)
![Static Badge](https://img.shields.io/badge/Python-%203.10%7C3.11%7C3.12-blue)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/e8a7a7448b2043d9bbefafc5a3ec14f7)](https://app.codacy.com?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)
[![Deploy Docs](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/static.yml/badge.svg?branch=main)](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/static.yml)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
![PyPI - Version](https://img.shields.io/pypi/v/torchvinecopulib?style=flat)
[![DOI](https://zenodo.org/badge/768037665.svg)](https://zenodo.org/doi/10.5281/zenodo.10836953)


Yet another vine copula package, using [PyTorch](https://pytorch.org/get-started/locally/).

- C/D/R-Vine full simulation/ quantile-regression/ conditoinal-simulation, all in one package
  - Flexible simulation workflow for experienced users
- Vectorized tensor computation with GPU (`device='cuda'`) support
- Shorter runtimes for higher dimension simulations
- Decoupled dataclasses and factory methods
- Pure `Python` library, inspired by and tested against [pyvinecopulib](https://github.com/vinecopulib/pyvinecopulib/) on Windows, Linux, MacOS
- IO and visualization support

## Dependencies

```toml
# inside the `./pyproject.toml` file
python = "^3.10"
scipy = "*"
torch = "^2"
```

For [PyTorch](https://pytorch.org/get-started/locally/) with `cuda` support on Windows:

```bash
pip install torch --index-url https://download.pytorch.org/whl/cu121 --force-reinstall
```

> [!TIP]
> macOS users should set `device='cpu'` at this stage, for using `device='mps'` won't support `dtype=torch.float64`.

## Installation

By `pip` from `PyPI`:

```bash
pip install torchvinecopulib
```

with full drawing and bivariate dependency metric support:

```bash
pip install torchvinecopulib matplotlib pot scikit-learn
```

By `pip` from `./dist/*.whl` or `./dist/*.tar.gz` in this repo.
Need to use proper file name.

```bash
# inside project root folder
pip install ./dist/torchvinecopulib-2024.4.2-py3-none-any.whl
# or
pip install ./dist/torchvinecopulib-2024.4.2.tar.gz
```

## Examples

Visit the `./examples/` folder for `.ipynb` Jupyter notebooks.

## Documentation

- Visit [GitHub Pages website](https://ty-cheng.github.io/torchvinecopulib/)

- Or visit the `./docs/_build/html` subfolder for static `html` made with `Sphinx`

- Or build by yourself (need [`Sphinx`](https://github.com/sphinx-doc/sphinx), theme [`furo`](https://github.com/pradyunsg/furo) and [the GNU `make`](https://www.gnu.org/software/make/))

```bash
# inside project root folder
sphinx-apidoc -o ./docs ./torchvinecopulib && cd ./docs && make html && cd ..
```

## Tests

> [!TIP]
> the `./tests/test_vinecop.py` may take longer without `'cuda'`

```python
# inside project root folder
python -m pytest ./tests
```

## Contributing

We welcome contributions, whether it's a bug report, feature suggestion, code contribution, or documentation improvement.

- If you encounter any issues with the project or have ideas for new features, please [open an issue](https://github.com/TY-Cheng/torchvinecopulib/issues/new) on GitHub or [privately email us](mailto:cty120120@gmail.com). Make sure to include detailed information about the problem or feature request, including steps to reproduce for bugs.

### Code Contributions

1. Fork the repository and create a new branch from the `main` branch.
2. Make your changes and ensure they adhere to the project's coding style and conventions.
3. Write tests for any new functionality and ensure existing tests pass.
4. Commit your changes with clear and descriptive commit messages.
5. Push your changes to your fork and submit a pull request to the `main` branch of the original repository.

### Pull Request Guidelines

- Keep pull requests focused on addressing a single issue or feature.
- Include a clear and descriptive title and description for your pull request.
- Make sure all tests pass before submitting the pull request.
- If your pull request addresses an open issue, reference the issue number in the description using the syntax `#issue_number`.
- [in-place ops can be slower](https://discuss.pytorch.org/t/are-inplace-operations-faster/61209/4)
- [torch.jit.script can be slower](https://discuss.pytorch.org/t/why-is-torch-jit-script-slower/120131/6)

### TODO
1. more (non-parametric) `bicop` class in `torch`
2. potentially deprecating `'mle'` from `mtd_fit`

## License

> Copyright (C) 2024 Tuoyuan Cheng, Xiaosheng You, Kan Chen
>
> This file is part of torchvinecopulib.
> torchvinecopulib is free software: you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation, either version 3 of the License, or
> (at your option) any later version.
>
> torchvinecopulib is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with torchvinecopulib. If not, see <http://www.gnu.org/licenses/>.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TY-Cheng/torchvinecopulib",
    "name": "torchvinecopulib",
    "maintainer": "Xiaosheng You",
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": "e1204754@u.nus.edu",
    "keywords": "vine copula, copula, torch",
    "author": "Tuoyuan Cheng",
    "author_email": "cty120120@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/98/fd/3e19d373e008d2e2c4912dbece4663cde1d9a705217852f58707ddb2a581/torchvinecopulib-2024.4.2.tar.gz",
    "platform": null,
    "description": "# TorchVineCopuLib\n\n[![Python package](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/python-package.yml)\n![Static Badge](https://img.shields.io/badge/Python-%203.10%7C3.11%7C3.12-blue)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/e8a7a7448b2043d9bbefafc5a3ec14f7)](https://app.codacy.com?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)\n[![Deploy Docs](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/static.yml/badge.svg?branch=main)](https://github.com/TY-Cheng/torchvinecopulib/actions/workflows/static.yml)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n![PyPI - Version](https://img.shields.io/pypi/v/torchvinecopulib?style=flat)\n[![DOI](https://zenodo.org/badge/768037665.svg)](https://zenodo.org/doi/10.5281/zenodo.10836953)\n\n\nYet another vine copula package, using [PyTorch](https://pytorch.org/get-started/locally/).\n\n- C/D/R-Vine full simulation/ quantile-regression/ conditoinal-simulation, all in one package\n  - Flexible simulation workflow for experienced users\n- Vectorized tensor computation with GPU (`device='cuda'`) support\n- Shorter runtimes for higher dimension simulations\n- Decoupled dataclasses and factory methods\n- Pure `Python` library, inspired by and tested against [pyvinecopulib](https://github.com/vinecopulib/pyvinecopulib/) on Windows, Linux, MacOS\n- IO and visualization support\n\n## Dependencies\n\n```toml\n# inside the `./pyproject.toml` file\npython = \"^3.10\"\nscipy = \"*\"\ntorch = \"^2\"\n```\n\nFor [PyTorch](https://pytorch.org/get-started/locally/) with `cuda` support on Windows:\n\n```bash\npip install torch --index-url https://download.pytorch.org/whl/cu121 --force-reinstall\n```\n\n> [!TIP]\n> macOS users should set `device='cpu'` at this stage, for using `device='mps'` won't support `dtype=torch.float64`.\n\n## Installation\n\nBy `pip` from `PyPI`:\n\n```bash\npip install torchvinecopulib\n```\n\nwith full drawing and bivariate dependency metric support:\n\n```bash\npip install torchvinecopulib matplotlib pot scikit-learn\n```\n\nBy `pip` from `./dist/*.whl` or `./dist/*.tar.gz` in this repo.\nNeed to use proper file name.\n\n```bash\n# inside project root folder\npip install ./dist/torchvinecopulib-2024.4.2-py3-none-any.whl\n# or\npip install ./dist/torchvinecopulib-2024.4.2.tar.gz\n```\n\n## Examples\n\nVisit the `./examples/` folder for `.ipynb` Jupyter notebooks.\n\n## Documentation\n\n- Visit [GitHub Pages website](https://ty-cheng.github.io/torchvinecopulib/)\n\n- Or visit the `./docs/_build/html` subfolder for static `html` made with `Sphinx`\n\n- Or build by yourself (need [`Sphinx`](https://github.com/sphinx-doc/sphinx), theme [`furo`](https://github.com/pradyunsg/furo) and [the GNU `make`](https://www.gnu.org/software/make/))\n\n```bash\n# inside project root folder\nsphinx-apidoc -o ./docs ./torchvinecopulib && cd ./docs && make html && cd ..\n```\n\n## Tests\n\n> [!TIP]\n> the `./tests/test_vinecop.py` may take longer without `'cuda'`\n\n```python\n# inside project root folder\npython -m pytest ./tests\n```\n\n## Contributing\n\nWe welcome contributions, whether it's a bug report, feature suggestion, code contribution, or documentation improvement.\n\n- If you encounter any issues with the project or have ideas for new features, please [open an issue](https://github.com/TY-Cheng/torchvinecopulib/issues/new) on GitHub or [privately email us](mailto:cty120120@gmail.com). Make sure to include detailed information about the problem or feature request, including steps to reproduce for bugs.\n\n### Code Contributions\n\n1. Fork the repository and create a new branch from the `main` branch.\n2. Make your changes and ensure they adhere to the project's coding style and conventions.\n3. Write tests for any new functionality and ensure existing tests pass.\n4. Commit your changes with clear and descriptive commit messages.\n5. Push your changes to your fork and submit a pull request to the `main` branch of the original repository.\n\n### Pull Request Guidelines\n\n- Keep pull requests focused on addressing a single issue or feature.\n- Include a clear and descriptive title and description for your pull request.\n- Make sure all tests pass before submitting the pull request.\n- If your pull request addresses an open issue, reference the issue number in the description using the syntax `#issue_number`.\n- [in-place ops can be slower](https://discuss.pytorch.org/t/are-inplace-operations-faster/61209/4)\n- [torch.jit.script can be slower](https://discuss.pytorch.org/t/why-is-torch-jit-script-slower/120131/6)\n\n### TODO\n1. more (non-parametric) `bicop` class in `torch`\n2. potentially deprecating `'mle'` from `mtd_fit`\n\n## License\n\n> Copyright (C) 2024 Tuoyuan Cheng, Xiaosheng You, Kan Chen\n>\n> This file is part of torchvinecopulib.\n> torchvinecopulib is free software: you can redistribute it and/or modify\n> it under the terms of the GNU General Public License as published by\n> the Free Software Foundation, either version 3 of the License, or\n> (at your option) any later version.\n>\n> torchvinecopulib is distributed in the hope that it will be useful,\n> but WITHOUT ANY WARRANTY; without even the implied warranty of\n> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n> GNU General Public License for more details.\n>\n> You should have received a copy of the GNU General Public License\n> along with torchvinecopulib. If not, see <http://www.gnu.org/licenses/>.\n",
    "bugtrack_url": null,
    "license": "GNU GPLv3",
    "summary": "yet another vine copula library for PyTorch.",
    "version": "2024.4.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/TY-Cheng/torchvinecopulib/issues/new",
        "Documentation": "https://ty-cheng.github.io/torchvinecopulib/",
        "Homepage": "https://github.com/TY-Cheng/torchvinecopulib",
        "Repository": "https://github.com/TY-Cheng/torchvinecopulib"
    },
    "split_keywords": [
        "vine copula",
        " copula",
        " torch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4201a9242e48eaf4b4d2ab5cc1652fe3bfcc05e52d4e4bdfc8fc45229eb34c37",
                "md5": "cbc6232386c7adb2500e7fbe646b5890",
                "sha256": "6c5239d3459ab44bd7f2adcdfe8c2fe9171c0f163d41598b6ddd3d430b0bf353"
            },
            "downloads": -1,
            "filename": "torchvinecopulib-2024.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbc6232386c7adb2500e7fbe646b5890",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 54473,
            "upload_time": "2024-04-30T08:16:34",
            "upload_time_iso_8601": "2024-04-30T08:16:34.078003Z",
            "url": "https://files.pythonhosted.org/packages/42/01/a9242e48eaf4b4d2ab5cc1652fe3bfcc05e52d4e4bdfc8fc45229eb34c37/torchvinecopulib-2024.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98fd3e19d373e008d2e2c4912dbece4663cde1d9a705217852f58707ddb2a581",
                "md5": "cd70943b69ba7134bf2eecc651dcc67e",
                "sha256": "952d9fca7ecf552efbef71c5715d7b2dfd483cd3f685004ee5ff0aee9efd6096"
            },
            "downloads": -1,
            "filename": "torchvinecopulib-2024.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "cd70943b69ba7134bf2eecc651dcc67e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 49611,
            "upload_time": "2024-04-30T08:16:36",
            "upload_time_iso_8601": "2024-04-30T08:16:36.161557Z",
            "url": "https://files.pythonhosted.org/packages/98/fd/3e19d373e008d2e2c4912dbece4663cde1d9a705217852f58707ddb2a581/torchvinecopulib-2024.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 08:16:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TY-Cheng",
    "github_project": "torchvinecopulib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "torchvinecopulib"
}
        
Elapsed time: 0.28007s