neural network converted from cpp