Skip to content

Update DIEN docs, example and refactor AUGRU#229

Merged
1985312383 merged 1 commit into
datawhalechina:mainfrom
1985312383:fix-model-dien
Apr 24, 2026
Merged

Update DIEN docs, example and refactor AUGRU#229
1985312383 merged 1 commit into
datawhalechina:mainfrom
1985312383:fix-model-dien

Conversation

@1985312383
Copy link
Copy Markdown
Collaborator

Pull Request / 拉取请求

What does this PR do? / 这个PR做了什么?

Enrich DIEN documentation (EN/CN) and tutorial with detailed architecture, conventions (padding_idx/shared_with/loss_mode), usage examples and negative-sampling guidance. Add a runnable example script examples/ranking/run_dien.py that prepares data, builds negative histories, defines features and trains DIEN with CTRTrainer (loss_mode=False). Refactor torch_rechub/models/ranking/dien.py: rewrite AUGRU/AUGRU_Cell (move attention out of cell), use Xavier init, add masking/NaN-safe softmax, precompute attention scores, return sequence outputs, and add support for neg_history_features; update DIEN constructor/docstring and auxiliary-loss notes. Miscellaneous fixes to API examples and parameter defaults in docs to clarify correct embedding/sharing/padding usage.

Type of Change / 变更类型

  • 🐛 Bug fix / Bug修复
  • ✨ New model/feature / 新模型/功能
  • 📝 Documentation / 文档
  • 🔧 Maintenance / 维护

Related Issues / 相关Issues

Fixes #228

How to Test / 如何测试

python ./examples/ranking/run_dien.py   

Checklist / 检查清单

  • Code follows project style (ran python config/format_code.py) / 代码遵循项目风格(运行了格式化脚本)
  • Added tests for new functionality / 为新功能添加了测试
  • Updated documentation if needed / 如需要已更新文档
  • All tests pass locally / 所有测试在本地通过

Enrich DIEN documentation (EN/CN) and tutorial with detailed architecture, conventions (padding_idx/shared_with/loss_mode), usage examples and negative-sampling guidance. Add a runnable example script examples/ranking/run_dien.py that prepares data, builds negative histories, defines features and trains DIEN with CTRTrainer (loss_mode=False). Refactor torch_rechub/models/ranking/dien.py: rewrite AUGRU/AUGRU_Cell (move attention out of cell), use Xavier init, add masking/NaN-safe softmax, precompute attention scores, return sequence outputs, and add support for neg_history_features; update DIEN constructor/docstring and auxiliary-loss notes. Miscellaneous fixes to API examples and parameter defaults in docs to clarify correct embedding/sharing/padding usage.
@github-actions github-actions Bot added documentation Improvements or additions to documentation | 文档更新 enhancement New feature or request | 新功能 model New model or model improvement | 模型相关 labels Apr 23, 2026
@1985312383 1985312383 merged commit c54c949 into datawhalechina:main Apr 24, 2026
12 of 13 checks passed
@1985312383 1985312383 deleted the fix-model-dien branch April 24, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation | 文档更新 enhancement New feature or request | 新功能 model New model or model improvement | 模型相关

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] DIEN.auxiliary raises shape mismatch when batch_size > 1 (self.history_labels has no batch dim)

1 participant