[Lane 2 · kotlin-core] Precision/Recall/F1 — extract Accuracy's class-matching helpers into a shared internal file
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- kotlin
調査の方向性
Start with Accuracy.kt and its existing tests, then move the listed class-matching helpers into ClassificationSupport.kt in the same package and route Accuracy.update through the shared per-sample entry point. Run ./gradlew :skainet-lang:skainet-lang-core:apiCheck and ./gradlew :skainet-backends:skainet-backend-cpu:jvmTest --tests "sk.ainet.exec.metrics.*". Done means the tests pass, the API dump is unchanged, and Accuracy.kt has no argmax or index-walking code of its own.
索引モデルが issue の本文から書いたものです。
説明
Sub-issue of #1222 (Precision, Recall and F1Score metrics).
Lane: 2 · Kotlin core (preparatory refactor)
Skill needed: Kotlin. No tensor-internals knowledge needed — everything you move already exists and already has tests.
Size: s (~2–3 h)
Blocked by: nothing. Unblocks #1226.
What to do
Accuracy.kt (skainet-lang/skainet-lang-core/src/commonMain/kotlin/sk/ainet/lang/nn/metrics/Accuracy.kt)
carries, as private members, all the class-matching machinery the three new metrics also
need: argmax, argmaxTarget, insertClassIndex, validateIndexTargetShapes,
validatePredictions, normalizeDim, iterateOverSamples, plus the "hard Int32 targets
vs. soft FP32/FP16 targets" dispatch and the binary-threshold branch in
computeWithIndexTargets / computeWithSoftTargets. Copying that three more times is the
duplication git blame will ask about in six months.
- Create
ClassificationSupport.ktin the same package. Move the helpers there as
internaltop-level functions (or oneinternal object ClassificationSupport). Keep
names and signatures; keep error messages, but make the"Accuracy …"prefixes
metric-agnostic (pass the metric name in, or drop it). - Add one
internalentry point that does the per-sample walk once for both target
kinds and hands(predictedClass, targetClass)pairs to a callback, e.g.
internal inline fun forEachPrediction(predictions, targets, dim, threshold, action: (predicted: Int, target: Int) -> Unit).
Accuracy.updatebecomes a ~5-line call to it that counts matches. This is what
ConfusionMatrixAccumulator(#1226) will call too. Accuracy's public surface must not change: same constructor, sameaccuracy()/
binaryAccuracy()factories, same behaviour. Run
./gradlew :skainet-lang:skainet-lang-core:apiCheck— the API dump must be unchanged
(everything you add isinternal).- Run the existing tests unchanged:
./gradlew :skainet-backends:skainet-backend-cpu:jvmTest --tests "sk.ainet.exec.metrics.*".
Acceptance
-
Accuracy.ktcontains no argmax / index-walking code of its own -
apiCheckpasses with no dump change -
AccuracyTestpasses unmodified - PR title
refactor(metrics): extract classification helpers from Accuracy (#1222)
Notes
Pure refactor — no new behaviour, so no new tests needed beyond the existing ones passing.
If you find Accuracy has a latent bug while you're in there (for example the
threshold branch reads logit index 1 when classCount == 2 but index 0 when
classCount == 1 — check that this is intended), don't fix it here; open a separate
bug and link it on the parent.
- 主要言語
- Kotlin
- スター
- 52
- フォーク
- 15
- 平均マージ
- 23時間 34分
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SKaiNET-developers/SKaiNET のほかの issue
-
native-cpu: -Wreturn-type in skainet_row_threads.c:150 (worker fn has no return)対応中かも @Doomguy-BFG9000 が 1 日前に担当しました。 オープンgood first issue size:xs skill:native
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
SKaiNET-developers/SKaiNET#1358 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
coding good first issue platform size:xs skill:js sub-issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SKaiNET-developers/SKaiNET#1232 ·
メンテナーはふだん 1 日以内に返信
-
Ternary decode on 4× Cortex-A78C: row-thread pool only 40–60 % busy, 1.8 tok/s (BitNet 2B4T) — dispatch-bound, not bandwidth-bound対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンcompute-backend research skill:native
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SKaiNET-developers/SKaiNET#1357 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug platform skill:native
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
SKaiNET-developers/SKaiNET#1356 ·
メンテナーはふだん 1 日以内に返信
-
enhancement platform skill:native sub-issue
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
SKaiNET-developers/SKaiNET#1301 ·
メンテナーはふだん 1 日以内に返信
SKaiNET-developers/SKaiNET の issue をすべて見る
似ている issue
-
[Submission] 悠悠有品オープンsubmit-adaption submit-adaption-pre
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
BetterAndroid/android-notification-icon-project#763 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
scarif-labs/horus#61 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
damontecres/Wholphin#2093 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
FossifyOrg/Messages#929 ·
メンテナーはふだん 1 日以内に返信
-
cr:missing-repro cr:platform:android missing-repro platform:android
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
software-mansion/react-native-screens#4950 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信