2021-04-21 13:02:55 +00:00
|
|
|
# ProtoTorch Models
|
2021-04-21 11:13:28 +00:00
|
|
|
|
2021-05-10 14:47:28 +00:00
|
|
|
[![Build Status](https://travis-ci.org/si-cim/prototorch_models.svg?branch=main)](https://travis-ci.org/si-cim/prototorch_models)
|
2021-05-10 14:40:08 +00:00
|
|
|
[![PyPI](https://img.shields.io/pypi/v/prototorch_models)](https://pypi.org/project/prototorch_models/)
|
2021-05-10 14:39:02 +00:00
|
|
|
|
2021-04-21 11:30:50 +00:00
|
|
|
Pre-packaged prototype-based machine learning models using ProtoTorch and
|
|
|
|
PyTorch-Lightning.
|
2021-04-21 13:02:55 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2021-05-11 14:14:23 +00:00
|
|
|
To install this plugin, simply run the following command:
|
2021-05-07 13:41:53 +00:00
|
|
|
|
|
|
|
```sh
|
2021-05-11 14:14:23 +00:00
|
|
|
pip install prototorch_models
|
2021-04-21 13:02:55 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
The plugin should then be available for use in your Python environment as
|
|
|
|
`prototorch.models`.
|
|
|
|
|
2021-05-11 14:14:23 +00:00
|
|
|
*Note: Installing the models plugin should automatically install a suitable
|
|
|
|
version of * [ProtoTorch](https://github.com/si-cim/prototorch).
|
|
|
|
|
2021-04-21 19:34:32 +00:00
|
|
|
## 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](https://virtualenvwrapper.readthedocs.io/en/latest/). Once
|
|
|
|
you've installed it with `pip install virtualenvwrapper`, you can do the
|
|
|
|
following:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
export WORKON_HOME=~/pyenvs
|
|
|
|
mkdir -p $WORKON_HOME
|
2021-05-07 13:41:53 +00:00
|
|
|
source /usr/local/bin/virtualenvwrapper.sh # location may vary
|
2021-04-21 19:34:32 +00:00
|
|
|
mkvirtualenv pt
|
2021-05-07 13:41:53 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Once you have a virtual environment setup, you can start install the `models`
|
|
|
|
plugin with:
|
|
|
|
|
|
|
|
```sh
|
2021-04-21 19:34:32 +00:00
|
|
|
workon pt
|
|
|
|
git clone git@github.com:si-cim/prototorch_models.git
|
|
|
|
cd prototorch_models
|
|
|
|
git checkout dev
|
2021-04-29 15:05:41 +00:00
|
|
|
pip install -e .[all] # \[all\] if you are using zsh or MacOS
|
2021-04-21 19:34:32 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
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`.
|
|
|
|
|
2021-04-21 13:02:55 +00:00
|
|
|
## Available models
|
|
|
|
|
2021-05-11 14:14:23 +00:00
|
|
|
- Learning Vector Quantization 1 (LVQ1)
|
2021-05-07 13:41:53 +00:00
|
|
|
- Generalized Learning Vector Quantization (GLVQ)
|
2021-05-09 18:55:07 +00:00
|
|
|
- Generalized Relevance Learning Vector Quantization (GRLVQ)
|
2021-05-07 13:41:53 +00:00
|
|
|
- Generalized Matrix Learning Vector Quantization (GMLVQ)
|
|
|
|
- Limited-Rank Matrix Learning Vector Quantization (LiRaMLVQ)
|
2021-05-11 14:14:23 +00:00
|
|
|
- Learning Vector Quantization Multi-Layer Network (LVQMLN)
|
2021-04-27 12:35:17 +00:00
|
|
|
- Siamese GLVQ
|
2021-05-07 13:41:53 +00:00
|
|
|
- Neural Gas (NG)
|
2021-04-23 15:30:23 +00:00
|
|
|
|
|
|
|
## Work in Progress
|
2021-04-29 21:37:22 +00:00
|
|
|
|
2021-05-07 13:41:53 +00:00
|
|
|
- Classification-By-Components Network (CBC)
|
2021-05-11 14:14:23 +00:00
|
|
|
- Learning Vector Quantization 2.1 (LVQ2.1)
|
2021-04-23 15:30:23 +00:00
|
|
|
|
|
|
|
## Planned models
|
2021-04-29 21:37:22 +00:00
|
|
|
|
2021-04-27 12:35:17 +00:00
|
|
|
- Local-Matrix GMLVQ
|
2021-05-07 13:41:53 +00:00
|
|
|
- Generalized Tangent Learning Vector Quantization (GTLVQ)
|
|
|
|
- Robust Soft Learning Vector Quantization (RSLVQ)
|
|
|
|
- Probabilistic Learning Vector Quantization (PLVQ)
|
|
|
|
- Self-Incremental Learning Vector Quantization (SILVQ)
|
|
|
|
- K-Nearest Neighbors (KNN)
|
|
|
|
|
|
|
|
## 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.
|