Created
January 1, 2016 15:28
-
-
Save ssampang/396be1c6d40928097c02 to your computer and use it in GitHub Desktop.
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
old = lasagne.layers.get_all_param_values(self.output_layer) | |
new = [] | |
for layer in old: | |
shape = layer.shape | |
if len(shape)<2: | |
shape = (shape[0], 1) | |
W= lasagne.init.GlorotUniform()(shape) | |
if W.shape != layer.shape: | |
W = np.squeeze(W, axis= 1) | |
new.append(W) | |
lasagne.layers.set_all_param_values(self.output_layer, new) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment