Generalize noise_corrected_bce to multiclass (num_out > 1)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Start with NoiseCorrectedBCEWithLogitsLoss and the branch in training.py that dispatches noise_corrected_bce separately from cross_entropy, then read parse_label_noise_rate and the config.json recording. The CLI surface (extend the existing loss or add noise_corrected_ce, plus --noise-sink-class) is still undecided, so confirm it with maintainers first. Done means a multiclass path that matches plain cross-entropy when rates are zero, plus a synthetic-recovery unit test and CHANGELOG entry.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Motivation
--loss noise_corrected_bce (#279, NoiseCorrectedBCEWithLogitsLoss) is strictly binary — a single scalar flip rate rho per source_group, sigmoid-based (Patrini et al. 2017's 2x2 forward correction). training.py dispatches it as a separate branch from cross_entropy with no num_out > 1 path at all.
rnabioco/2026-aa-trna-models's production-v4 corpus is exactly the motivating case this loss was built for, except it's multiclass: a 20+1-class charge-aware classifier (20 amino acids + uncharged) where a chunk's "charged" label is measured to be wrong for a known fraction of reads in a given arm — a matched no-enzyme/no-amino-acid control's own cl-classifier false-positive rate gives a per-arm purity directly (already computed in that repo's charging_elevation_precheck.json, e.g. GlnRS_gln_b3 purity 0.959, ThrRS_thr_b3 purity 0.052). The noise is structured, not a dense confusion matrix: for amino-acid class i with purity π_i, a (1 - π_i) fraction of reads labeled i should actually be labeled uncharged — there is exactly one "sink" class the noise mass flows to, the same shape noise_corrected_bce already handles for binary.
Right now the only way to use the existing loss on that corpus is to decompose it into N binary one-vs-all classifiers (one per amino acid), losing the unified multiclass model and its shared representation.
Proposed mechanism
Generalize the existing forward-correction approach to num_out > 1:
- Model emits softmax probabilities
poverCclasses (an estimate of the true-label posterior). - A per-
source_groupnoise structure mapspto the observed-label distribution:P(observed = j) = sum_i T[i, j] * p_i, and the loss is NLL against the observed label under that corrected distribution. - For this project's use case,
Tis sparse and simple: each classihas one scalar purityπ_iand one designated sink classs(here,uncharged) that absorbs all its noise mass — i.e.T[i, i] = π_i,T[i, s] = 1 - π_i,T[i, j] = 0otherwise, and the sink class's own row is identity (T[s, s] = 1, clean). This is a direct generalization of the existing binary 2x2 matrix, not a new noise model. - A fully dense per-group
C x Cmatrix would be more general but is not needed to unblock this project — see non-goals.
Suggested CLI surface
- Either extend
--loss noise_corrected_bceto accept--num-out > 1, or add a new value (e.g.noise_corrected_ce) that shares the same--label-noise-rate group=rate[,group=rate,...]parsing already in place (parse_label_noise_rate). - A new flag to name the sink class the noise mass flows to for the multiclass case, e.g.
--noise-sink-class uncharged(or an index) — no equivalent needed in the binary case since there's only one other class. - Same "measured upstream, not estimated by leech" contract as today; unmapped
source_groupvalues still default to rate 0 (no correction).
Acceptance criteria
leech model train --num-out N --loss noise_corrected_bce --label-noise-rate group=rate,... --noise-sink-class LABEL(N > 2) trains without error and produces a valid multiclass checkpoint.- With every group's rate at 0 (or no
--label-noise-ratepassed at all), output matches plaincross_entropybit-for-bit or to floating-point precision — mirroring the existing binary short-circuit (noise_rate is Nonefast path) inNoiseCorrectedBCEWithLogitsLoss. - Unit tests analogous to the existing binary loss's: a synthetic multiclass dataset with a known, injected class-conditional flip rate into a single sink class recovers the true posterior better under the corrected loss than under plain CE, measured on a held-out clean-labeled validation set.
config.jsonrecords the resolved noise-rate mapping and sink class the same way the binary loss's config recording works today, so a checkpoint is auditable after the fact.- Documented in CLI help and CHANGELOG, same shape as #279's entry.
Non-goals
- No automatic noise-rate estimation — rates are supplied by the caller, same as today.
- No fully dense per-group
C x Ctransition matrix on day one — the single-sink-class structure above is sufficient for this project's use case; a dense matrix can be a fast-follow if there's demand elsewhere. - No changes to
data prepareor thesource_groupchunk-metadata field/lookup semantics — reuse exactly whatnoise_corrected_bcealready reads.
Reference
Motivated by rnabioco/2026-aa-trna-models production-v4 (issue #31 Phase 2, PR #36) and its version-bump retrain (PR #39) — happy to share the full per-arm purity table (charging_elevation_precheck.json's per_class_purity) if useful for building/validating the synthetic test case.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 0
- Merge trung bình
- 11 giờ 17 phút
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rnabioco/leech
-
load_model_from_checkpoint drops num_out/signal_in_channels for models whose __init__ takes **kwargsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
model train-many: one launcher that owns an allocation and trains a queue of configs across its GPUsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rnabioco/leech
Issue tương tự
-
docs: powerpc not supportedĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/TokenEconomizer#360 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
reasons-gate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
benthomasson/reasons-service#190 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày