-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathex3_nn_unit_tests.m
More file actions
29 lines (27 loc) · 811 Bytes
/
ex3_nn_unit_tests.m
File metadata and controls
29 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Copyright (C) 2017 Machine Learning Coursera - March 2017
##
## Author: Alexandro <alexandro.oliveira@holbertonschool.com>
## Created: 2017-03-29
## -*- texinfo -*-
##
## Unit test for week 4, Programming assignment
##
## Put this file in the ex3/ folder and execute it from Octave with:
##
## >> test ex3_nn_unit_tests
##
## or, if you want more details about error/success
##
## >> test ex3_nn_unit_tests verbose
##
## Enjoy!
##
%% Test for predict function
%!shared Theta1, Theta2, X, expected
%! Theta1 = reshape(sin(0 : 0.5 : 5.9), 4, 3);
%! Theta2 = reshape(sin(0 : 0.3 : 5.9), 4, 5);
%! X = reshape(sin(1:16), 8, 2);
%! expected = [4 1 1 4 4 4 4 2]';
%! fprintf('Testing predict function...\n');
%!assert(predict(Theta1, Theta2, X), expected);
%! fprintf('Test on Predict function => PASSED!\n\n');