Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1134 +/- ##
==========================================
+ Coverage 71.58% 72.88% +1.30%
==========================================
Files 84 79 -5
Lines 15221 15153 -68
==========================================
+ Hits 10896 11045 +149
+ Misses 3240 3012 -228
- Partials 1085 1096 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR implements Attentional Factorization Machines (AFM), a new model architecture that extends factorization machines with attention mechanisms and embedding support. The implementation renames the previous FMV2 model to AFM and adds support for item embeddings through attention layers.
Changes:
- Replaced FMV2 with AFM model throughout the codebase, including new attention-based embedding processing
- Updated the CTRSplit interface and related methods to support item embeddings as a third return value
- Added a new benchmark tool (gorse-benchmark) for evaluating model performance
- Fixed duplicate item filtering in chat ranking logic
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| model/ctr/model.go | Renamed FMV2 to AFM, added attention and linear layers for embedding encoding, updated BatchPredict/BatchInternalPredict signatures to accept embeddings, changed default hyperparameters |
| common/nn/layers.go | Added new Attention layer with attention mechanism using linear transformation, softmax, and element-wise multiplication |
| dataset/dataset.go | Extended CTRSplit interface to include embedding-related methods (Get returns embeddings, added GetItemEmbeddingDim/Index) |
| model/ctr/data.go | Updated Get method to return embeddings, modified Split to preserve embedding data, added helper methods for embedding dimensions/index |
| model/ctr/evaluator.go | Updated evaluation functions to handle embeddings parameter in predictions, fixed import ordering |
| model/ctr/model_test.go | Updated all test cases from NewFMV2 to NewAFM, added nil embeddings parameter to prediction calls |
| model/ctr/data_test.go | Added embedding data to test dataset, updated assertions to verify embedding handling |
| worker/pipeline.go | Updated CTR ranking to pass nil embeddings parameter to BatchPredict |
| worker/worker_test.go | Changed mock model creation from NewFMV2 to NewAFM |
| master/tasks.go | Updated CTR model creation and optimization to use NewAFM instead of NewFMV2 |
| master/rpc_test.go | Updated test model creation to use NewAFM |
| logics/chat.go | Added deduplication logic to prevent duplicate items in ranked results |
| cmd/gorse-benchmark/main.go | New benchmark tool for evaluating FM models with GAUC metrics |
| go.mod, go.sum | Updated golang.org/x/term dependency from v0.37.0 to v0.38.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.