Skip to content

Commit

Permalink
Merge pull request rasmusbergpalm#1 from tonibagur/tonibagur
Browse files Browse the repository at this point in the history
Fix the using of ~ symbol which causes octave to crash
  • Loading branch information
tonibagur committed Apr 15, 2014
2 parents c083531 + db922d8 commit 8dbd241
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NN/nneval.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

%calc misclassification rate if softmax
if strcmp(nn.output,'softmax')
[er_train, ~] = nntest(nn, train_x, train_y);
[er_train, dummy] = nntest(nn, train_x, train_y);
loss.train.e_frac(end+1) = er_train;

if nargin == 6
[er_val, ~] = nntest(nn, val_x, val_y);
[er_val, dummy] = nntest(nn, val_x, val_y);
loss.val.e_frac(end+1) = er_val;
end
end
Expand Down
2 changes: 1 addition & 1 deletion NN/nnpredict.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
nn = nnff(nn, x, zeros(size(x,1), nn.size(end)));
nn.testing = 0;

[~, i] = max(nn.a{end},[],2);
[dummy, i] = max(nn.a{end},[],2);
labels = i;
end
2 changes: 1 addition & 1 deletion NN/nntest.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function [er, bad] = nntest(nn, x, y)
labels = nnpredict(nn, x);
[~, expected] = max(y,[],2);
[dummy, expected] = max(y,[],2);
bad = find(labels ~= expected);
er = numel(bad) / size(x, 1);
end

0 comments on commit 8dbd241

Please sign in to comment.