tensorflow / tensorflow/recommenders
Usage of the parameter of candidate_ids and num_hard_negatives?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 300
- PR merge metrics
- No merged PRs in 30d
Description
parameter num_hard_negatives: when i set it as an integer lower than batch_size, the loss would not slow down.
parameter candidate_ids : I do not know how to use it.
I will be grateful if anyone knows the usage of the above parameters and leave a message to me!
tfrs.tasks.Retrieval(
loss: Optional[tf.keras.losses.Loss] = None,
metrics: Optional[tfrs.metrics.FactorizedTopK] = None,
temperature: Optional[float] = None,
num_hard_negatives: Optional[int] = None,
name: Optional[Text] = None
) -> None
call(
query_embeddings: tf.Tensor,
candidate_embeddings: tf.Tensor,
sample_weight: Optional[tf.Tensor] = None,
candidate_sampling_probability: Optional[tf.Tensor] = None,
candidate_ids: Optional[tf.Tensor] = None,
compute_metrics: bool = True
) -> tf.Tensor
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the tfrs.tasks.Retrieval API and its call signature, focusing on num_hard_negatives and candidate_ids. Review the surrounding API documentation or implementation to determine their intended inputs and behavior; done means providing clear usage guidance for both parameters, including the reported lower-than-batch_size case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100