Discussing the article: "Neural Networks in Trading: Adaptive Periodic Segmentation (Creating Tokens)"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Neural Networks in Trading: Adaptive Periodic Segmentation (Creating Tokens).
In the practical section of the previous article, we began developing an algorithm for adaptive periodic patching — one of the key elements of the LightGTS architecture. The limitations associated with the inability to use dynamic memory allocation in the runtime environments typical of MQL5 and OpenCL were examined in detail. These limitations forced us to abandon the idea of an arbitrary number of output tokens.
Instead, we made a strategically sound decision: to fix the number of patches and use patch overlap as a tool to compensate for variations in the length of individual segments. Thus, we managed to strike a balance between adaptability (the model remains sensitive to the actual periodicity of the time series) and computational stability, which is necessary for the efficient use of hardware resources. This approach made it possible to preserve both the fidelity of representation of the cyclic structures in the analyzed data and predictability in memory management, which is critical for high-frequency trading models and for implementation in a constrained execution context.
We have already implemented the algorithm for selecting the dominant frequency: it effectively extracts the main periodicity for each univariate sequence in the input time series. This will allow us to specify a base scale for subsequent data segmentation. Today, we will continue the work we started and take the next step: implement the token generation algorithm within the OpenCL context.
Our goal is to divide each time series into a fixed number of segments, with the segment size determined according to the identified dominant frequency, while the overlap controls adaptation to the window length. All of this must be performed in a strictly parallel manner, using GPU-compatible code, where each thread (work-item) is responsible for generating a single token in one of the univariate components of the sequence being analyzed.
Author: Dmitriy Gizlyk