Implemented saving of neural network.