adding marshalling and unmarshalling of NeuralNetworks
added saving incrementally and at finish of training