alibaba / alibaba/x-deeplearning

invalid batch

Open
#353 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PureBasic
Stars
4.3k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

请问下,这个invalid batch 是怎么个逻辑计算的?代码没看明白、

raw_arr = np.column_stack((preds, labels))
raw_arr = sorted(raw_arr, key=lambda d: d[0])

auc = 0.
fp1, tp1, fp2, tp2 = 0., 0., 0., 0.
for record in raw_arr:
fp2 += 1 - record[1]
tp2 += record[1]
auc += (fp2 - fp1) * (tp2 + tp1)
fp1, tp1 = fp2, tp2

threshold = len(preds) - 1e-3
if tp2 > threshold or fp2 > threshold:
print('%s invalid batch' % self.name)
return

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the shown NumPy sorting and accumulation code, then trace where preds and labels are produced and how threshold is used. Determine what condition causes the invalid batch message and document the intended calculation and completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.