Warrior_EA/AI/Impl
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnimateDread 7414570d9d fix(diagnostics+calibration): the frozen-layer reading was a broken ruler; gate the operating point on a null of the maximum
Two defects behind the "training is highly unstable" report, from 101 eras of
SP500 H4 PAI logs. Neither was the optimizer.

1) LayerLearningReport's dW/W for BN layers divided by the WHOLE packed block.
   getWeightsBN concatenates the outgoing dense matrix, gamma/beta, the running
   mean/variance, the Adam moments AND BN_OPT_NX - the forward-pass scratch copy
   of the normalized input. At era 101 bn1's dense matrix normed 15.1 against a
   block norm of 15430.3, of which NX alone was 15429.3: the weights were 0.098%
   of their own denominator, a 1022x inflation. NX is also near-constant between
   era-end reports (same last forward pass), which pins the numerator down too,
   so the layer read "bn1:0.000%" for 101 consecutive eras and was diagnosed as a
   frozen first layer. It was the ruler that was broken. The ratio now covers
   trainable parameters only (dense matrix + gamma + beta); mean/var/NX/Adam are
   excluded. NX is reported separately because it is a health signal in its own
   right - bn5 read nx 6.8e6 over 16 neurons, ~1.7e6 per unit against a healthy
   ~1.0, which is what a near-zero running variance in the denominator looks like.

   NO historical dW/W reading on a bn* layer is admissible evidence that a layer
   did or did not train. That includes every such claim in this repo's notes.

2) FitDirConfThreshold took a bare argmax of coverage x (precision - breakEven)
   over 50 bins. Measured across 98 consecutive fits:

     correlation(chosen threshold, win rate at it) = -0.056 over 0.00..0.74
     win rate stdev across fits                    = 1.32pp
     binomial SE of that win rate at ~1430 calls   = 1.25pp

   The correlation is zero - the margin does not rank trades - and the era-to-era
   spread IS its own sampling error to within 0.07pp. So the objective was
   coverage x (3.4 +/- 1.3) and the argmax over ~37 eligible bins returned
   whichever bin drew the luckiest sample. The threshold teleported
   0.42 -> 0.04 -> 0.74 in three eras, swinging OOS coverage 0% -> 39%, leaving
   the era win rate measured on 1-5 calls and swinging 0% <-> 100%. That is the
   entire reported instability.

   The argmax is now adopted only if it beats a DETERMINISTIC fallback - the most
   selective bin still clearing the coverage floor, chosen from the margin
   distribution alone and never from a win rate - by more than a best-of-N
   maximum could manage on noise, sqrt(2 ln N) standard errors. Same null-of-the-
   maximum correction the deploy gate already applies to model selection.

   A plain one-standard-error band was tried first and is NOT sufficient: its
   edge is bestScore - bestSE, and with a 2.3pp edge against a 1.25pp SE that
   edge is itself +/-50%, so the admitted set would still wander by half its own
   width every era. The fallback has to be independent of the noisy quantity.

   Simulated on the observed numbers: falls back every era at the current 2.3pp
   edge (stable), adopts the argmax once a real edge reaches ~5pp.

NOT COMPILED - user compiles.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 23:44:26 -04:00
..
Layer.mqh refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
NetBuild.mqh fix: live trades now use the geometry the gate certifies; perf: BN kernels 2026-08-09 17:51:40 -04:00
NetForward.mqh feat: S2 meta-labeling head - binary trade-quality model over the classic-candidate corpus 2026-08-13 06:52:31 -04:00
NetPersistence.mqh fix: improve error messages and suppress false sharing-violation logs 2026-08-02 01:09:18 -04:00
NetWeights.mqh fix(diagnostics+calibration): the frozen-layer reading was a broken ruler; gate the operating point on a null of the maximum 2026-08-16 23:44:26 -04:00
NeuronBase.mqh refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
NeuronConvPool.mqh refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
NeuronLSTM.mqh refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
NeuronOCLBase.mqh fix: dense backprop read the weight matrix transposed - on every backend 2026-08-11 18:06:09 -04:00
NeuronOCLLSTM.mqh feat: mini-batch gradient accumulation (F4), front-end-aware capacity budget (F6), split Wyckoff categoricals (N1) 2026-08-09 11:48:03 -04:00