Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prototorch-models-1.0.0a5.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

prototorch_models-1.0.0a5-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file prototorch-models-1.0.0a5.tar.gz.

File metadata

  • Download URL: prototorch-models-1.0.0a5.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for prototorch-models-1.0.0a5.tar.gz
Algorithm Hash digest
SHA256 26f6e492113d478b2276f00006aa240efa356d2baba479343803c159c4dcf3db
MD5 c6305ea6c2024522c6db0c588ea996ae
BLAKE2b-256 42b8f3b7326d9438ceb6ba60cbb8af23deed9c8637f822fb928cacc57cd54165

See more details on using hashes here.

File details

Details for the file prototorch_models-1.0.0a5-py3-none-any.whl.

File metadata

File hashes

Hashes for prototorch_models-1.0.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 5dadcf68db5f929d150c3b5b0c4b70d27e223530662ec57c65ea79d64c11b99f
MD5 74206f09ae6672d9ccbcd1cac15129df
BLAKE2b-256 2dad6cc725570672b5ca6695106f036f356d9fbf9e8787ab5bbf48dc6b2114b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page