NVIDIA-Merlin / NVIDIA-Merlin/Transformers4Rec

Add option for projecting the `TransformerBlock` output + specifying the activation function `tf_out_act`

Open
#98 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/pytorch P1
Dominant language
Python
Stars
1.3k
Forks
165
Avg merge
1m
Merged PRs (30d)
2

Description

  • Add the option to project the output of the TransformerBlock pos_emb_pred with specific activation function tf_out_act:

pos_emb_pred =tf_out_act(nn.Linear(d_model, transformer_output_projection_dim)(pos_emb_pred)

  • This option is needed when the user want to project the output of the Transformer to specific dimension. For example to item_id embedding when using weight tying.

  • This projection will be included in the body of SequentialPredictionTask.

  • The projection_flag, the tf_out_act and the transformer_output_projection_dim should be set in the init of SequentialPredictionTask

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating SequentialPredictionTask and TransformerBlock, then inspect how pos_emb_pred is produced and whether projection or activation options already exist. Done means SequentialPredictionTask accepts projection_flag, tf_out_act, and transformer_output_projection_dim and can project the TransformerBlock output to the requested dimension with the selected activation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.