No project description provided
Project description
Project Setup
Follow these steps to set up the qml-anomaly-detection project using Poetry:
-
Install Poetry:
Linux, macOS, Windows (WSL)
curl -sSL https://install.python-poetry.org | python3 -
Windows Powershell:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
Note: On Windows you must add the pypoetry Scripts path to your
PATHenvironment variable. Poetry by default is installed at%APPDATA%\pypoetryon Windows. -
Configure Poetry to use project directory for Virtual Environment
poetry config virtualenvs.in-project true
-
Install required python version using
pyenvInstall pyenv:
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev curl https://pyenv.run/ | bash
For Windows, refer to the installation here at https://github.com/pyenv-win/pyenv-win?tab=readme-ov-file#installation
Install python 3.10:
pyenv install 3.10
-
Clone the qml-anomaly-detection repository
git clone https://github.com/Manoj-E-S/qml-anomaly-detection.git
-
Set python-version as the local(default) version for the project
cd qml-anomaly-detection pyenv local 3.10
-
Install Dependencies under the python-version specified in pyproject.toml:
cd qml-anomaly-detection poetry env use 3.10 poetry install
-
Intall
torchdependency-
If cuda is available:
-
Check cuda version on your device
nvcc --version -
Add corresponding
torchrepository source inpyproject.toml(Although this will not be useful in installing pytorch (as it will be installed outside of the dependency management), doing this will be helpful for documentation purposes)[[tool.poetry.source]] name = "pytorch-gpu-<PLACEHOLDER>" url = "https://download.pytorch.org/whl/<PLACEHOLDER>" priority = "explicit" -
Install
torchin the venv, without updating pyproject.tomlcd qml-anomaly-detection poetry run pip install "torch==2.4.1+<PLACEHOLDER>" --index-url "https://download.pytorch.org/whl/<PLACEHOLDER>"
-
Note: Replace PLACEHOLDER with cuda-appropriate repository. Ex: cu121 (for cuda 12.1), cu111 (for cuda 11.1), etc.
-
-
If cuda is not available:
cd qml-anomaly-detection poetry run pip install "torch==2.4.1+cpu" --index-url "https://download.pytorch.org/whl/cpu/torch_stable.html"
-
-
Download the datasets
Run the following to install the datasets:
poetry shell python datasets/dataset_install.py
If for whatever reason running the above script does not properly install the datasets, Manually download them from here and replace the contents in the
datasetsdirectory to form the following structure:
/datasets/
├── ccfraud/
├── diabetes/
├── KDD Cup 1999/
└── README.md -
Run Your Project:
poetry shell python <your_script>.py
We are good to go!
Some useful Poetry Commands
-
Create a New Poetry Project:
poetry new <project-name> cd <project-name>
-
Add Dependencies:
poetry add <package-1-name> <package-2-name> ... poetry add "<package-name>@<version-specifier>" --source <custom-source-name>
-
Add Group Dependencies (dev-dependencies, test-dependencies, etc):
poetry add --group <group-name> <package-1-name> <package-2-name> ...
-
Add New Sources:
poetry source add --priority=<default|primary|supplemental|explicit> <custom-source-name> <source-url>
-
Bring poetry.lock up-to-date with pyproject.toml (without updating dependencies):
poetry lock --no-update
-
To run the tests:
poetry run pytest -sOr to run a specific test file:
poetry run pytest -s test_file.py -
Activate the Virtual Environment:
poetry shell -
Deactivate the Virtual Environment:
exit
For more details, refer to the Poetry documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cqu-0.1.0.tar.gz.
File metadata
- Download URL: cqu-0.1.0.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3193d5627250bbfba8b8012a3a534b53bf7a93dff0aef7458e7c810c7f8e7b48
|
|
| MD5 |
5871d877b514014f95b02629d1a50d03
|
|
| BLAKE2b-256 |
4ceb92211a9a8d86989bf5e5d08045c27f282ed1230c283f608c62e2e5837735
|
File details
Details for the file cqu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cqu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c32574a7104647475aee0ddef283b1abc86d316f32e7928ce036ee114af2c33
|
|
| MD5 |
3a5b446c3d44540e8ae7f5e3b20e1d18
|
|
| BLAKE2b-256 |
08511eb6f9117e516a88a3e88222094c173d020d6dd1c57c0eb66bb391648db0
|