Warrior_EA/AI
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnimateDread f2ec1edf84 feat(ai): logit-adjusted loss, replacing oversampling and the post-hoc prior
Menon et al. 2021 (ICLR), "Long-tail learning via logit adjustment": add
tau*log(prior_c) to each class logit inside the training gradient. Softmax
CE on adjusted logits is consistent for BALANCED error - the metric
checkpoint selection already ranks on - so the loss and the deploy decision
finally optimize the same thing.

The engine already computed a true softmax + categorical-CE gradient and
wrote it over the per-neuron sigmoid delta, so this is an offset added to
three logits in the two places that gradient is built (backProp scalar path
and backPropOCL). No backend, kernel or DLL change; the forward pass and
every inference path are untouched, which is the point - the network learns
to absorb the offset, so its raw argmax becomes the balanced-optimal
decision with nothing applied at inference.

Replaces rather than stacks. Minority replay is disabled while this is on,
and the post-hoc inference prior is forced off. Stacking is not a
theoretical worry: simulated on the measured 1118/1119/34298 distribution
in the weak-signal regime, plain CE collapses to Neutral (33.4% balanced,
Buy 0%), replay reaches 48.1%, logit adjustment 50.9% with better balance -
and BOTH together score 45.4% with Neutral recall at 0%, worse than either
alone. Buda et al. 2018 predicts exactly that.

Motivation from the six-chart run: every topology took one direction to
~50% recall and abandoned the other, the direction chosen arbitrarily (the
batch-norm control went Buy 1% / Sell 42%, the inverse of the other five).
One era in 1,301 cleared the per-class recall floor.

Fingerprinted conditionally, so the converged 60.7% models on disk keep
their filenames and stay loadable as the fallback.

Both builds compile 0 errors, 0 warnings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 19:05:14 -04:00
..
ArrayLayer.mqh refactor(AI): split 8 self-contained classes out of the Network.mqh god-file 2026-07-18 16:13:03 -04:00
BufferDouble.mqh fix: add error logging for buffer failures and reject trades on invalid stop loss 2026-07-26 12:12:14 -04:00
LayerDescription.mqh feat(ai): batch normalization between dense layers 2026-07-29 12:34:29 -04:00
Network.cl fix: remove broken DFA optimizer, use plain gradient descent 2026-07-29 00:03:54 -04:00
Network.mqh feat(ai): logit-adjusted loss, replacing oversampling and the post-hoc prior 2026-07-29 19:05:14 -04:00
NeuronBatchNorm.mqh fix(ai): freeze batch-norm statistics when comparing two forward passes 2026-07-29 12:37:50 -04:00
NeuronCPU.mqh fix: remove broken DFA optimizer, use plain gradient descent 2026-07-29 00:03:54 -04:00
NeuronDirectML.mqh feat(opencl): add feedback alignment support to weight update kernels 2026-07-28 15:01:40 -04:00
NeuronOCLConvPool.mqh fix: remove broken DFA optimizer, use plain gradient descent 2026-07-29 00:03:54 -04:00
NeuronPrimitives.mqh fix: correct CLayer::CreateElement signature to prevent model load failures 2026-07-25 12:02:38 -04:00