 fix(ai): drop the conv pooling stage - it reduced across filters, not time
FeedForwardConv emits POSITION-MAJOR output, matrix_o[out + window_out * i],
so one bar's window_out filter responses are contiguous and consecutive bars
sit window_out apart. Both pooling implementations (FeedForwardProof and
CPU_FeedForwardProof) slide FLAT over that buffer - pos = i * step, reducing
`window` CONSECUTIVE elements. On a position-major layout those neighbours
are different FILTERS of the same bar, never one filter across time.
At the shipped 3/2 the pool computed max(bar0_f0, bar0_f1, bar0_f2), then
max(bar0_f2, bar0_f3, bar0_f4), with every 8th window straddling a bar
boundary. So it collapsed unrelated feature detectors into whichever fired
hardest, passed gradient to that winner only, and halved the feature map
while doing it - all below every learnable layer, where nothing above can
recover it. The removed inputs' own labels ("3 Bars") show time-axis pooling
was the intent throughout.
Measured cost: CONV sat pinned at ~40% balanced accuracy for 510 eras with
Sell recall 0%, while plain MLPs on the same data reached 57-61%. HYBRID,
which also carried this stage, came second-worst of the batch-norm group.
Not fixable in the topology: pooling one filter across time needs a stride
of window_out BETWEEN samples within a window, which a consecutive-window
kernel cannot express at any window/step. That needs a stride-aware kernel
in Network.cl + WarriorCPU.cpp + WarriorDML.cpp and a DLL rebuild, and is
only worth doing if a conv front-end earns its place without downsampling
first - with 20 sliding positions there is little to gain by halving them.
ConvPoolWindow/ConvPoolStep and their enums are removed with it, along with
the |CP: fingerprint term added earlier today.
Both builds compile 0 errors, 0 warnings.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 19:28:44 -04:00 | | | //+------------------------------------------------------------------+
|
2026-07-13 03:23:39 -04:00 | | | //| Warrior_EA |
|
| | | //| AnimateDread |
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "..\Expert\ExpertSignalAIBase.mqh"
|
| | | // wizard description start
|
| | | //+------------------------------------------------------------------+
|
| | | //| Description of the class |
|
| | | //| Title=Signals of indicator 'Convolutional AI' |
|
| | | //| Type=SignalAdvanced |
|
| | | //| Name=Convolutional AI |
|
| | | //| ShortName=CONV |
|
| | | //| Class=CSignalCONV |
|
| | | //| Page=signal_conv |
|
| | | //+------------------------------------------------------------------+
|
| | | // wizard description end
|
| | | //+------------------------------------------------------------------+
|
| | | //| Class CSignalCONV. |
|
| | | //| Purpose: Class of generator of trade signals based on |
|
| | | //| the 'Convolutional AI Neural Network. |
|
| | | //| Is derived from the CExpertSignalAIBase class. |
|
| | | //| Only the network topology differs from the other AI signals: an |
|
| | | //| input layer feeds a Conv+Pool stage before the common tapering |
|
| | | //| hidden-layer stack (see AddCustomLayers). |
|
| | | //+------------------------------------------------------------------+
|
| | | class CSignalCONV : public CExpertSignalAIBase
|
| | | {
|
| | | protected:
|
| | | virtual bool AddCustomLayers(CArrayObj *topology) override;
|
2026-07-30 15:20:30 -04:00 | | | //--- keep in step with AddCustomLayers below - see the base declarations.
|
| | | virtual bool UsesConvStage(void) const override { return true; }
|
2026-07-13 03:23:39 -04:00 | | | public:
|
| | | CSignalCONV(void);
|
| | | };
|
| | | //+------------------------------------------------------------------+
|
| | | //| Constructor |
|
| | | //+------------------------------------------------------------------+
|
| | | CSignalCONV::CSignalCONV(void)
|
| | | {
|
| | | SetIdentity("Convolutional", "CONV");
|
| | | }
|
| | | //+------------------------------------------------------------------+
|
| | | //| Conv + Pool layers inserted between the input layer and the |
|
| | | //| common tapering hidden-layer stack. |
|
| | | //+------------------------------------------------------------------+
|
| | | bool CSignalCONV::AddCustomLayers(CArrayObj *topology)
|
| | | {
|
 fix(ai): drop the conv pooling stage - it reduced across filters, not time
FeedForwardConv emits POSITION-MAJOR output, matrix_o[out + window_out * i],
so one bar's window_out filter responses are contiguous and consecutive bars
sit window_out apart. Both pooling implementations (FeedForwardProof and
CPU_FeedForwardProof) slide FLAT over that buffer - pos = i * step, reducing
`window` CONSECUTIVE elements. On a position-major layout those neighbours
are different FILTERS of the same bar, never one filter across time.
At the shipped 3/2 the pool computed max(bar0_f0, bar0_f1, bar0_f2), then
max(bar0_f2, bar0_f3, bar0_f4), with every 8th window straddling a bar
boundary. So it collapsed unrelated feature detectors into whichever fired
hardest, passed gradient to that winner only, and halved the feature map
while doing it - all below every learnable layer, where nothing above can
recover it. The removed inputs' own labels ("3 Bars") show time-axis pooling
was the intent throughout.
Measured cost: CONV sat pinned at ~40% balanced accuracy for 510 eras with
Sell recall 0%, while plain MLPs on the same data reached 57-61%. HYBRID,
which also carried this stage, came second-worst of the batch-norm group.
Not fixable in the topology: pooling one filter across time needs a stride
of window_out BETWEEN samples within a window, which a consecutive-window
kernel cannot express at any window/step. That needs a stride-aware kernel
in Network.cl + WarriorCPU.cpp + WarriorDML.cpp and a DLL rebuild, and is
only worth doing if a conv front-end earns its place without downsampling
first - with 20 sliding positions there is little to gain by halving them.
ConvPoolWindow/ConvPoolStep and their enums are removed with it, along with
the |CP: fingerprint term added earlier today.
Both builds compile 0 errors, 0 warnings.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 19:28:44 -04:00 | | | return AddConvStage(topology);
|
2026-07-13 03:23:39 -04:00 | | | }
|
| | | //+------------------------------------------------------------------+
|