Commit 7207983
PR #1290 CI Cluster 6 #1304:
OccupancyNeuralNetworkTests.LossStrictlyDecreasesOnMemorizationTask was
reported to be fixed by PR #1329's BatchNorm→LayerNorm swap, but the test
was still red on master with loss step 1=0.6936, step 100=0.7032 (slightly
INCREASING) — model stuck at the BCE-ln(2) baseline through 100 gradient
steps.
## Root cause
PR #1329 fixed the BN-at-batch-1 degeneracy (σ²=0 → y=β collapses the
gradient through normalization) but the *Dropout layer*'s
memorization-blocking effect was not addressed. The default Occupancy
layer stack was:
Dense(64)+ReLU → LayerNorm → Dropout(0.3) → Dense(32)+ReLU
→ LayerNorm → Dropout(0.2) → Dense(16)+ReLU → Dense(out)+Sigmoid
Under the model-family LossStrictlyDecreasesOnMemorizationTask invariant
— train the SAME (x, target) pair for 100 iterations and assert loss
strictly decreases — every forward pass under Dropout sees a DIFFERENT
random sub-network (~56% of hidden units active = 0.7 × 0.8). On a
3 → 64 → 32 → 16 → 1 MLP (~2k params), the per-step mask randomness
injects more variance than the gradient can subtract over 100 steps,
leaving loss flat or slightly RISING at the BCE-ln(2) baseline.
## Fix
Remove Dropout from both `CreateDefaultOccupancyLayers` and
`CreateDefaultOccupancyTemporalLayers` in `LayerHelper<T>`. At this
network size Dropout adds no useful regularization (the model has fewer
params than typical sensor batches have rows); callers who genuinely
need regularization on a larger Occupancy MLP can pass an explicit
architecture with their preferred Dropout rate.
## Verification
$ dotnet test --filter "FullyQualifiedName~OccupancyNeuralNetworkTests"
Passed! - Failed: 0, Passed: 21, Skipped: 0, Total: 21
All 21 OccupancyNN tests pass (was 1 failing).
The 4 remaining #1304 tests post-fix:
- SimCSETests.TrainingError_ShouldNotExceedTestError
PASS (was passing already on current master)
- SimCSETests.Training_ShouldChangeParameters
PASS (was passing already on current master)
- DenseNetNetworkTests.MoreData_ShouldNotDegrade
Adam-overshoot divergence (200-iter loss > 50-iter loss);
separate follow-up issue
- NEATTests.Training_ShouldReduceLoss
timeout (perf gap, similar to #1390); separate follow-up issue
Closes #1304 partially. DenseNet + NEAT follow-ups tracked separately.
Co-authored-by: franklinic <franklin@ivorycloud.com>
1 parent ce00cfd commit 7207983
1 file changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
790 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
791 | 795 | | |
792 | 796 | | |
793 | | - | |
794 | 797 | | |
795 | 798 | | |
796 | 799 | | |
797 | | - | |
798 | 800 | | |
799 | 801 | | |
800 | 802 | | |
| |||
879 | 881 | | |
880 | 882 | | |
881 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
882 | 903 | | |
883 | 904 | | |
884 | | - | |
885 | 905 | | |
886 | 906 | | |
887 | 907 | | |
888 | | - | |
889 | 908 | | |
890 | 909 | | |
891 | 910 | | |
| |||
0 commit comments