FAILURE MAP
← Case archive

FA-97966 / Training label alignment / Open access

Soft targets are renormalized over only nonzero entries · case 01

Soft targets are renormalized over only nonzero entries.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The normalizer uses the number of positive classes rather than total probability mass.

THE FAILURE

The normalizer uses the number of positive classes rather than total probability mass.

Unsuccessful approach: Normalizing only positive entries handles sparse vectors but still biases unequal weights.

Case contract

For each row of nonnegative weights, return probabilities summing to one; an all-zero row stays all zero.

Why this case matters

A small deterministic training-data operation makes label ownership and ordering explicit.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows):
    return [[x/sum(1 for v in row if v>0) if x else 0 for x in row] for row in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal weights',solve([[N,2*N]]),[[1/3,2/3]])
check('already normalized',solve([[0.25,0.75]]),[[0.25,0.75]])
check('all zero',solve([[0,0]]),[[0,0]])
check('empty batch',solve([]),[])
check('singleton',solve([[N]]),[[1.0]])
check('sparse unequal',solve([[0,N,3*N]]),[[0,0.25,0.75]])
check('independent rows',solve([[N,0],[0,2*N]]),[[1.0,0],[0,1.0]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unequal weights[[0.5, 1.0]][[0.3333333333333333, 0.6666666666666666]]Failed
already normalized[[0.125, 0.375]][[0.25, 0.75]]Failed
all zero[[0, 0]][[0, 0]]Passed
empty batch[][]Passed
singleton[[1.0]][[1.0]]Passed
sparse unequal[[0, 0.5, 1.5]][[0, 0.25, 0.75]]Failed
independent rows[[1.0, 0], [0, 2.0]][[1.0, 0], [0, 1.0]]Failed

SHA-256 / 8a8923104fde3ecbe03d6c59e9b63e240063f0c48a94307b921cc786921d7f9a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows):
    return [[int(x>0)/(sum(int(v>0) for v in row) or 1) for x in row] for row in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal weights',solve([[N,2*N]]),[[1/3,2/3]])
check('already normalized',solve([[0.25,0.75]]),[[0.25,0.75]])
check('all zero',solve([[0,0]]),[[0,0]])
check('empty batch',solve([]),[])
check('singleton',solve([[N]]),[[1.0]])
check('sparse unequal',solve([[0,N,3*N]]),[[0,0.25,0.75]])
check('independent rows',solve([[N,0],[0,2*N]]),[[1.0,0],[0,1.0]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unequal weights[[0.5, 0.5]][[0.3333333333333333, 0.6666666666666666]]Failed
already normalized[[0.5, 0.5]][[0.25, 0.75]]Failed
all zero[[0.0, 0.0]][[0, 0]]Passed
empty batch[][]Passed
singleton[[1.0]][[1.0]]Passed
sparse unequal[[0.0, 0.5, 0.5]][[0, 0.25, 0.75]]Failed
independent rows[[1.0, 0.0], [0.0, 1.0]][[1.0, 0], [0, 1.0]]Passed

SHA-256 / 2f510b40ac18749606d969b4e1bdf273ab5f1fb0cd2cdd0c81093bb10eb5406a

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Weights are finite nonnegative numbers; output uses ordinary Python division. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:07.975849+00:00.

Case digest / d915d8f42966663d957dcea914773cb8aff2e6eee761aeab1d93fddd2078fd6f