Let's start from afar. Let us imagine that the scientists of the nineteenth century in some magical way got a modern computer. They would study his work, create a whole science describing the properties of the operating system and the installed programs. Then they would have opened this computer and tried to describe its main nodes, to understand their purpose. Then they would measure the voltage at various points. Various theories would arise about the flow of information circulating inside a computer. There would be a theory of its silicon-based. Someone would receive a Nobel Prize for the discovery of the principles of the semiconductor valve. But the most important thing is that the complexity of the device of a modern computer would make it difficult for those scientists to understand the rather simple principles underlying any computing technology. These principles were formulated in the "Turing machine" and have not changed to this day, and it does not matter whether the computer is assembled on lamps, transistors or microchips. Any computer has a memory, a command system, a processor that is able to execute these commands, programs consisting of a sequence of commands and an input / output device that allow interaction with the outside world. The rest of the "bells and whistles" that have arisen as a result of the evolution of computing technology, although they multiply the capabilities of a computer many times, do not cancel these principles.
The study of the human brain is a lot like a painted picture. We know a lot about its internal structure, deeply studied the processes occurring in neurons, but for many researchers an abundance of diverse knowledge obscures the understanding of fairly simple principles underlying the brain.
We set ourselves the goal of creating a “brain” of a simple device that will use in its existence the same principles that are inherent in living beings. Of course, the real brain is much more complicated, but now I will try to formulate the basic principle, which is as fundamental for understanding the operation of the brain as the understanding of the “Turing machine” is fundamental for understanding the operation of a modern computer.
In the previous post
“Emotions of a person and a computer light bulb” I described the role of emotions and memory, briefly repeat.
')
Initially, all actions are consequences of reflexes. Emotions do not "push" us to any behavior. Emotions "give a rating" to everything that happens. There is always a final scalar score on the “good / bad” scale. The final grade is recorded by the memory along with the “situation” that caused this grade. “Situations” contain not only the external picture of the world, but also our reaction to it, our actions. Memory afterwards, reacting to external influence, “forces” to perform any actions or “prevents” them. Moreover, the actions that we perform on the basis of our experience are most likely, in comparison with other possible actions, will lead to a positive change in the emotional state. The emotions that accompany our actions cannot be interpreted as “motivators of action”, these are assessments of what is happening, which are necessary for the formation of experience.

Now consider the device shown in the figure.
Each of the circles denotes a formal neuron - an artificial analogue of a real brain neuron. With the exception of the "regulator", which itself represents a simple construction that can be assembled from neurons. The device uses several, slightly different in properties, types of neurons. We describe them:
- - “Sensors”, that is, neurons that receive some information about the world and are in a state of activity while the irritation to which they react is present;
- - “Executive neurons” - they are activated if the sum of the signals of the inputs exceeds a certain threshold value. By activating, executive neurons activate actuators associated with them. Upon termination of the activation condition, the neurons return to the inactive state and stop the operation of the actuator. Signals arriving at the inputs of executive neurons can be activating (+1) or inhibiting (-1). The threshold value can be made dependent on the number of active inputs;
- - “Reflexes” - neurons, whose connections are initially defined. These connections form a matrix of reflexes. The neurons themselves are activated when a well-defined pattern of sensor activity occurs, and the combination of sensor activity that leads to this is set initially. In the case of activation, reflexes give an activating (+1) or inhibiting (-1) signal to the executive neurons;
- - “Emotional reflexes” - neurons that work in the same way as reflexes, with the only difference being that the activating signals come to emotions;
- - “Emotions” - neurons that are activated in case of activation of emotional reflexes closed on them. The totality of the activity of neurons, "emotions", forms an "emotional background", that is, how our world perceives and evaluates our device reflected through sensors. A change in the state of the sensors may lead to a change in the emotional background. Every time there is a change in the emotional background, that is, the state of any of the neurons, the “emotions,” changes, we will record the current picture of activity on one of the neurons of memory. Responsible for this process "regulator". He chooses a free neuron and gives him a command to memorize, and also tells how the emotional state has changed (+1 or -1).
The change in emotional state will be evaluated as follows:
(+1) - if the change led to an improvement in the emotional background, that is, the value of “good” minus “bad” increased (where “good”, “bad” take the values ​​0 or 1 and correspond to inactivity or activity of the neuron “emotions”). For example, (+1) occurs when a positive emotion appears (“good”) or a negative emotion stops (“bad”);
(-1) - if the change led to a deterioration of the emotional background, that is, the value of “good” minus “bad” decreased (where “good”, “bad” take the values ​​0 or 1 and correspond to the inactivity or activity of the neuron “emotions”). For example, (-1) occurs when a negative emotion appears (“bad”) or a positive emotion (“good”) stops.
If, with the change in the state of both neurons, the “emotions,” the final emotional state has not changed, then the reader can choose not to remember such an event or introduce the principle of domination of one emotion over another.
In general, it makes no sense to limit emotions to values ​​-1,0,1. In humans, emotions manifest themselves with different powers. But now we limit ourselves to show a high-quality picture. - - “Memory” - neurons that can be in three modes.
Mode 1. Initially, all neurons of memory are pristine clean and do not affect the operation of the system.
Mode 2. At the command of the "regulator" memory neurons are able to capture a picture of the activity of other neurons associated with them (sensors, emotions, executive neurons). The state of activity on connections and the direction of change in the emotional state of the system are fixed (+1) or (-1).
Mode 3. Having remembered the picture, neuron of memory passes into a new state. In this state, the neuron is activated if it “recognizes” the picture of activity that corresponded to the moment of memorization. Activating in the case of a certain kind of “repetition” of the pattern of neuron activity, corresponding to the moment of memorization, the neuron of memory sends signals in all directions that were active at the moment of memorization. Moreover, if at the moment of memorizing a change in the emotional state mattered (+1), then the signal is given an activating (+1), if the value was (-1), then the inhibiting (-1); - “The“ regulator ”is rather not a separate neuron, but a certain node that can be assembled from simpler“ classical ”neurons, but now I would not like to be distracted by the description of its possible device. The controller gives commands to memory neurons to memorize and tells them the direction of change in the emotional state.
Such a device, which, by the way, is easy to put into practice, behaves like a living organism. At first, his behavior is completely determined by reflexes and is a reaction to the state of the sensors. But, besides reflexes, the device has the ability to form instincts, that is, the ability to experience emotions and to memorize events that lead to their changes. Over time, memory accumulates information about which behavior is optimal in a given situation in terms of maximizing positive emotions. Memory begins to influence actuators. Purely reflex behavior shifts towards the instinctive.
Consider how this happens. While the memory is clear, the state of the executive neurons is determined by the neurons of the reflexes. Facing situations “stitched” in reflexes, our device will perform the action provided by them. What reflexes are appropriate - this is determined by natural selection. With regard to living beings, it can be said that reflexes will arise and fix, which will provide behavior that contributes to:
- - survival and reproduction;
- - early learning instinctive behavior.
When performing various actions, which pushed reflexes, will change the state of neurons, "emotions". What emotions will arise depends on the neurons of the “emotional reflexes”. They recognize the picture on the "sensors" and "treat" it as "good" or "bad." The fact of assessing the situation in terms of emotions does not entail any immediate action; memory simply captures all situations in which the emotional background has changed. In other words, each memory neuron captures the memory of a certain situation (what the situation is, is already determined by the state of the “sensor” neurons) and stores information about whether the action performed in this situation improved or worsened the emotional state.
Further, neurons of memory, “recognizing” situations that correspond to their “experience”, begin to contribute to the formation of actions. Due to the activation processes, they stimulate to actions that gave an improvement in the state, and due to the processes of inhibition, they warn against actions that led to its deterioration. Under the conditions when there are not so many sensors reflecting the outside world, conflicting memories can be recorded in the memory. With the same picture on the sensors, the same actions can lead to different results. This means that either due to lack of information two different external situations were identified, or the phenomenon itself is random. In such situations, the accumulation of experience will lead to the fact that the executive neurons, summing the signals of excitation and inhibition, will choose the action in which the probability of positive changes in the emotional state is higher.
If we want to improve our device, then, looking at the human brain, we can understand that we have a lot of "evolutionary techniques" in stock. For example:
- - You can do the topology of the device. For example, place the sensors on a plane (sensory layer) and group them according to the information they carry (sound, visual, etc.) Next, place the neurons of the memory with a “layer of cortex” above them and cover mainly those areas above which they are connected, thus giving the memory division into subject areas);
- - Neurons of memory can be given the opportunity to have connections among themselves, allowing them to include memory in the picture of the current presentation and thus, by changing the recognition, to make it more resistant to stereotypical situations;
- - It is possible to build on higher layers of memory that will allow to recognize and memorize more complex, “abstract” constructions;
- - You can enter the mechanism of imprinting - when for some set of signs a certain object will be recognized, the situation, the state, and they will be tied to certain sets of emotions and reflexes (The instinct will not be directed to those signs that caused the imprinting, but to a phenomenon fixed by memory, recognized by additional features that were initially absent);
- - It is possible to use not only existing connections to transfer information between neurons, but also to introduce certain control signals that are immediately accessible to all neurons of the automata’s brain, and with their help to realize, for example, the operation of the “controller”;
- - You can increase the number of emotions, make their picture much more difficult;
- - You can enter the parameter "power of emotion" and take it into account when "memorizing" and "managing";
In general, there is no limit to perfection ...
The described device can adapt to the environment, evolve, but not think. For thinking, he needs significant changes in the design and the introduction of new principles. I will try to describe them in subsequent posts.