Skip to main content

Embedding similarity implemented in PyTorch

Project description

PyTorch Embedding Similarity

Travis Coverage


pip install torch-embed-sim


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

Uploaded source

Supported by

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