修正错误的冷启动权重调整#245
Open
Hongbro886 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 旨在修正冷启动模式下“频率因子”的权重调整逻辑,使抽取在冷启动阶段更偏向随机、降低频率相关的惩罚/偏置影响。
Changes:
- 将冷启动模式下频率因子的修正从
min(...)改为max(...),以改变冷启动阶段对factor的取值策略。
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if is_cold_start: | ||
| factor = min(0.8 + (factor * 0.2), factor) | ||
| factor = max(0.8 + (factor * 0.2), factor) |
Collaborator
|
@sentry review |
Contributor
Author
|
我想让 @lzy98276 来看看哪个符合设计意图 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app/common/history/weight_utils.py:161-183
def _calculate_frequency_factor(settings, total_count, max_total_count, is_cold_start):
……
if is_cold_start:
factor = min(0.8 + (factor * 0.2), factor)
只有当原factor>1.0时min才会选择新值。
原代码factor修正并不会更改factor的值
改为max则意味着在冷启动模式下这个抽取会更倾向于随机而不是频率惩罚