Created
June 6, 2018 00:54
-
-
Save freedomtowin/31c32f71a1958bbedefdbbac1f8e0878 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
def reshape_vector(w): | |
reshape_w = [] | |
indx = 0 | |
for shape,num in zip([30, 30, 1], [300, 300, 30]): | |
x = w[indx:num+indx] | |
if x.size!=num: | |
continue | |
x = x.reshape(shape,int(num/shape)) | |
reshape_w.append(x) | |
indx = indx+num | |
extra_w = w[indx:] | |
return reshape_w,extra_w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment