Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conv layer json file weight ordering (filt, d, sx, sy) #84

Open
malcolmregan opened this issue Apr 18, 2017 · 0 comments
Open

conv layer json file weight ordering (filt, d, sx, sy) #84

malcolmregan opened this issue Apr 18, 2017 · 0 comments

Comments

@malcolmregan
Copy link

malcolmregan commented Apr 18, 2017

I need to produce a JSON file convnetjs can read from a saved theano model. The model ive produced so far "works" (as in it is valid) but doesn't make the expected predictions.

This is likely due to the fact that the ordering of the weights in the JSON file is wrong as I can't find any info on how they are stored.

As a specific example of my question,
The layer I'm trying to convert from theano to json consists of 50 filters each with depth=20, sx=5, sy=5 Accordingly, The theano weight matrix has shape (filt=50, d=20, sx=5, sy=5). In what order should I loop over the dimensions of the theano matrix? That is, in what order should the weight values be stored in the JSON file? right now I have:


num=0
for filt from 1 to 50:
     for sx from 1 to 5:
          for sy from 1 to 5: 
               for d from 1 to 20:        
                    add the line to json file: "num":   weights[filt, d, sx, sy]
                    num=num+1

@malcolmregan malcolmregan changed the title conv layer json file weight ordering (d, filt, sx, sy) conv layer json file weight ordering (filt, d, sx, sy) Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant