Metadata-Version: 2.1
Name: pynsm
Version: 1.0.1
Summary: A PyTorch implementation of non-negative similarity matching
Author-email: Tiberiu Tesileanu <ttesileanu@gmail.com>, Shagesh Sridharan <shagesh1996@gmail.com>, Yanis Bahroun <ybahroun@flatironinstitute.org>
License: MIT License
        
        Copyright (c) 2022-2023 Shagesh Sridharan, Yanis Bahroun, Tiberiu Tesileanu
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Source, https://github.com/Shagesh/pytorch-NSM
Project-URL: Docs, https://pynsm.readthedocs.io
Keywords: neural network,biology,research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: torch
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: matplotlib ; extra == 'dev'
Requires-Dist: seaborn ; extra == 'dev'
Requires-Dist: ipykernel ; extra == 'dev'
Requires-Dist: tqdm ; extra == 'dev'
Requires-Dist: torchvision ; extra == 'dev'
Requires-Dist: scikit-learn ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs ; extra == 'docs'
Requires-Dist: mkdocstrings[python] ; extra == 'docs'
Requires-Dist: mkdocs-gen-files ; extra == 'docs'
Requires-Dist: mkdocs-literate-nav ; extra == 'docs'
Requires-Dist: mkdocs-jupyter ; extra == 'docs'
Requires-Dist: black ; extra == 'docs'

# Non-negative similarity matching in PyTorch

[![PyPI Version](https://img.shields.io/pypi/v/pynsm.svg)](https://pypi.org/project/pynsm/)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-green.svg)](https://www.python.org/downloads/release/python-380/)
[![License](https://img.shields.io/pypi/l/pynsm.svg)](https://github.com/Shagesh/pytorch-NSM/blob/master/LICENSE)

This is an implementation of non-negative similarity matching (NSM) for PyTorch focusing on ease of use, extensibility, and speed.

## Getting started

You can install the package from PyPI by using

```sh
pip install pynsm
```

## User documentation
Find examples, how-to guides, tutorials, and full API reference information on Readthedocs, https://pynsm.readthedocs.io/.

## Questions or issues?

Please contact us by opening an issue on GitHub.

<br/>

*********************************************************

<br/>

## Instructions for developers

### Developer installation

It is strongly recommended to use a virtual environment when working with this code. The installation instructions below include the commands for creating the virtual environment, using either `conda` (recommended) or `venv`.

#### Developer install using `conda`

If you do not have `conda` installed, the easiest way to get started is with [Miniconda](https://docs.conda.io/en/latest/miniconda.html). Follow the installation instructions for your system.

Next, create a new environment and install for CPU using

```sh
conda env create -f environment.yml
```

For using an NVIDIA GPU run

```sh
conda env create -f environment-cuda.yml
```

Note that most Macs do not have an NVIDIA GPU, so you should use the first invocation shown above. If your Mac uses the newer Apple chips, you may be able to use ``device=mps`` to get GPU acceleration (the installation procedure remains unchanged).

The commands above automatically perform an "editable" install—this means that changes made to the code will automatically take effect without having to reinstall the package.

#### Developer install using `venv`

Before creating a new virtual environment, it is best to ensure you're not using the system version of Python—this is often badly out of date. Some options for doing this are outlined in [The Hitchhiker's Guide to Python](https://docs.python-guide.org/starting/installation/#installation-guides), although many options exist. One advantage of using `conda` is that this is done for you.

Once you have a proper Python install, create a new virtual environment by running the following command in a terminal inside the main folder of the repository:

```sh
python -m venv env
```

This creates a subfolder called `env` containing the files for the virtual environment. Next we need to activate the environment and install the package with its pre-requisites:

```sh
source env/bin/activate
pip install -e ".[dev]"
```

The `-e` marks this as an "editable" install—this means that changes made to the code will automatically take effect without having to reinstall the package.

### Example usage

See the notebooks in the [`examples`](examples) folder to get started with the package. The information on [readthedocs](https://pynsm.readthedocs.io/) may also prove useful.
