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.2.tar.gz
(2.3 kB
view details)
File details
Details for the file torch-embed-sim-0.3.2.tar.gz
.
File metadata
- Download URL: torch-embed-sim-0.3.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc2f93fafc8ebd50e5e325ee80578396865384b9897aa9eb6777b496c9e492c6 |
|
MD5 | afbe4a7ed88418f96d0686055c85bf0d |
|
BLAKE2b-256 | 9513c59c9a3318dfcebc12c20e04286709da09b0bb49620ac5a380bbf8e21aae |