reagent.samplers package
Submodules
reagent.samplers.frechet module
- class reagent.samplers.frechet.FrechetSort(shape: float = 1.0, topk: Optional[int] = None, equiv_len: Optional[int] = None, log_scores: bool = False)
Bases:
reagent.gym.types.Sampler- EPS = 1e-12
- log_prob(scores: torch.Tensor, action: torch.Tensor, equiv_len_override: Optional[torch.Tensor] = None) torch.Tensor
What is the probability of a given set of scores producing the given list of permutations only considering the top equiv_len ranks?
We may want to override the default equiv_len here when we know the having larger action space doesn’t matter. i.e. in Reels
- sample_action(scores: torch.Tensor) reagent.core.types.ActorOutput
Sample a ranking according to Frechet sort. Note that possible_actions_mask is ignored as the list of rankings scales exponentially with slate size and number of items and it can be difficult to enumerate them.
Module contents
- class reagent.samplers.FrechetSort(shape: float = 1.0, topk: Optional[int] = None, equiv_len: Optional[int] = None, log_scores: bool = False)
Bases:
reagent.gym.types.Sampler- EPS = 1e-12
- log_prob(scores: torch.Tensor, action: torch.Tensor, equiv_len_override: Optional[torch.Tensor] = None) torch.Tensor
What is the probability of a given set of scores producing the given list of permutations only considering the top equiv_len ranks?
We may want to override the default equiv_len here when we know the having larger action space doesn’t matter. i.e. in Reels
- sample_action(scores: torch.Tensor) reagent.core.types.ActorOutput
Sample a ranking according to Frechet sort. Note that possible_actions_mask is ignored as the list of rankings scales exponentially with slate size and number of items and it can be difficult to enumerate them.