Emotions in neural networks

    While indulging in neural networks and self-learning algorithms for them, I came across the thought that a learning algorithm with a teacher could well be classified as self-learning if teachers were replaced with “emotional” neurons. Such neurons, in fact, are simply good / bad sensors, and when connected to ordinary neurons, they create certain connections that quench or excite depending on the type of sensor. This is an exceptionally superficial description of a principle that has not been developed in neuroscience for two simple reasons.

    1. Modern networks do not have simultaneous stability and plasticity, that is, the process of correct operation of the network is not compatible with its training. Learning new things in modern networks, they successfully forget the old, so an unchangeable cast of the neural network is used for work after training, which does not need to be managed.

    2. The specificity of our requirements for a working network, even if it has both stability and plasticity, does not allow it to make mistakes, and it is impossible to avoid this in training. Why are we asking a system that can not only physically fail, but also has something like a “human factor”?

    I set myself the goal of creating a model on a neural network to control an amoeba in a flat space, tending to turn around towards the goal and get to it. The task is very trivial, but the whole problem was that the amoeba should learn this herself without my help. After all, creating automatic systems, we still pre-set all the solutions for the whole set of conditions of that particular task that the machines will perform, and we also do not allow systems to learn in the process of their functioning. In beautiful words, this can be described as follows: "The solution to the problem is not laid down in the control system in advance, we shift to the system not only the execution of the task, but also finding a solution to this problem."

    We are so used to pre-laying solutions in automatic systems that it is difficult to imagine an abstract model of a self-learning and independently finding solutions to an automatic system. Do not step on the same rake, thinking that in the finale we just need to tell in some form how to solve the problem. Someday, an automaton will be able to understand the information received from us and use other people's experience, but in reality we will have to start working with a system that does not yet have any skills other than the ability to learn, perceive the environment and influence it. It turns out from a conventional automatic system that you need to immediately throw out a pre-embedded solution, and put in it a computing subsystem that implements something like our brains. Therefore, I use the neural network as the closest semblance of the brain.

    But after the first meeting with such a machine you will realize that he is a complete autist, do not care and the world around him is deeply indifferent. But we still need him to be able, too, as before we threw out our embedded solution. I missed one important thing, forgot to put in front of the system a condition for solving our problem. The system needs to be made clear when its actions satisfy the conditions for solving our problem and vice versa. The central word here is the word "understand", and it is the neural network that must "understand" what we want from it. There is no need to invent anything special here, just primitively repeat the existing one, and yes, the “language of emotions” pre-built into us. I will not particularly talk about the only common "language of emotions." I can only say that we all not only feel emotions, but also react to them equally, showing body language, how do we feel. What we will use is the carrot and stick method, because it works even with the simplest animals, it implies the presence of emotional feelings of pleasant and unpleasant (pain). We are endowed with a larger set of emotions than these feelings, but such a set is quite enough for the amoeba model and our task. By adding sensors of rotation to the target, movement to the goal and vice versa, as well as adding emotional coloring to them, we explain the problem and motivate the neural network to solve our problem.

    This is a key moment for the neural network, since we are introducing a system of motivation and communication (at least we will be able to “turn” to the amoeba). The behavior of our amoeba by an external observer will cause a strong association with motivated behavior and the presence of emotional perception in it.

    Further, the actual description of the device of neurons, sensors, and the neural network as a whole is short, but rather difficult due to the lack of explanations of why. Reading is optional. You can read the conclusions.

    Network device

    The main properties of the neuron model that I use.
    • The output of the result by the neuron is delayed by one clock cycle of the network. The main advantage is the ability to connect neurons in general as you like, because it does not bring errors to the network logic, first all the values ​​of all neurons are calculated, and then their outputs are updated.
    • I use only two values ​​at the output of neurons "0" and "1".
    • The output of a neuron can form a “negative” and “positive” synapse, as well as this synapse can change its state from “positive” to “negative” and vice versa.
    • The activation function is calculated as the difference between the active positive and negative inputs. If the difference is positive, the result is “1”, if not, then “0”.
    • The synapse strives to become “positive” if the result of the activation function is “1”, and “negative” only if now the result is “0”, and the previous result was “1”.
    • Neurons are limited to the zone of establishing connections, so the network topology begins to play a role.

    The neurons in my network are divided into several types
    • Sensors Conventional sensors presented on the network only outputs.
    • Effectors. Motor neurons, outputs control muscles, and the network is represented only by inputs.
    • Emotional Sensors. It is the same as ordinary sensors, but they establish unchanging connections, only positive or negative in nature, depending on the type of sensor and cannot change the state of these connections.
    • Ordinary. I described them in my first article . You don’t need to think in the problem, it is solved at the level of “conditioned reflexes”, so I do not use them here.

    The network is a two-dimensional space in which the position of the neurons is set by coordinates, due to the limited radius of responsibility, communications are established only between closely located neurons. At the very beginning, there are no connections between neurons at all. Effectors are randomly activated until the first connections are established. Connections are established the faster, the closer and more often neurons are simultaneously active (Hebb's rule). In the final, the topology looks like this.

    Figure 1. Topology of the section of the neural network responsible for turns. The
    circles indicate the zones of responsibility of neurons. The same topology has the part of the neural network responsible for moving to the target. Both parts of the network are not connected.


    There were no memorizing ordinary neurons, you don’t need to think in the problem, it is solved at the level of arising conditioned reflexes, so here I do not use them. The central role in solving the problem was played by the network topology, how neurons and sensors are placed. It is very important how you prepare the neural network, in fact, set the task for the solution. Further, the amoeba makes attempts to move, connections are established between simultaneously active neurons, in the final, the emotions of pain and pleasant direct it to the goal.

    Fig 2. The path of the amoeba.
    She turns and crawls to the goal.

    Fig 3. Screenshot.
    And so it looks with tracing disabled.

    Also popular now: