Closed mheilman closed 9 years ago
Here's a simplified version of how I am using the StackedCells.params
getter and setter methods to save and load models. It seems to work now.
with open(args.save_path, 'wb') as f:
pickle.dump(model.params, f, protocol=pickle.HIGHEST_PROTOCOL)
model = create_new_model()
with open(args.load_path, 'rb') as f:
model.params = pickle.load(f)
I just noticed that the param setter methods that I added in my previous pull request didn't actually work for saving and loading models. The setter methods needed to use the
get_value
andset_value
methods rather than just assigning new shared variables.I also added the
clip_gradients
keyword argument to theStackedCells
class so that it can be applied to component layers. I'm not sure this is actually useful, but I wanted to tryclip_gradients
in a model with stacked cells.