Skip to main content

ProtoTorch Models

GitHub tag (latest by date) PyPI GitHub license

Pre-packaged prototype-based machine learning models using ProtoTorch and PyTorch-Lightning.

Installation

To install this plugin, simply run the following command:

pip install prototorch_models

Installing the models plugin should automatically install a suitable version of ProtoTorch. The plugin should then be available for use in your Python environment as prototorch.models.

Available models

LVQ Family

  • Learning Vector Quantization 1 (LVQ1)
  • Generalized Learning Vector Quantization (GLVQ)
  • Generalized Relevance Learning Vector Quantization (GRLVQ)
  • Generalized Matrix Learning Vector Quantization (GMLVQ)
  • Limited-Rank Matrix Learning Vector Quantization (LiRaMLVQ)
  • Localized and Generalized Matrix Learning Vector Quantization (LGMLVQ)
  • Learning Vector Quantization Multi-Layer Network (LVQMLN)
  • Siamese GLVQ
  • Cross-Entropy Learning Vector Quantization (CELVQ)
  • Soft Learning Vector Quantization (SLVQ)
  • Robust Soft Learning Vector Quantization (RSLVQ)
  • Probabilistic Learning Vector Quantization (PLVQ)
  • Median-LVQ

Other

  • k-Nearest Neighbors (KNN)
  • Neural Gas (NG)
  • Growing Neural Gas (GNG)

Work in Progress

  • Classification-By-Components Network (CBC)
  • Learning Vector Quantization 2.1 (LVQ2.1)
  • Self-Organizing-Map (SOM)

Planned models

  • Generalized Tangent Learning Vector Quantization (GTLVQ)
  • Self-Incremental Learning Vector Quantization (SILVQ)

Development setup

It is recommended that you use a virtual environment for development. If you do not use conda, the easiest way to work with virtual environments is by using virtualenvwrapper. Once you've installed it with pip install virtualenvwrapper, you can do the following:

export WORKON_HOME=~/pyenvs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh  # location may vary
mkvirtualenv pt

Once you have a virtual environment setup, you can start install the models plugin with:

workon pt
git clone git@github.com:si-cim/prototorch_models.git
cd prototorch_models
git checkout dev
pip install -e .[all]  # \[all\] if you are using zsh or MacOS

To assist in the development process, you may also find it useful to install yapf, isort and autoflake. You can install them easily with pip. Also, please avoid installing Tensorflow in this environment. It is known to cause problems with PyTorch-Lightning.

Contribution

This repository contains definition for git hooks. Pre-commit is automatically installed as development dependency with prototorch or you can install it manually with pip install pre-commit.

Please install the hooks by running:

pre-commit install
pre-commit install --hook-type commit-msg

before creating the first commit.

The commit will fail if the commit message does not follow the specification provided here.

FAQ

How do I update the plugin?

If you have already cloned and installed prototorch and the prototorch_models plugin with the -e flag via pip, all you have to do is navigate to those folders from your terminal and do git pull to update.

Metadata

Release files for prototorch-models 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prototorch-models 0.7.1
File Size Uploaded
prototorch-models-0.7.1.tar.gz 19.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prototorch-models 0.7.1
File Interpreter ABI Platform
prototorch_models-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 41.3 kB

Release files / prototorch-models-0.7.1.tar.gz

Download URL prototorch-models-0.7.1.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b8aa7b58abc5bdc87cd49c774434c5b01c34cb588e382e7d9a6f1fc41cfe0325
BLAKE2b-256 checksum
How to use checksums
ff06316fe28ee880d760ff387b9b225879336fa747d73dbd9738ba2efd6ed2c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / prototorch_models-0.7.1-py3-none-any.whl

Download URL prototorch_models-0.7.1-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
300720343daf9b416cffc3e29bbce8971e3474def79418f3b0144530f430a453
BLAKE2b-256 checksum
How to use checksums
19097c6a9ac6b3d59aa8a8d68a702a0d3d2704e7f9654e5c24941d8d981bca2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page