'write the network model and preprocessing features to the specified file
If a weights_file (.hdf5 extension) is also specified, model weights are also
saved to that file and will be reloaded automatically in a call to load_model'

def save_model(self, json_file, weights_file=None):

    object_specs = {'class': self.__class__.__name__, 'keras_model': self.model.to_json(), 'feature_list': self.preprocessor.feature_list}
    if (weights_file is not None):
        self.model.save_weights(weights_file)
        object_specs['weights_file'] = weights_file
    with open(json_file, 'w') as f:
        json.dump(object_specs, f)
