Tensorflow implementation of Spherical Hashing.
Project description
Spherical Hashing
A Tensorflow 2 implementation of Spherical Hashing.
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 tf
x_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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tf-spherical-hashing-0.0.1.tar.gz
.
File metadata
- Download URL: tf-spherical-hashing-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
c9a86105fd944b26484043adb7b0d5057a658ee2709b031fef8ace244f24ae95
|
|
MD5 |
9211416d5954e68747b84baa0730a3e2
|
|
BLAKE2b-256 |
a37f975064e5c5e8f173d8cb44b0a360775da718a55f57dfb263c7e9c8b88ad8
|
File details
Details for the file tf_spherical_hashing-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: tf_spherical_hashing-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
c61d8c1701d55fabb9ecf7b43e0822397f32822857c8be00b58683f77e399b3b
|
|
MD5 |
ed50a838a16b49750edc1645e7b0c099
|
|
BLAKE2b-256 |
3b5d7d62cd7a36dab7afd6db0db39c4a65f42dddb4a054d675aa301b6f4932c1
|