📜 ⬆️ ⬇️

Method of non-iterative learning of a single-layer network of direct distribution with a linear activation function

In this article there will not be a single line of code, there will simply be a theory of the method of teaching neural networks, which I have been developing for the last half-year. I plan to implement the method in the next article.

The prospects for non-iterative learning of neural networks are very large, this is potentially the fastest way to learn NA. I want to begin the cycle of work on non-educational training from the simplest case (where there is no place to simplify). Namely, with a single-layer network of direct distribution with a linear activation function, weighted adder. The error function for one neuron is given as:

flos(W)= sumni=1[yi( summj=1wj cdotxij)]2


Where W = \ {w_1, ... w_k \};W = \ {w_1, ... w_k \}; , m is the number of inputs in the neural network, n is the power of the training sample, which consists of pairs: the output ideal value “y” for each neuron and the input vector “x”. It is also worth noting that you can train each neuron separately.

The network will be trained if: flos(W) rightarrowmin i.e. if the error is minimal.
')
Given that the activation function is linear, and the equation of the error function is quadratic, it is obvious that such a function has no maximum, and therefore the condition at which  frac partialflos(W) partialwi=0 This is a minimum condition. Let's first define this derivative and equate it to 0.

 frac partialflos(W) partialwk=2 cdot sumni=1(yi summj=1wj cdotxij)xik=0;


After a series of transformations we get:

 summj=1(wj cdot sumni=1xij cdotxik)= sumni=1xik cdotyi;


Where k is the number of the equation in the system.

To complete the training, we need to calculate the weights vector W. It is not difficult to notice that the last expression, if written for each equation, is a SLAE relative to W. To solve this system, I chose the Cramer method (the Gauss method works faster, but it is not so visual) . Each neuron weight can be written as:

wj= fracdet(Aj)det(A);A= beginpmatrixa11.........a1m..................am1.........amm endpmatrix;B= beginpmatrixb1....bm endpmatrix;akj= sumni=1xij cdotxik;bk= sumni=1yi cdotxik;


Here is the matrix Aj this is the matrix "A" in which the j-th column is replaced by the vector B. This is the training of one neuron, due to the fact that the neurons are in no way interconnected, they can be trained in parallel, independently of each other.

PS If there are comments on the article, write, always happy constructive criticism.

Source: https://habr.com/ru/post/332936/


All Articles