Port of the C# version of Encog3 to D