coding for ANN train