<< nn_split_data Neural_Network_Functions Utilities_Functions >>

NeuralNet >> Neural_Network_Functions > nn_train

nn_train

Feed-forward Back-Propagation Network (New)

Parameters

net :

Network object which contains the parameters of the network created and trained.

X :

Training data, in m x n matrix, where m is the features, n is different datasets

Y :

Target data, in 1 x n vector, where the value shall be the classes which correspond to each set of data in x

num_iterations :

Iteration to run

Description

Feed-forward Back-Propagation Network Base on Andrew Ng's Coursera Deep-Learning Specialization Course.

Examples

P = [1 2 3 4; 1 2 3 4]./2 - 1; // Simple Normalization
Tc = [1 2 3 4];
T = nn_onehot(Tc); // Convert to one-hot encoding
N = [2,3,4];
af = ['ann_relu','ann_softmax'];
num_iterations = 200;
net = initialize_parameters(N,[-0.01,0.01],af);
net.mini_batch = 1;
net.cost_type = 'categorical_crossentropy';
net.lr = 0.05;
net.l2 = 0.01;
net = nn_train(net,P,T,num_iterations);
y = model_forward(P, net);
[maxV, maxI] = max(y,'r')
disp(maxI);

See also

Authors


Report an issue
<< nn_split_data Neural_Network_Functions Utilities_Functions >>