W
W
wickedwannabe2017-03-16 21:23:59
Neural networks
wickedwannabe, 2017-03-16 21:23:59

How to train a single layer perceptron?

Greetings. There is an array of zeros and ones representing a binary image. It can show geometric shapes. Example:
000000000000000
000111111000000
000111111000000
000111111000000
000111111000000
000111111000000
000111111000000
00000000
Need to identify squares and. At the moment, the markup of figures and the collection of parameters characterizing a geometric figure have been implemented:

  • The moments for the rows and columns of the figure are calculated. If this parameter is close to zero, the figure is symmetrical, a circle or a square.
  • The ratio of the distances between the centroid of the figure and the maximum remote point of the perimeter and the minimum remote point of the perimeter (If it is approximately equal to 1.41, then this is a square, if the unit is a circle)
  • The compactness (circularity) of Haralik has been calculated (the parameter increases as the shape of the figure approaches the circle, it is in the range from 7.5 to 9.1 for squares and higher for circles)

Thus, an example input vector for neurons looks like this: [0.0728022 ; 1.44278; 8.98357]
As far as I understand, to train this network, it is necessary to use supervised learning, for example, according to the Widrow-Hoff method
wj(t+1)=wj(t) - a * (yk-dk)* xjk
wj is the weight of the j th input.
xj - signal at the j th input.
yk is the real output of the network for the kth example.
dk is the desired (ideal) network output for the kth example.
The question is, what should I take for the ideal output of the system? By setting some random weights at the inputs, I get a certain sum at the output of the neuron, but I can’t figure out what to compare it with?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-03-16
@begemot_sun

Well, if the answer is < 0, then the preceptron assigned the given input to one class, if > 0, then to another.
In general, the interpretation of the results is a subjective matter.
Alternatively, you can take some delta (for example, 0.5) .. and if the result lies between -0.5 < x < 0.5 - then say that the perceptron has not been determined.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question