karpathy / karpathy/convnetjs

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

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.2k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

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

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.