Clear Filters
Clear Filters

How to add HOG feature to the following code

2 views (last 30 days)
Here is the code for the neural network, "Latest.mat" contains training and test images for the neural network,
  • I need to see the accuracy and
  • I need to add "HOG feature" and using that i need to compare between the training and the test images, Please can anyone help me with that please
clc; clear all;
%%
load latest.mat; trainFcn = 'trainscg'; % Scaled conjugate gradient backpropagation.
net.performFcn = 'mse'; %newly added
hiddenLayerSize = 100; %net = patternnet(hiddenLayerSize); net=feedforwardnet([20 10]);
view (net); net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100;
net.trainParam.epochs = 100;
[net,tr] = train(net,training,test); y = net(training); e = gsubtract(test,y); performance = perform(net,test,y) tind = vec2ind(test); yind = vec2ind(y); percentErrors = sum(tind ~= yind)/numel(tind);
%net.IW{1,1}; %net.b{1}; %net.LW {1};
% View the Network view(net)
Thank You
  6 Comments
Greg Heath
Greg Heath on 25 Apr 2017
The fudamental role of the validation subset is clearly explained in the documentation.
You can also search both the NEWSGROUP and ANSWERS using the search word
validation
Hope this helps.
Greg
Tousif Ahmed
Tousif Ahmed on 26 Apr 2017
https://in.mathworks.com/matlabcentral/answers/58761-nn-validation-and-data-partition
I followed the above link..
Can you please help me in my code with the validation set please

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!