Created
November 29, 2016 12:07
-
-
Save persiyanov/ed7a21c7f82713c33d11eaf8428c4d56 to your computer and use it in GitHub Desktop.
load/save weights in lasagne network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Optionally, you could now dump the network weights to a file like this: | |
np.savez('model.npz', *lasagne.layers.get_all_param_values(network)) | |
# | |
# And load them again later on like this: | |
with np.load('model.npz') as f: | |
param_values = [f['arr_%d' % i] for i in range(len(f.files))] | |
lasagne.layers.set_all_param_values(network, param_values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment