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.1.tar.gz (2.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: torch-embed-sim-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6fd6e1d2695e574c45842dff15edd0dfdca6532d282df2197a6c2eeb02919e5b
MD5 d630b4852a8698df06e92a880c80e9fb
BLAKE2b-256 7f8fea6dab558db7d8cba2220ca6f72ee0dbcce9728010e98c952dc5ed2932c2

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