Skip to content
All library documents

Designing Flexible Feedforward Neural Networks with Matrix Operations

Article MQL5 articles

Summary

This article explains how to build configurable feedforward neural networks in MQL5 using matrix operations instead of hard-coded layer calculations. It represents each layer’s computation as an input–weight product plus a bias, and describes allocating weights for networks whose hidden layers can have different numbers of nodes. The example architecture is intended to exercise cases where layer widths increase, decrease, or stay equal.

The design lets users set hidden-layer sizes, choose separate activation functions for hidden and output layers, and optionally specify output width. The article notes that its default output-size behavior is unreliable for classification, so users should set output neurons to match their targets. It provides implementation traces to illustrate the calculations, but no trading evaluation or evidence that the network predicts markets effectively. The author characterizes the model as basic and says useful performance depends on optimization.

Key ideas

  • Matrix multiplication allows layer calculations to support variable input and output widths.
  • Weights and biases should be initialized once and reused across the training epochs.
  • The design supports different activation functions for hidden and output layers.
  • Output-layer width should be set to match the prediction targets, especially for classification.
  • The article demonstrates implementation mechanics but does not establish trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.