CatalogUniformSampler
- class rectools.models.nn.transformers.negative_sampler.CatalogUniformSampler(n_negatives: int, **kwargs: Any)[source]
Bases:
TransformerNegativeSamplerBaseClass to sample negatives uniformly from all catalog items.
- Parameters
n_negatives (int) – Number of negatives.
kwargs (Any) –
- Inherited-members
Methods
get_negatives(batch_dict, lowest_id, highest_id)Return sampled negatives.
- get_negatives(batch_dict: Dict, lowest_id: int, highest_id: int, session_len_limit: Optional[int] = None, **kwargs: Any) Tensor[source]
Return sampled negatives.
- Parameters
batch_dict (Dict) –
lowest_id (int) –
highest_id (int) –
session_len_limit (Optional[int]) –
kwargs (Any) –
- Return type
Tensor