Writing neural network code