Skip to content

Commit

Permalink
added: simle tests for NN predict function
Browse files Browse the repository at this point in the history
  • Loading branch information
vasnake committed Apr 4, 2014
1 parent dd647e3 commit 8cb020f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ex3/test_ex3.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
%!test test_oneVsAll()

%!test test_predictOneVsAll()

%!test test_predict()
19 changes: 19 additions & 0 deletions ex3/test_predict.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function test_predict()

%c = predict(Theta1, Theta2, X);
c = predict(ones(3, 8), ones(1, 4), ones(9, 7));
assert(c, ones(9, 1));

c = predict(ones(3, 8), ones(1, 4), magic(7));
assert(c, ones(7, 1));

c = predict(-1/170*ones(3, 8), -1/3*ones(1, 4), magic(7));
assert(c, ones(7, 1));

predict(-1/170*ones(3, 8), -1/3*ones(2, 4), magic(7));
assert(c, ones(7, 1));

predict(-1/170*ones(3, 8), -1/3*ones(3, 4), magic(7));
assert(c, ones(7, 1));

endfunction

0 comments on commit 8cb020f

Please sign in to comment.