<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>NEURAL NETWORKS' LEARNING PROCESS ACCELERATION</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Taras Shevchenko National University of Kyiv</institution>
          ,
          <addr-line>03680, Kyiv-187, Akademician Glushkov Avenue, 4d</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Taras Shevchenko National University of Kyiv</institution>
          ,
          <addr-line>03680, Kyiv-187, Akademician Glushkov Avenue, 4d. Phone: 050 537 6699</addr-line>
        </aff>
      </contrib-group>
      <fpage>0000</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>This study is devoted to evaluating the process of training of a parallel system in the form of an artificial neural network, which is built using a genetic algorithm. The methods that allow to achieve this goal are computer simulation of a neural network on multicore CPUs and a genetic algorithm for finding the weights of an artificial neural network. The performance of sequential and parallel training processes of artificial neural network is compared. Дане дослідження присвячене розгляду процесу навчання паралельної системи у вигляді штучної нейронної мережі, побудованої за допомогою генетичного алгоритму. Методами, які дозволяють досягти поставленої в роботі мети, є комп'ютерне моделювання нейронної мережі на багатоядерних центральних процесорах та генетичний алгоритм для знаходження ваг штучної нейронної мережі. Наведено порівняння продуктивності послідовного та паралельного процесів навчання штучної нейронної мережі. Ключові слова: багатоядерні центральні процесори, штучні нейронні мережі, штучний нейрон, генетичний алгоритм, відбір, схрещування, мутація, паралельні обчислення. Данное исследование посвящено рассмотрению процесса обучения параллельной системы в виде искусственной нейронной сети, построенной с помощью генетического алгоритма. Методами, которые позволяют достичь поставленной в работе цели, являются компьютерное моделирование нейронной сети на многоядерных центральных процессорах и генетический алгоритм для нахождения весов искусственной нейронной сети. Приведено сравнение производительности последовательного и параллельного процессов обучения искусственной нейронной сети. Ключевые слова: многоядерные центральные процессоры, искусственные нейронные сети, искусственный нейрон, генетический алгоритм, отбор, скрещивание, мутация, параллельные вычисления.</p>
      </abstract>
      <kwd-group>
        <kwd>multi-core CPUs</kwd>
        <kwd>artificial neural networks</kwd>
        <kwd>artificial neuron</kwd>
        <kwd>genetic algorithm</kwd>
        <kwd>selection</kwd>
        <kwd>crossing</kwd>
        <kwd>mutation</kwd>
        <kwd>parallel computing</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>1. ANs, the output signals of which are input to the given neuron.</p>
      <p>2. The adder of the input signals. It can find a linear combination of input signals, sum, maximum, minimum,
average, square of the norm between input vectors and synaptic weights (radial function), etc.</p>
      <p>3. The calculator of the activation function. Calculates some function f(x) from the value at the output of the
adder. In general case, it can be arbitrary.</p>
      <p>4. ANs, the inputs of which receive the signal from this neuron.</p>
      <p>The Structure of an Artificial Neural Network. Typically, ANs in the ANN are grouped into layers. In general, there
are no restrictions on the number and structure of layers, but they usually distinguish one input layer, one output layer,
and several (or even none) intermediate (or hidden) layers (fig. 2).
The Creation of Artificial Neural Networks. The creation of an ANN can be divided into two steps:
1) hoice of type (topology, architecture) of the ANN;
2) the training process of the ANN.</p>
      <p>The first step is to determine the following:
- the number and types of input and output neurons;
- the number and type of neurons in the intermediate layers that will be used in the creation of the ANN;
- the type of connections of an AN.</p>
      <p>In the first phase the type of the ANN is usually selected from one of the well-known architectures or used a genetic
algorithm to move this task to a computer. In the second phase, it is necessary to "train" the ANN and to select right
values of synaptic weights [5].</p>
      <p>The training process itself can be represented in a cycle view with the following steps (fig. 3):
1. Choosing an example from the database. An example is the input and the expected output.
2. Applying the selected example to the ANN.
3. Error calculation.</p>
      <p>4. Correction of synaptic weights of the ANN.</p>
      <p>The Concept of the Genetic Algorithm. The genetic algorithm (GA) is an evolutionary algorithm used to solve
optimization and modelling problems by sequentially selecting, combining, and varying the required parameters using
mechanisms that resemble biological evolution [9].</p>
      <p>Steps of the Genetic Algorithm. To solve a problem using the GA, the problem must be encoded so that its solution
can be represented as an array of information – like composition of the chromosome. In addition, it is necessary to
define the fitness function, which will show if obtained GA solutions satisfy the optimal solution. This is a simulation of
an evolutionary process that continues over several life cycles (generations) until the stop condition is fulfilled.
Thus, it is possible to distinguish the following steps of GA iteration [9] (fig. 4):
1. Creation of the original population.
2. Calculating fitness functions for the population (estimation).
3. Select individuals from the current population (selection).
4. Crossing of selected individuals and mutation.
5. Formation of a new generation.</p>
      <p>6. If stop condition is not fulfilled yet, go to step 2.</p>
      <p>Fig. 4. Steps of the GA</p>
    </sec>
    <sec id="sec-2">
      <title>Parallel Computing in Neural Networks</title>
      <p>Parallel computing means software systems are developed as a set of computing processes that run simultaneously (in
parallel) and can communicate mutually.</p>
      <p>Parallel Computing at the Training Phase. In such a parallel computing organization, each thread calculates its ANN
configuration different from the configurations of the other threads (Fig. 5).
Accordingly, several configurations of the ANN can be calculated at one time lapse on the same input data, which can
give a linear increase in the acceleration of the training phase. This is possible due to the fact, that no interactions take
place between processes.</p>
      <p>Parallel Computing at the Neuron or Small Group of Neurons Level. With this kind of computation organization,
each thread calculates the output of one neuron, or all neurons in a group. Typically, neurons of the same layer are split
between threads (fig. 6).
Accordingly, at one time lapse the output values of several neurons are found at once. In this case attention must be paid
to synchronize between neurons of the current and previous layers (or between neurons of the current layer and the
previous layer as a whole).</p>
    </sec>
    <sec id="sec-3">
      <title>Comparison of Productivity of Sequential and Parallel Neural Networks</title>
      <p>Problem Statement for the Neural Network. The problem, for which the ANN is built and trained:
A raster black and white image of a figure 40 by 40 pixels is given. It is necessary to resolve what this figure is. It is
needed to build and train an ANN that accepts a vector of 1600 elements (by the number of pixels in an image) and
outputs a vector of 10 elements. If the input is presented with an image of some digit D, then the maximum value must
be achieved at the exit of number D. If an image other than a digit is submitted to the input, the ANN produces some
incomprehensible result.
Description of the Neural Network’s Structure. As an architecture, for this example, the direct propagation ANN
with two hidden layers is considered. The number of layers and neurons in each layer is shown in fig. 7. The AN of
each successive layer only connects with the neurons of the previous layer.</p>
      <p>In the input vector, all values are between zero and one.</p>
      <p>1600
16
16
Problem Statement for the Genetic Algorithm. The algorithm of training for the above ANN should be the GA. The
solution should be coded as a sequence of synaptic weights of all neurons in the hidden and output layers. In fact, the
chromosome for the ANN is the sequence of real numbers. The function of adaptation is the sigmoidal function of the
negative square in the norm of the difference between the expected and the output vectors. The initial population is 500
individuals. We take the fraction s of survivors equal to 0.5.</p>
      <p>Two values are calculated: the fitness function fi for each individual in a population of N ones and the sum of all fitness
functions F. Then for all values of fi the relation Pi is given by the following formula:
Then the interval [0; 1] is divided into N intervals, with the length of the i-th interval being equal to the value of Pi.
After that there is the generation of random numbers z from 0 to 1. If z falls into i-th interval, the individual enters the
set of individuals that survived H’, and is removed from the set H. All values of Pj are recalculated as follows:
f
Pi  i , i  0,1,, N  1 .</p>
      <p>F</p>
      <p>P
Pj  j , j  0 N , j  i ,</p>
      <p>P
i
after which the i-th interval of length Pi is removed from consideration. This continues until the set H’ contains sN
individuals.</p>
      <p>The crossing operator is an intermediate recombination operator. For the given operator, the value of parameter d is set
to 0.25. For reproduction, the individuals will be selected from the proportion of survivors in the current step. The
crossing will occur until the number of individuals in the current population is equal to the number of individuals in the
initial population, that is, 500 individuals.</p>
      <p>The proportion of mutants m is chosen equal to 0.1.</p>
      <p>For each mutant, the mutation oscillator randomly alters all synaptic weights of 5 randomly selected neurons. This
process is repeated mN times.</p>
      <p>To limit the number of iterations of learning, 1000 generations are taken into the consideration.</p>
      <p>Performance Comparison of Serial and Parallel Neural Networks. Since the idea of GA involves random changes
in synaptic weights, and these changes must occur once per cycle, the method and parallelization of the ANN at the
training sample and layer levels in this case are not suitable. Parallelization method at one neuron’s weights requires a
significant amount of resources for parallel computing (multicore CPU), so this approach is inappropriate and will not
be considered.</p>
      <sec id="sec-3-1">
        <title>Description of the Testing Equipment</title>
        <p>The tests were performed on a computer with the following equipment:
- processor Intel Core i7-6700HQ with 4 cores, 8 threads and 2.6 GHz frequency;
- RAM capacity of 8 GB;
- hard drive with a speed of 7600 rpm.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Duration of the Sequential Version of the Neural Network</title>
        <p>For the ANN, a sigmoidal function from the negative square of the norm of the difference between the expected and the
output vectors was chosen as the fitness function for the test. The performance of a sequential version of the ANN, after
completing one iteration of GA training, considering the first 100 iterations of learning is in fig. 8.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Duration of Parallel Version with Phase-Level Parallelization</title>
        <p>The performance of the parallel ANN version is different. The parallelization level is the training itself. One iteration of
GA training was executed. Considering the first 100 iterations of training the results are in fig. 9:
Fig. 9. Comparison of the
at the learning level into 2 and 4 threads
duration
of
iteration,
when
splitting
the</p>
        <p>ANN
calculations
When splitting the ANN calculations by this method, 1.04 seconds are spent on 2 threads to perform one GA iteration.
When splitting ANN calculations by this method, 0.81 seconds are spent on 4 threads to perform one GA iteration.
The acceleration and efficiency for this parallel version of ANN (fig. 10):
– 2 threads:
– 4 threads:
E2 
Duration of the Parallel Version with the Parallelization at the Level of Groups of Neurons. The results at the
level of groups of neurons are in fig. 11.</p>
        <p>Fig. 11. Comparison of the duration of the iteration,
is at the level of groups of neurons and is split into 2 and 4 threads
when
the
computation
in
the</p>
        <p>ANN
When splitting ANN calculations by this method, 1.08 seconds are spent on 2 threads to perform
one iteration of GA.
When splitting ANN calculations by this method, 0.86 seconds are spent on 4 threads to perform one
iteration of GA.</p>
        <p>The acceleration and efficiency for this parallel version of ANN (fig. 12):
– 2 threads:</p>
        <p>
          Parallelization at the level of learning:
– 2 threads:
– 4 threads:
Parallelization at the level of groups of neurons:
– 2 threads:
(7)
(8)
(9)
(
          <xref ref-type="bibr" rid="ref13 ref13 ref6 ref6">10</xref>
          )
(
          <xref ref-type="bibr" rid="ref14 ref7">11</xref>
          )
(12)
(13)
(14)
        </p>
      </sec>
      <sec id="sec-3-4">
        <title>Evaluation of the Serial Part of the Iteration Cycle. Based on the law of Amdal:</title>
        <p>
          where α – sequential part of the algorithm, α є (
          <xref ref-type="bibr" rid="ref1 ref1 ref8 ref8">0, 1</xref>
          ), p – number of threads, an estimate of the sequential part of the
algorithm for each of the above methods of parallelization can be found by the formula:
        </p>
        <p>S p 
 
1
1 
p</p>
        <p>,
1  p</p>
        <p>
 p  1  S p</p>
        <p>
 1 .</p>
        <p>
 
2
S p
 
1  4


3  S p</p>
        <p>
 1 

Although in both cases the sequential part of the iteration of the training does not exceed the volume of the parallel part,
they are comparable. Therefore, it is essential to accelerate the learning with the genetic algorithm, only by splitting the
calculations of the output vectors of neural networks into several threads.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>The goal was achieved, the features of the construction and training of the neural network using the genetic algorithm
were considered and the acceleration of learning was analysed by the implementation of an artificial neural network as a
parallel system.</p>
      <p>In the case of GA, the synaptic scales of the ANN can be changed only once for the iteration of the training of each
ANN, so parallelization at the training sample level and at the layer level does not make sense.</p>
      <p>The parallelization of the learning phase makes it possible to accelerate the execution of the parallel part of the
algorithm almost linearly with the serial version, due to the lack of information interactions between the threads.
Parallelization at the level of a neuron, or a small group of them, requires synchronization of computations between
neurons of different layers and a considerable amount of resources for parallel computations, provided that many
neurons themselves are in the ANN. It shows significant but not linear acceleration compared to the sequential version.
Література</p>
      <sec id="sec-4-1">
        <title>About authors:</title>
        <p>Katerynych Larysa,
PhD in Computer Science,
Associate Professor of Taras Shevchenko National University of Kyiv.
(15)
(16)</p>
      </sec>
      <sec id="sec-4-2">
        <title>Authors’ place of work:</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. Chapter 2.
          <string-name>
            <surname>Introduction</surname>
          </string-name>
          [Electronic resource] / Peter Radko:
          <article-title>Portal “Neural networks”</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kononyuk</surname>
          </string-name>
          <article-title>A. NEURAL NETWORKS AND GENETIC ALGORITHMS / A</article-title>
          . Kononyuk - Kyiv: Korniychuk,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Chapter 3. Fundamentals of INS [Electronic resource] / Peter Radko:
          <article-title>Portal “Neural networks”</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <source>Classification of neural networks [Electronic resource]: Artificial Intelligence Portal Project.</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hawkins</surname>
          </string-name>
          ,
          <string-name>
            <surname>Douglas</surname>
            <given-names>M.</given-names>
          </string-name>
          <article-title>The problem of overfitting</article-title>
          .
          <source>Journal of Chemical Information and Computer Sciences - 2004 - 4 4.1 6</source>
          .
          <string-name>
            <given-names>Ting</given-names>
            <surname>Qin</surname>
          </string-name>
          , et al.
          <source>A CMAC learning algorithm based on RLS. Neural Processing Letters 2004. 19. 1 7</source>
          . Crick F.
          <source>The recent excitement about neural networks Nature</source>
          .
          <year>1989</year>
          .
          <volume>337</volume>
          8. Edwards C.
          <article-title>Growing Pains for Deep Learning</article-title>
          .
          <source>Communications of the ACM</source>
          .
          <year>2015</year>
          . Vol.
          <volume>58</volume>
          ,
          <issue>Issue</issue>
          7
          <fpage>9</fpage>
          . Panchenko T. Genetic algorithms / Panchenko T. - Ed. Astrakhan University House,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          10.
          <string-name>
            <surname>Andrews</surname>
            <given-names>G.</given-names>
          </string-name>
          <article-title>Fundamentals of Multithreaded, Parallel, and Distributed Programming: Trans</article-title>
          . with
          <string-name>
            <surname>English</surname>
            . - M.:
            <given-names>Williams</given-names>
          </string-name>
          <string-name>
            <surname>House</surname>
          </string-name>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          11.
          <string-name>
            <surname>Bogachev</surname>
            <given-names>K.</given-names>
          </string-name>
          <article-title>Fundamentals of parallel programming / Bogachev</article-title>
          K. - M.: BINOM. Lab. Knowledge,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          1. Chapter 2.
          <string-name>
            <surname>Introduction</surname>
          </string-name>
          [Electronic resource] / Peter Radko:
          <article-title>Portal “Neural networks”</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kononyuk</surname>
          </string-name>
          <article-title>A. NEURAL NETWORKS AND GENETIC ALGORITHMS / A</article-title>
          . Kononyuk - Kyiv: Korniychuk,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          3. Chapter 3. Fundamentals of INS [Electronic resource] / Peter Radko:
          <article-title>Portal “Neural networks”</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          4.
          <source>Classification of neural networks [Electronic resource]: Artificial Intelligence Portal Project.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hawkins</surname>
          </string-name>
          ,
          <string-name>
            <surname>Douglas</surname>
            <given-names>M.</given-names>
          </string-name>
          <article-title>The problem of overfitting</article-title>
          .
          <source>Journal of Chemical Information and Computer Sciences - 2004 - 4 4.1 6</source>
          .
          <string-name>
            <given-names>Ting</given-names>
            <surname>Qin</surname>
          </string-name>
          , et al.
          <source>A CMAC learning algorithm based on RLS. Neural Processing Letters 2004. 19. 1 7</source>
          . Crick F.
          <source>The recent excitement about neural networks Nature</source>
          .
          <year>1989</year>
          .
          <volume>337</volume>
          8. Edwards C.
          <article-title>Growing Pains for Deep Learning</article-title>
          .
          <source>Communications of the ACM</source>
          .
          <year>2015</year>
          . Vol.
          <volume>58</volume>
          ,
          <issue>Issue</issue>
          7
          <fpage>9</fpage>
          . Panchenko T. Genetic algorithms / Panchenko T. - Ed. Astrakhan University House,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          10.
          <string-name>
            <surname>Andrews</surname>
            <given-names>G.</given-names>
          </string-name>
          <article-title>Fundamentals of Multithreaded, Parallel, and Distributed Programming: Trans</article-title>
          . with
          <string-name>
            <surname>English</surname>
            . - M.:
            <given-names>Williams</given-names>
          </string-name>
          <string-name>
            <surname>House</surname>
          </string-name>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          11.
          <string-name>
            <surname>Bogachev</surname>
            <given-names>K.</given-names>
          </string-name>
          <article-title>Fundamentals of parallel programming / Bogachev</article-title>
          K. - M.: BINOM. Lab. Knowledge,
          <year>2003</year>
          . Publications in Ukrainian journals -
          <volume>19</volume>
          .
          <article-title>Publications in foreign journals - 1</article-title>
          . https://orcid.org/0000-0001-
          <fpage>7837</fpage>
          -764X, Veres Maksym,
          <source>PhD in Computer Science</source>
          , Associate Professor of Taras Shevchenko National University of Kyiv.
          <source>Publications in Ukrainian journals - 15. Publications in foreign journals - 1</source>
          . https://orcid.org/0000-0002-8512-5560, Safarov Eduard,
          <source>student of Faculty of Computer Science and Cybernetics</source>
          , Taras Shevchenko National University of Kyiv. https://orcid.org/0000-0001-9651-4679.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>