K
K
k0matozzz2014-05-19 20:59:41
Python
k0matozzz, 2014-05-19 20:59:41

How to reduce neural network training error?

Good day. I am writing a bachelor's thesis on recognition using neural networks. I am using neural network toolbox. The program should recognize squares and circles Here is the code:

close all, clear all, clc;
warning off;
 
% Загрузка данных
 
 
load images
 
 
[R,Q] = size(images);
[S2,Q] = size(targets);
 
% Предобработка
 
 
[images_pp,meanA,stdA] = prestd(images);
 
P = images;
T = targets;
 
pause
 
% Создание сети
 
 
 
S1 = 25; 
net = newff(minmax(P),[S1 S2],{'tansig' 'logsig'},'traingdx');
net = init(net);
 
% Обучение 
 
 
net.performFcn = 'sse';        % Sum-Squared Error performance function
net.trainParam.goal = 1e0;     % Sum-squared error goal.
net.trainParam.show = 20;      % Frequency of progress displays (in epochs).
net.trainParam.epochs = 1000;  % Maximum number of epochs to train.
net.trainParam.mc = 0.95;      % Momentum constant.
net.trainParam.lr = 0.01;
 
pause
 
 
[net,tr] = train(net,P,T);
 
O = sim(net,P);
C = full(compet(O));
 
Error = sse(C-T)/(2*Q)
 
figure
imagesc(O)
figure
imagesc(C)
 
pause

The problem is that the training error is always very large from 25% to 50%. Changing the number of neurons in the hidden layer does not help. I load data for training from a pre-prepared .mat file. images store grayscale images as columns. The first 10 are circles, the rest are squares. In targets - target values. 1 - circle, 2 - square, 3 - something else. I made a program from a ready-made example for character recognition. Please tell me where I'm wrong and how can I fix it? Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

7 answer(s)
P
Pavel Shvedov, 2015-11-27
@mmmaaak

Perhaps it was necessary to look not for "praser", but for "parser"?

T
TomasHuk, 2015-11-27
@TomasHuk

I'll add a couple of links myself.
1 Beautiful Soup documentation (+ nice video tutorial ).
2 lxml .

M
mad_god, 2015-11-27
@mad_god

grablib.org/ru is
not bad, a friend uses it)

A
asd111, 2015-11-27
@asd111

scrapy
habrahabr.ru/post/115710

A
Alexander, 2015-11-27
@bIbI4k0

scrapy is one of the most powerful and fast, but without p3 support yet.
requests + pyQuery. The first one is for pulling out pages, the second one is for convenient selection in jquery style. For simple and not demanding tasks, the optimal solution.
Of the famous ones, there is also beautifulSoup, but I have not worked with it - I won’t say anything sensible.

I
Igor Che, 2015-12-04
@chewarer

Read about the usual Linux wget. For some parsing tasks it is very suitable.

K
k0matozzz, 2014-05-19
@k0matozzz

The project itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question