added serialization of neural networks