Implementation 1 of feedforward ANN (version 1)