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.

Files for torch-embed-sim, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size torch-embed-sim-0.3.2.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page