Discussing the article: "Working with ONNX Models in MQL5 (Part 3): Drawing the Neurons and the Weights Between Them"

Check out the new article: Working with ONNX Models in MQL5 (Part 3): Drawing the Neurons and the Weights Between Them.

We build a neuron-level view for MQL5 models: count neurons per row, compute ranks, and render one line per stored weight from dense layers. The implementation reads matrix orientation from attributes, colors connections by sign and relative strength, and keeps activations on the same row. You can toggle between the layer graph and neurons, or see why the neuron view is unavailable, to analyze how weights connect inputs to outputs.

In the previous part, we put the model on the chart and could finally see its shape. The layers sit in the right order, the branches read as branches, and clicking a weight tells us its range and its spread. What none of it shows is the network. A box marked "Gemm" with a row reading twenty-four by sixteen tells us a matrix is in there, and stops. The matrix holds which input reaches which neuron, whether each connection pushes or pulls, and which inputs dominate. None of that is drawn. We see the architecture, but the weights remain just numbers in a panel. This article is for MetaQuotes Language 5 (MQL5) developers and algorithmic traders who want to look inside a trained model rather than at its outline.

The way in is a detail worth stating plainly, because everything here follows from it. A dense layer's weight is a matrix, and that matrix is already the answer: the value at row sixteen, column three is the strength of the connection from the sixteenth input to the third neuron. In our previous article (Part 2), we parsed those numbers and left them sitting in a list. Now we draw them. We work out where each row of neurons sits, read each weight matrix as the connections joining two rows, and color every line by what it carries. We will cover the following topics:


Author: Allan Munene Mutiiria