Analytics
Yet another vine copula package, using PyTorch.
device='cuda'
) supportPython
library, inspired by and tested against pyvinecopulib on Windows, Linux, MacOS# inside the `./pyproject.toml` file;
numpy = "*"
python = "^3.10"
scipy = "*"
# optional to facilitate customization
torch = { version = "^2", optional = true }
For PyTorch with cuda
support on Windows:
pip install torch --index-url https://download.pytorch.org/whl/cu121 --force-reinstall
# check cuda availability
python -c "import torch; print(torch.cuda.is_available())"
[!TIP] macOS users should set
device='cpu'
at this stage, for usingdevice='mps'
won't supportdtype=torch.float64
.
pip
from PyPI
:pip install torchvinecopulib torch
pip install torchvinecopulib torch matplotlib pot scikit-learn
pip
from ./dist/*.whl
or ./dist/*.tar.gz
in this repo.
Need to use proper file name.# inside project root folder
pip install ./dist/torchvinecopulib-2024.10.1-py3-none-any.whl
# or
pip install ./dist/torchvinecopulib-2024.10.1.tar.gz
After git clone https://github.com/TY-Cheng/torchvinecopulib.git
, cd
into the project root where pyproject.toml
exists,
# inside project root folder
poetry lock && poetry install -E dev_cpu --with dev_cpu --sync
# or
poetry lock && poetry install -E dev_cuda --with dev_cuda --sync
Visit the ./examples/
folder for .ipynb
Jupyter notebooks.
Visit GitHub Pages website
Or visit html-preview.github.io
Or build by yourself (need Sphinx
, theme furo
and the GNU make
)
# inside project root folder
sphinx-apidoc -o ./docs ./torchvinecopulib && cd ./docs && make html && cd ..
[!TIP] the
./tests/test_vinecop.py
may take longer without'cuda'
# inside project root folder
python -m pytest ./tests
# coverage report
coverage run -m pytest ./tests && coverage html
bicop
class in torch
cuda
-compatible Student's t cdf/ppfWe welcome contributions, whether it's a bug report, feature suggestion, code contribution, or documentation improvement.
main
branch.main
branch of the original repository.#issue_number
.Copyright (C) 2024- Tuoyuan Cheng, 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/.