(
cls,
weights: torch.Tensor, # [V, D]
epsilon: float = 0.2,
)
| 668 | fn: Callable[..., torch.Tensor] |
| 669 | |
| 670 | def prepare(self) -> "SimpleSampler": |
| 671 | return self |
| 672 | |
| 673 | def sample(self, **kwargs) -> torch.Tensor: |
| 674 | return self.fn(**kwargs) |
| 675 | |
| 676 | |
| 677 | @dataclass |
| 678 | class JLSampler(Sampler): |
| 679 | weights: torch.Tensor # [V, D] |
| 680 | k: int |