# Language Inference Using Elman Networks with Evolutionary Training
## 4 Experiments  
### Datasets  
A series of datasets from different fields were used as test cases for the evaluation of the proposed classifier and the corresponding training method. In Table 3, the number of positive/negative sequences, the number of distinct symbols in the dataset, the average length of each instance and the standard deviation are summarized. **Regex Data**. Two artificial regular expressions \(RE_{1},RE_{2}\), where \(RE_{1}\cap RE_{2}=\emptyset\) and  
* \(RE_{1}=(a|b|c|d|e|f)\{6,7\}(a|b|c)\{2,3\}(a|b|c|d|e|f)\{6,7\}(a|b|c)\{1,3\}\)
* \(RE_{2}=(a|b|c|d|e|f)\{6,7\}(a|e|f)\{2,3\}(a|b|c|d|e|f)\{6,7\}(d|e|f)\{1,3\}\)  
where \((a|b|c|d|e|f)\{6,7\}\) is a sequence of six to seven characters from a-f [29] and were used to measure both classification accuracy and encoding efficiency in the well control environment of simple artificial languages with a small number of terminal symbols. A total number of 300 positive and 300 negative instances were randomly created from the above regular expressions as positive and negative data. The intersection of the positive and negative data sequences is an empty set. **Biological datasets**. Two additional biological datasets with only four terminal symbols (A,G,C and T) were sampled from the well-known genome sequences NCBI and [30], called Flu and Dnacvs, as shown in the experimental result Table 1.  
The Flu database consists of 200 sequences of DNA from the flu virus strains and prion strains randomly selected from the NCBI dataset [31], aiming to successfully distinguish if an arbitrary length genome sequence represents a virus (positive sequences) or a prion (negative sequences). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**DATASET** & **Non-Optimzed** & **2 Threads + SIMD** & **8 Threads + SIMD** \\ \hline Regex & 205 min. & 42 min. (\(\times\)4.88) & 19.4 min. (\(\times\)10.56) \\ Primes & 162 min. & 31 min. (\(\times\)5.22) & 14.4 min. (\(\times\)11.25) \\ Prop & 111 min. & 21.2 min. (\(\times\)5.23) & 10.5 min. (\(\times\)10.57) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison between implementations. The Dnacvs dataset consists of genomes that represent either coding (positive sequences) or non-coding genomic DNA sequences (negative sequences) [30]. A total number of 1000 positive sequences and 1000 negative sequences were randomly sampled, and the goal of the classifier was to distinguish, given an arbitrary DNA sequence, if this sequence can be translated to a protein or not. **Chemical dataset**. The LogP dataset was used to predict if a chemical substance has positive [32] or negative LogP [33] value using only the molecule in SMILES [34] representation. If the LogP of a molecule instance is positive, the instance is considered a positive example, else the molecule is considered a negative example. The database consists of 3000 positive and 3000 negative instances, while there are 32 distinct terminal symbols in the dataset. **Image dataset**. In this dataset, two hand-written numbers (0, 8) from the MNIST dataset were selected to represent the two classes of the classifier: positive and negative examples. These numbers were selected because they are similar enough to pose a difficult problem for the proposed method. Each instance is a sequence of 784 (28 \(\times\) 28 pixels) binary numbers representing the hand-written numbers. A total of 1000 positive and 1000 negative examples were used. **The Sentiment dataset**. The dataset [35] was used to build an Elman classifier capable of distinguishing if a sentence describes a movie in a positive or negative mood. The database consists of 1480 positive sequences and 1302 negative sequences. There are 28 terminal symbols in this database representing the English letters and some punctuation symbols. **Mathematical datasets**. The Prop dataset represents sequences of decimal numbers for positive data and random sequences of decimal numbers as negative data.