Skip to main content

Embedding similarity implemented in PyTorch

Project description

PyTorch Embedding Similarity

Travis Coverage

Install

pip install torch-embed-sim

Usage

from torch_embed_sim import EmbeddingSim


class Net(nn.Module):

    def __init__(self):
        super(Net, self).__init__()
        self.embed = torch.nn.Embedding(num_embeddings=10, embedding_dim=20)
        self.embed_sim = EmbeddingSim(num_embeddings=10)

    def forward(self, x):
        return self.embed_sim(self.embed(x), self.embed.weight)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch-embed-sim-0.3.0.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file torch-embed-sim-0.3.0.tar.gz.

File metadata

  • Download URL: torch-embed-sim-0.3.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

File hashes

Hashes for torch-embed-sim-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8c5af6156db55c4a020b14484d9c04a057ed1882150c3cb4283fef1cbf8f5874
MD5 386bf56fc28b328908029679b309ae27
BLAKE2b-256 d08fc5a3e643ff9d72cd8c0243193227f1eea945d5fab1ac9bc7c016258be90f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page