Visualizing ONNX Model Graphs in MQL5
Summary
This article explains how to extend an ONNX model parser and display the network as an interactive graph in an MQL5 chart panel. It derives connections by matching node output names to input names, then assigns nodes to depth-based ranks so branches appear side by side and merged paths converge. Tensor shapes label connections, while node attributes and tensor data populate an inspector for selected layers.
The implementation also covers a clipped drawing canvas, graph layout, routed connections, and mouse controls for panning and zooming. The article describes parser structures for retaining node attributes, tensor dimensions, weight statistics, and a limited number of tensor values. It is a software visualization tutorial rather than a trading strategy or evidence that inspecting model graphs improves trading results. Its practical scope is limited by fixed capacity ceilings and the displayed-weight limit; the next installment is described as a deeper view of neurons and weights.
Key ideas
- Connections can be reconstructed by matching the value names a node emits and consumes.
- Depth-based ranks make parallel branches and joins visible in the graph layout.
- Node attributes and tensor shapes provide context for inspecting model layers and connections.
- A clipped chart canvas supports graph rendering while keeping drawing within the panel.
- The parser retains tensor statistics and a capped subset of values for display.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.