Skip to content

Commit 5619b86

Browse files
authored
[ADD] Documentation
1 parent 1dade33 commit 5619b86

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Diff for: train.m

+5-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22
function [neural_net,y_predicted, learning_rate]= train(neural_net,X,Y,...
33
cost_function,learning_rate)
44

5-
%TRAIN Summary of this function goes here
6-
% Detailed explanation goes here
5+
%TRAIN Training based in two steps, forwarding and backpropagation.
76

87
out(1,1:2)={nan,X};
98

10-
% forward, get z(output) values of all layers.
11-
12-
out = fordwarding(neural_net, out);
13-
14-
%back propagation, modify the weights of the nn.
9+
% calculate de "error" of the last layer.
10+
out = forwarding(neural_net, out);
1511

12+
% "propagate" that error to modify the weights of every layer
1613
neural_net = backpropagation(neural_net,cost_function, out, learning_rate, Y);
1714

18-
% la salida se almacena en la última posición de out.
19-
15+
% usefull to calculate and analize the behavior of the cost in every epoch. (to detect overfitting, underfitting...)
2016
y_predicted = out{end,2};
2117

2218
end

0 commit comments

Comments
 (0)