Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Robotics-STAR-Lab/H2-Mapping
/ gumbel_like
Function
gumbel_like
mapping/src/utils/sample_util.py:5–6 ·
view source on GitHub ↗
(u)
Source
from the content-addressed store, hash-verified
3
4
def
sampling_without_replacement(logp, k):
5
def
gumbel_like(u):
6
return
-torch.log(-torch.log(torch.rand_like(u) + 1e-7) + 1e-7)
7
8
scores = logp + gumbel_like(logp)
9
return
scores.topk(k, dim=-1)[1]
Callers
1
sampling_without_replacement
Function · 0.85
Calls
1
log
Method · 0.80
Tested by
no test coverage detected