GPU implementation of neural networks