Embedding similarity implemented in PyTorch
Project description
PyTorch Embedding Similarity
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
Release history Release notifications | RSS feed
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 hashes)