Discussing the article: "Neural Networks in Trading: Parameter-Efficient Transformer with Segmented Attention (Final Part)"

 

Check out the new article: Neural Networks in Trading: Parameter-Efficient Transformer with Segmented Attention (Final Part).

In the previous work, we discussed the theoretical aspects of the PSformer framework, which includes two major innovations in the classical Transformer architecture: the Parameter Shared (PS) mechanism and attention to spatio-temporal segments (SegAtt). In this article, we continue the work we started on implementing the proposed approaches using MQL5.

In the previous article, we explored the theoretical aspects of the PSformer framework, which introduces two key innovations into the vanilla Transformer architecture: the Parameter Sharing (PS) mechanism and Spatial-Temporal Segmented Attention (SegAtt).

To recap, the authors of PSformer proposed an encoder based on the Transformer architecture, featuring a two-level segmented attention structure. Each level includes a parameter-sharing block consisting of three fully connected layers with residual connections. This architecture reduces the total number of parameters while maintaining effective information exchange within the model.

Segments are generated using a patching method, where time series variables are divided into patches. Patches with the same position across different variables are grouped into segments, representing a spatial extension of a single-variable patch. This segmentation enables efficient organization of multidimensional time series into multiple segments.

Within each segment, attention focuses on identifying local spatial-temporal relationships, while information integration between segments improves overall forecast quality.


Author: Dmitriy Gizlyk

 
I have been getting errors from the math.math/mqh file. If there are any solutions to this, it would be greatly appreciated.
 
In places where the error occurs, replace MathPow with :: MathPow , this will allow you to access compiler functions, and not those declared in the class.
Документация по MQL5: Математические функции / MathPow
Документация по MQL5: Математические функции / MathPow
  • www.mql5.com
Возводит основание в указанную степень. Параметры base [in]  Основание. exponent [in]  Значение степени. Возвращаемое значение Значение...
 

when i compile  Research.mq5 file i get this error 

and when i compile ResearchRealORL.mq5 file  i get this error 


and when i compile Study.mq5 file i get this error 

Almost the same mistake repeated, what did I do wrong?


and when i compile Test.mq5 file i get this error 


 
FSAmasterAccount #:
I have been getting errors from the math.math/mqh file. If there are any solutions to this, it would be greatly appreciated.
Hello.
Have you managed to fix the errors? I am stuck with those errors as well unfortunately. I had done what the author suggested but they still persists.