shenweichen / DeepMatch

A deep matching model library for recommendations & advertising. It's easy to train models and to export representation vectors which can be used for ANN search.
https://deepmatch.readthedocs.io/en/latest/
Apache License 2.0
2.22k stars 530 forks source link

support different negative sampling strategies #81

Closed shenweichen closed 2 years ago

shenweichen commented 2 years ago
  1. add deepmatch.utils.NegativeSampler
  2. remove deepmatch.layers.core.NegativeSampler
  3. add temperature,sampler_config,loss_type for models
  4. add some google colab scripts
codecov[bot] commented 2 years ago

Codecov Report

Merging #81 (466ae25) into master (be6c028) will decrease coverage by 0.22%. The diff coverage is 92.12%.

@@            Coverage Diff             @@
##           master      #81      +/-   ##
==========================================
- Coverage   89.13%   88.91%   -0.23%     
==========================================
  Files          14       14              
  Lines         847      911      +64     
==========================================
+ Hits          755      810      +55     
- Misses         92      101       +9     
Flag Coverage Δ
pytest 88.91% <92.12%> (-0.23%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
deepmatch/layers/sequence.py 76.81% <ø> (ø)
deepmatch/layers/interaction.py 81.89% <33.33%> (ø)
deepmatch/utils.py 80.76% <85.71%> (+1.28%) :arrow_up:
deepmatch/models/dssm.py 97.05% <92.30%> (-2.95%) :arrow_down:
deepmatch/models/fm.py 97.05% <92.30%> (-2.95%) :arrow_down:
deepmatch/layers/core.py 90.66% <93.84%> (-1.13%) :arrow_down:
deepmatch/__init__.py 100.00% <100.00%> (ø)
deepmatch/layers/__init__.py 100.00% <100.00%> (ø)
deepmatch/models/mind.py 95.18% <100.00%> (+0.05%) :arrow_up:
deepmatch/models/ncf.py 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update be6c028...466ae25. Read the comment docs.