Skip to content

Instantly share code, notes, and snippets.

% Octave console output
Normalized Training Example 1:
1.000000
-0.362141
-0.755087
0.182226
-0.706190
0.306618
-0.590878
0.344516
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week6-compute-train-linear-regression-and-compute-error.m
Last active November 17, 2015 06:48
Train linear regression and comput train error (m = 1 to 12) and cross validation error.
% Octave console output
Iteration 3 | Cost: 9.860761e-32
Iteration 2 | Cost: 3.286595e+00
Iteration 28 | Cost: 2.842678e+00
Iteration 24 | Cost: 1.315405e+01
Iteration 27 | Cost: 1.944396e+01
Iteration 13 | Cost: 2.009852e+01
Iteration 30 | Cost: 1.817286e+01
Iteration 11 | Cost: 2.260941e+01
Iteration 33 | Cost: 2.326146e+01
% Octave console output
Gradient at theta = [1 ; 1]: [-15.303016; 598.250744]
(this value should be about [-15.303016; 598.250744])
% Octave console output
Cost at theta = [1 ; 1]: 303.993192
(this value should be about 303.993192)
% Octave console output
Training Neural Network...
Iteration 50 | Cost: 4.751548e-01
% Octave console output
Cost at (fixed) debugging parameters (w/ lambda = 3): 0.576051
(this value should be about 0.576051)
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week5-complete-backpropagation-and-check-Neural-network-gradients.m
Last active November 16, 2015 15:41
generate some 'random' test data and test (input_layer_size = 3; hidden_layer_size = 5; num_labels = 3; m = 5;)
% Octave console output
Initializing Neural Network Parameters ...
Checking Backpropagation...
-9.2783e-03 -9.2783e-03
8.8991e-03 8.8991e-03
-8.3601e-03 -8.3601e-03
7.6281e-03 7.6281e-03
-6.7480e-03 -6.7480e-03
-3.0498e-06 -3.0498e-06
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week5-cost-function-with-regularization.m
Last active November 16, 2015 15:42
Cost function with regularization (lambda: 1). And Compute Cost at parameters (loaded from ex4weights)
% Octave console output
Checking Cost Function (w/ Regularization) ...
Cost at parameters (loaded from ex4weights): 0.383770
(this value should be about 0.383770)
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week5-feedforward-using-neural-network-and-compute-cost.m
Last active November 16, 2015 15:42
Feedforward Using Neural Network and Compute Cost at parameters (loaded from ex4weights)
% Octave console output
Feedforward Using Neural Network ...
Cost at parameters (loaded from ex4weights): 0.287629
(this value should be about 0.287629)
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week4-feedforward-propagation-and-prediction.m
Created November 16, 2015 14:13
Feedforward Propagation and Prediction (Loading Saved Neural Network Parameters in ex3weights.mat)
% Octave console output
Training Set Accuracy: 97.520000