My trained deep learning model provides the same output for all test data except the last sample.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi,
I have a trained model. During training I have tested my error level and it was very low. I saved the model in mat file. My test data contained 271 sample. Below I will paste the test code. When I run this code, All the results for first 270 samples are same, only the 271. result differs. I tried to change the order of the test data ( I moved the 271. sample to first order ) nothing changed. Still I have first 270 results same, 271. differs. The code has nothing that would cause this.
FERDAfreqdemogswlliwcnStatusB50Gender0Test = xlsread('D:\Dropbox\Satisfaction_Makale\Matlab Calisma Dosyalari\FERDA_freq_demog_swl_liwc_nStatusB50_Gender0 - Test.xlsx');
XMaleTest = FERDAfreqdemogswlliwcnStatusB50Gender0Test(:, [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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]);
YMaleTest = FERDAfreqdemogswlliwcnStatusB50Gender0Test(:, [45]);
XMaleTest = Normalize(XMaleTest);
YMaleTest = Normalize(YMaleTest);
load('DeepNeuralNetworkMale2.mat');
inputMatrixMale = XMaleTest;
nRows = size(inputMatrixMale, 1);
testOutput = zeros(nRows, 1);
for k = 1:nRows
subMatrix = double(inputMatrixMale(k:k, :));
if(k == 270 )
disp("Durdum");
end
input_of_hidden_layer1 = w1* transpose(subMatrix);
input_of_hidden_layer1 = vpa(input_of_hidden_layer1);
output_of_hidden_layer1 = Sigmoid(input_of_hidden_layer1);%Relu idi
output_of_hidden_layer1 = vpa(output_of_hidden_layer1);
input_of_hidden_layer2 = (w2) * (output_of_hidden_layer1);%bunun sonucu inf ç?k?yor
input_of_hidden_layer2 = vpa(input_of_hidden_layer2);
output_of_hidden_layer2 = Sigmoid(input_of_hidden_layer2);%Relu idi
output_of_hidden_layer2 = vpa(output_of_hidden_layer2);
input_of_hidden_layer3 = w3* output_of_hidden_layer2;
input_of_hidden_layer3 = vpa(input_of_hidden_layer3);
output_of_hidden_layer3 = Sigmoid(input_of_hidden_layer3); %Relu idi
output_of_hidden_layer3 = vpa(output_of_hidden_layer3);
input_of_output_node = (w4) * (output_of_hidden_layer3);
input_of_output_node = vpa(input_of_output_node);
final_output = Sigmoid(input_of_output_node);
final_output = vpa(final_output);
disp(["final_output=" , num2str(double(final_output))]);
testOutput(k) = final_output;
end
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!