Skip to content

Commit

Permalink
embedding small change + docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Aske-Rosted committed Jan 26, 2024
1 parent 15b64a2 commit 5d79ce7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graphnet/models/components/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, dim: int = 16, m: int = 10000) -> None:
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""Apply learnable forward pass to the layer."""
device = x.device
half_dim = self.dim
half_dim = self.dim // 2
emb = torch.log(torch.tensor(self.m, device=device)) / half_dim
emb = torch.exp(torch.arange(half_dim, device=device) * (-emb))
emb = x[..., None] * emb[None, ...]
Expand Down

0 comments on commit 5d79ce7

Please sign in to comment.