Skip to content

Commit

Permalink
switches to matconvnet beta17
Browse files Browse the repository at this point in the history
  • Loading branch information
vedaldi committed Nov 22, 2015
1 parent e4e5c85 commit ab45b8a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion doc/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ Note that we remember the `imageMean` for later use. Note also that the softmaxl
The next step is to glance at the filters that have been learned:
```matlab
figure(2) ; clf ; colormap gray ;
vl_imarraysc(squeeze(net.layers{1}.filters),'spacing',2)
vl_imarraysc(squeeze(net.layers{1}.weights{1}),'spacing',2)
axis equal ;
title('filters in the first layer') ;
```
Expand Down Expand Up @@ -787,6 +787,7 @@ That completes this practical.
## History
* Used in the Oxford AIMS CDT, 2015-16.
* Used in the Oxford AIMS CDT, 2014-15.
[^lattice]: A two-dimensional *lattice* is a discrete grid embedded in $R^2$, similar for example to a checkerboard.
2 changes: 1 addition & 1 deletion exercise4.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function exercise4(varargin)
% -------------------------------------------------------------------------

figure(2) ; clf ; colormap gray ;
vl_imarraysc(squeeze(net.layers{1}.filters),'spacing',2)
vl_imarraysc(squeeze(net.layers{1}.weights{1}),'spacing',2)
axis equal ; title('filters in the first layer') ;

% -------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions extra/download.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
wget http://www.vlfeat.org/matconvnet/models/imagenet-vgg-verydeep-16.mat \
wget http://www.vlfeat.org/sandbox-matconvnet/models/imagenet-vgg-verydeep-16.mat \
--output-document=data/imagenet-vgg-verydeep-16.mat --continue

if test ! -e vlfeat
Expand All @@ -11,8 +11,8 @@ fi

if test ! -e matconvnet
then
wget http://www.vlfeat.org/matconvnet/download/matconvnet-1.0-beta16.tar.gz \
wget http://www.vlfeat.org/sandbox-matconvnet/download/matconvnet-1.0-beta17.tar.gz \
--output-document=data/matconvnet.tar.gz --continue
tar xzvf data/matconvnet.tar.gz
mv matconvnet-1.0-beta16 matconvnet
mv matconvnet-1.0-beta17 matconvnet
fi
14 changes: 6 additions & 8 deletions initializeCharacterCNN.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
f=1/100 ;
net.layers = {} ;
net.layers{end+1} = struct('type', 'conv', ...
'filters', f*randn(5,5,1,20, 'single'), ...
'biases', zeros(1, 20, 'single'), ...
'weights', {{f*randn(5,5,1,20, 'single'), zeros(1, 20, 'single')}}, ...
'stride', 1, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'pool', ...
Expand All @@ -13,8 +12,7 @@
'stride', 2, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'conv', ...
'filters', f*randn(5,5,20,50, 'single'),...
'biases', zeros(1,50,'single'), ...
'weights', {{f*randn(5,5,20,50, 'single'), zeros(1,50,'single')}}, ...
'stride', 1, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'pool', ...
Expand All @@ -23,14 +21,14 @@
'stride', 2, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'conv', ...
'filters', f*randn(4,4,50,500, 'single'),...
'biases', zeros(1,500,'single'), ...
'weights', {{f*randn(4,4,50,500, 'single'), zeros(1,500,'single')}}, ...
'stride', 1, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'relu') ;
net.layers{end+1} = struct('type', 'conv', ...
'filters', f*randn(2,2,500,26, 'single'),...
'biases', zeros(1,26,'single'), ...
'weights', {{f*randn(2,2,500,26, 'single'), zeros(1,26,'single')}}, ...
'stride', 1, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'softmaxloss') ;

net = vl_simplenn_tidy(net) ;

0 comments on commit ab45b8a

Please sign in to comment.