Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnpertoft/spherical-hashing
A Tensorflow 2 implementation of Spherical Hashing
https://github.com/johnpertoft/spherical-hashing
Last synced: about 1 month ago
JSON representation
A Tensorflow 2 implementation of Spherical Hashing
- Host: GitHub
- URL: https://github.com/johnpertoft/spherical-hashing
- Owner: johnPertoft
- License: mit
- Created: 2020-09-03T07:29:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-08T15:34:42.000Z (over 4 years ago)
- Last Synced: 2024-12-02T23:35:18.209Z (2 months ago)
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spherical Hashing
A Tensorflow 2 implementation of [Spherical Hashing](https://ieeexplore.ieee.org/document/6248024).Spherical hashing is a way to compute a binary encoding of a feature vector while still maintaining
spatial coherence. This binary encoding can then be used for an approximate nearest neighbor
solution since the compactness of this representation allows for faster neighbor search.## Usage
```
from spherical_hashing import train_spherical_hashing
import tensorflow as tfx_train = tf.random.uniform(shape=(1000, 512), minval=-10.0, maxval=10.0)
sph_model = train_spherical_hashing_model(x_train, n_bits=32)x_test = tf.random.uniform(shape=(100, 512), minval=-10.0, maxval=10.0)
bits = sph_model(x_test, apply_pack_bits=True)
```## Installation
```
pip install tf-spherical-hashing
```## Development
### Run tests
```
./scripts/run-tests.sh
```### Publish pip package
```
./scripts/publish.sh
```