Skip to content

Commit

Permalink
mods
Browse files Browse the repository at this point in the history
  • Loading branch information
albanie committed Sep 7, 2017
1 parent 7b3b6ca commit 3f7fed5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ implementation (which uses caffe).

### Pretrained Models

Each of the Squeeze-and-Excitation networks released by the authors has been imported into MatConvNet and can be downloaded here:
Each of the Squeeze-and-Excitation networks released by the authors has been imported into [MatConvNet](https://github.com/vlfeat/matconvnet) and can be downloaded here:

[SE Networks](http://www.robots.ox.ac.uk/~albanie/models.html#se-models)

Expand All @@ -33,4 +33,4 @@ vl_contrib('install', 'mcnSENets') ;
vl_contrib('setup', 'mcnSENets') ;
```

**Note:** The ordering of the imagenet labels differs from the standard ordering commonly found in caffe, pytorch etc. These are remapped automically in the evaluation code. The mapping between the synsets indices can be found [here](misc/label_map.txt).
**Note:** The ordering of the imagenet labels differs from the standard ordering commonly found in caffe, pytorch etc. These are remapped automically in the evaluation code. The mapping between the synsets indices can be found [here](misc/label_map.txt).
Empty file added matlab/xtest/suite/nnaxpy.m
Empty file.
41 changes: 41 additions & 0 deletions matlab/xtest/suite/nnreshape.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
classdef nnreshape < nntest
methods (Test)

function basicWithMinus(test)
sz = [3,3,5,10] ;
x = test.randn(sz) ;
dim = {9,[],5} ;

y = vl_nnreshape(x, dim) ;
targets = [9,1,5,10] ;
osz = size(y) ;
for i = 1:numel(targets)
assert(osz(i) == targets(i)) ;
end

% check derivatives with numerical approximation
dzdy = test.randn(size(y)) ;
dzdx = vl_nnreshape(x, dim, dzdy) ;
test.der(@(x) vl_nnreshape(x, dim), x, dzdy, dzdx, 1e-3*test.range) ;
end

function basicWithZero(test)
sz = [3,3,5,10] ;
x = test.randn(sz) ;
dim = {[],3,5} ;

y = vl_nnreshape(x, dim) ;
targets = [3,3,5,10] ;
osz = size(y) ;
for i = 1:numel(targets)
assert(osz(i) == targets(i)) ;
end

% check derivatives with numerical approximation
dzdy = test.randn(size(y)) ;
dzdx = vl_nnreshape(x, dim, dzdy) ;
test.der(@(x) vl_nnreshape(x, dim), x, dzdy, dzdx, 1e-3*test.range) ;
end

end
end

0 comments on commit 3f7fed5

Please sign in to comment.