Skip to content

Commit

Permalink
example of extracting feature
Browse files Browse the repository at this point in the history
  • Loading branch information
happynear committed Jun 12, 2015
1 parent e979f1a commit 6028bfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions matlab/demo/getCifar10Feature.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
net_model = 'D:\deeplearning\caffe-windows\examples\cifar10\cifar10_full_train_test.prototxt';
net_weights = 'D:\deeplearning\caffe-windows\examples\cifar10\cifar10_full_iter_80000.caffemodel';

%%%%%%%%%extract the train feature
%%%%%%%%%extract the train features
train_net = caffe.Net(net_model,net_weights,'train');
output_blob_index = train_net.name2blob_index('pool3');%feature blob
output_blob = train_net.blob_vec(output_blob_index);
Expand Down Expand Up @@ -47,7 +47,7 @@
output = reshape(output,size(output,1)*size(output,2)*size(output,3),size(output,4));
assert(sum(sum(abs(output - feature_train(:,1:size(output,2)))))==0);

%%%%%%%%%extract the train feature
%%%%%%%%%extract the test features
test_net = caffe.Net(net_model,net_weights,'test');
output_blob_index = test_net.name2blob_index('pool3');%feature blob
output_blob = test_net.blob_vec(output_blob_index);
Expand Down

0 comments on commit 6028bfe

Please sign in to comment.