added serialization to neural nets