## 2 Method Description
### Grammatical Evolution  
Grammatical evolution can be considered as a genetic algorithm with integer chromosomes. These chromosomes stand for a series of production rules in a grammar expressed in the Backus-Naur (BNF) form [45]. The method was used in data fitting [46; 47], trigonometric problems [48], automatic composition of music [49], production of numeric constantswith an arbitrary number of digits [50], video games [51; 52], energy problems [53], combinatorial optimization [54], cryptography [55], the production of decision trees [56], electronics [57], Wikipedia taxonomies [58], economics [59], bioinformatics [60], robotics [61], etc. A BNF grammar is commonly defined as a set \(G=(N,T,S,P)\). The following definitions hold for any BNF grammar:  
* The set \(N\) contains the symbols denoted as non-terminal.
* The set \(T\) has the terminal symbols.
* The symbol \(S\in N\) stands for the start symbol of the grammar.
* The set \(P\) has all the production rules of the underlying grammar. These rules are used to produce terminal symbols from non-terminal symbols, and they are in the form \(A\to a\) or \(A\to aB,\ A,B\in N\), \(a\in T\).  
The production algorithm starts from the symbol \(S\) and moves through a series of steps, producing valid programs by replacing non-terminal symbols with the right hand of the selected production rule. The selection of the production rules is performed in two steps:  
* **Read** the the next element V from the processed chromosome.
* **Select** the production rule that will be applied using the equation: Rule = V mod \(N_{R}\), where \(N_{R}\) stands for the number of production rules that contains the current current non-terminal symbol.  
The incorporated grammar for the neural construction method is outlined in Figure 1. The number in parentheses denotes the sequence number of each rule for every non-terminal symbol. The symbol \(n\) represents the number of features for the used dataset.  
This grammar can produce artificial neural networks in the following form:  
\[N\big{(}\overrightarrow{x},\overrightarrow{w}\big{)}=\sum_{i=1}^{H}w_{(n+2)i- (n+1)}\sigma\left(\sum_{j=1}^{n}x_{j}w_{(n+2)i-(n+1)+j}+w_{(n+2)i}\right) \tag{2}\]  
The symbol \(H\) corresponds to the number of weights or processing units. The function \(\sigma(x)\) denotes the sigmoid function, and it has the following definition:  
\[\sigma(x)=\frac{1}{1+\exp(-x)} \tag{3}\]  
Figure 1: The grammar used by the neural construction method.  
The grammar of the present method can construct artificial neural networks with a hidden processing layer and with a variable number of computing units. This kind of architecture is sufficient to approach any problem, according to [PERSON]'s theorem Hornik (1964), which states that an artificial neural network with a sufficient number of computing units and a processing level can approximate any function.  
As an example, consider a problem with three inputs: \(x_{1},x_{2},x_{3}\). An example neural network that can be constructed by the grammatical evolution procedure could be the following:  
\[N(x)=2.1\text{sig}(10.5x_{2}+9.2x_{3}+5.7)+3.2\text{sig}(2.2x_{1}-4.3x_{3}+6.2) \tag{4}\]  
The previously mentioned artificial neural network has two processing nodes, and not all inputs are necessarily connected to each processing node, since the grammatical evolution process may miss some connections.