Skip to main content

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

Release files for tf-spherical-hashing 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tf-spherical-hashing 0.0.1
File Size Uploaded
tf-spherical-hashing-0.0.1.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tf-spherical-hashing 0.0.1
File Interpreter ABI Platform
tf_spherical_hashing-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / tf-spherical-hashing-0.0.1.tar.gz

Download URL tf-spherical-hashing-0.0.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c9a86105fd944b26484043adb7b0d5057a658ee2709b031fef8ace244f24ae95
BLAKE2b-256 checksum
How to use checksums
a37f975064e5c5e8f173d8cb44b0a360775da718a55f57dfb263c7e9c8b88ad8
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / tf_spherical_hashing-0.0.1-py3-none-any.whl

Download URL tf_spherical_hashing-0.0.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c61d8c1701d55fabb9ecf7b43e0822397f32822857c8be00b58683f77e399b3b
BLAKE2b-256 checksum
How to use checksums
3b5d7d62cd7a36dab7afd6db0db39c4a65f42dddb4a054d675aa301b6f4932c1
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page