<< knn Neural_Network_Functions nn_eval_performance >>

NeuralNet >> Neural_Network_Functions > model_forward

model_forward

Forward propagation for Feed-forward Back-Propagation Network (New)

Parameters

X :

Input data

net :

Network object which contains the parameters of the trained network.

AL :

Output prediction

caches :

Internal caches for study purpose

Description

This function implement forward path for the model created with nn_train based 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
<< knn Neural_Network_Functions nn_eval_performance >>