Unified learning method and system supporting balanced propagation and predictive coding
Through a unified learning method and adaptive learning rate adjustment, it solves the problem of lack of unified theory and convolution operation between energy model-based algorithms, realizes multi-convolution network calculation and efficient training, and improves the performance and flexibility of the network.
Patent Information
- Application Number
- CN202310317729.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-03-23
AI Technical Summary
Existing algorithms based on energy models lack a unified theoretical connection, cannot use convolution operations in the energy function, and it is difficult to adjust the learning rate, making training difficult.
Propose a unified learning method that supports balanced propagation and predictive coding. By analyzing the calculation graph of the algorithm, the network structure and energy function of the unified learning model are constructed, and the convolution operator is defined, and the energy function is configured to support multi-convolution network calculations. Adaptively adjust the learning rate to optimize the network structure.
It realizes the connection of isolated energy models, expands the computing power of energy functions, simplifies the training process of different network structures, and improves the convergence speed and flexibility of the network.
Smart Images

Figure CN118690819A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of neural network computing and optimization technology, and in particular relates to a unified learning method and system supporting balanced propagation and predictive coding. Background Art
[0002] The biological mechanism of the human brain has always been an unresolved issue. The method of neural signal transmission in the brain, the basic principles it relies on, and how to achieve credit allocation are unresolved issues in neuroscience. Based on some basic laws that have been determined in biology, experts in computer scientists, physicists, mathematicians, and other fields have begun to model them, and based on the above basic laws, they have proposed many "biologically reasonable" algorithms. Most of these algorithms are based on back propagation (BP) and aim to further approach the computational effect brought by BP by improving theoretical and technical capabilities. These algorithms also need to perform gradient calculations, and their gradient calculations are to a certain extent similar to the gradients calculated by BP, and have more friendly characteristics for neuronal circuits. They can operate in a way that more closely meets the constraints imposed by neural circuits. Many such algorithms combine the principles of physical dynamics and thermodynamics, and use the inherent principles of energy steady state in thermodynamics. In the process of learning, they always follow the constraints of the energy field. At the same time, these algorithms use the framework of energy-based models (EBM). The core of the framework based on energy models is the energy function. By defining a suitable energy function, the energy-based framework can help the entire dynamic system gradually converge and reach a steady state. All free variables in these energy-based models are optimized with the goal of minimizing the energy function.
[0003] In existing scientific research, algorithms based on energy models have attracted more and more attention, but these algorithms exist in isolation and there is no unified theory to link them together. The error back propagation algorithm (BP) has become the basic working algorithm for the recent significant success of deep learning. However, from the perspective of neuroscience, BP is often criticized as being biologically unreasonable. Well, considering that the credit assignment problem faced by the brain is at least as challenging as that of deep neural networks, a fundamental question is whether the brain uses back propagation to perform credit assignment. The answer to this question fundamentally depends on whether there is a biologically feasible algorithm that approximates BP that can be implemented in neural circuits. A large number of potential algorithms have been proposed in the prior art, however, there is little understanding of the connections and relationships between them, and so far, the field has mainly manifested itself as a set of different algorithms and ideas without any unification or basic principles.
[0004] For different network structures and tasks of different difficulty, the learning ability of the network depends on the design of the energy function. Whether the design of the energy function is reasonable seriously affects the performance of the entire model. Therefore, in general scientific research work, the construction of the network topology directly determines the learning difficulty of the network, while the design of the energy function will lead to the convergence effect of the network. In actual scientific research and development tasks, academia and industry urgently need a unified framework that can not only assist the progress of scientific research work, but also help improve its development efficiency in the engineering field.
[0005] In current research work, "biological rationality" is mentioned more and more frequently. The scientific research community and the industrial community are increasingly interested in biologically explainable algorithms, and algorithms that conform to the characteristics of biological information transmission will play an increasingly important role in future development. However, in current research, the "biological rationality" algorithm is still immature to a certain extent for application in the industrial world, and the application scenarios need further exploration. The scientific research community also needs to further improve related work and improve the performance of the algorithm and various indicators so that the algorithm can achieve more and more complex tasks in complex scenarios. In the scientific research community, there are several issues regarding the development of algorithms:
[0006] For algorithms based on energy models, most of them exist in isolation. There are many correlations between similar algorithms, but there are also certain differences between them. These differences more or less affect the learning and training of different algorithms in a unified way. There is a lack of connection between the existing algorithms based on energy models. In scientific research tasks, it is often necessary to use different methods for comparative experiments. By comparing the results of different methods, we can find the advantages of each other, which is not only conducive to the progress of scientific research, but also conducive to the improvement of work efficiency. However, there is still no relevant work focusing on in-depth exploration of this aspect.
[0007] For example, the energy function used in balanced propagation uses weights and biases in the neural network. Directly using weights and biases for calculations in the energy function is a common practice for most energy functions. When defining connections in the energy function and using weights and biases in the connection, states and weights are required for calculation. Therefore, only the weights of the fully connected neural network can be used for calculation. The weights of the convolution cannot be used in the commonly used energy functions. Therefore, convolutional neural networks cannot be used in the calculation of the defined energy function.
[0008] Most of the current energy model-based algorithms have difficulty in learning and training. The root cause lies in inappropriate energy function settings, inappropriate learning rate settings, and inappropriate network structures. For different energy functions and network structures, if there is a suitable learning rate, learning and training are possible to a certain extent. For the calculation of the energy function, the energy of each layer needs to reach the lowest point, so the setting of the learning rate of each layer is very important. In order to avoid the problem of gradient disappearance and reduction, the learning rate needs to be adjusted according to the changes in the historical gradient, but there is still no related work. Summary of the invention
[0009] The technical problems to be solved by the present invention are mainly the following: 1. Abstracting the commonalities of algorithms based on energy models and linking them with a unified theory; 2. For example, in terms of the energy function used in the classical balanced propagation algorithm, it is not possible to use convolution on the definition form of the energy function; 3. There is no optimizer that specifically adjusts and modifies its own learning rate for the energy model used.
[0010] In view of the above technical problems, the present invention proposes a unified learning scheme that supports balanced propagation and predictive coding.
[0011] The first aspect of the present invention discloses a unified learning method supporting balanced propagation and predictive coding. The method comprises: step S1, based on the calculation graphs of the balanced propagation algorithm and the predictive coding algorithm, determining the network structure and connection type of a unified learning model that supports both the balanced propagation algorithm and the predictive coding algorithm; step S2, extracting the energy functions of the balanced propagation algorithm and the predictive coding algorithm, configuring the interaction terms of the energy functions, and using the configured energy function as the energy function of the unified learning model to support multi-convolutional network calculation; step S3, the user end extracts the network structure, connection type and energy function of the unified learning model to construct a qualified multi-layer neural network structure, and optimizes the multi-layer neural network structure using an optimizer.
[0012] According to the method of the first aspect of the present invention, the step S1 specifically includes: parsing the calculation graph of the balanced propagation algorithm to extract the network state and weight of the balanced propagation algorithm as the first network state and the first weight respectively; parsing the calculation graph of the predictive coding algorithm to extract the network state and the weight of the predictive coding algorithm as the second network state and the second weight respectively; taking each state of the first network state and the second network state as a node, and taking the association relationship between each node as an edge, to construct the network structure of the unified learning model; according to the first weight and the second weight, determining the weight between each node as the value of each edge to characterize the connection type of the unified learning model; creating a first interface so that the user end obtains the network structure and connection type of the unified learning model via the first interface.
[0013] According to the method of the first aspect of the present invention, the step S2 specifically includes: extracting the energy functions of the balanced propagation algorithm and the predictive coding algorithm, encapsulating the energy functions, and creating a second interface so that the user terminal obtains the energy function via the second interface; parsing several interaction terms of the energy function, defining a convolution operator between two state quantities on the interaction terms, and obtaining the configured energy function; wherein the energy function before configuration is:
[0014]
[0015] Among them, s i represents the state of node i, ρ() represents the activation function, and w ij represents the weight between node i and node j, b ij represents the deviation of the weight between node i and node j; the convolution operation of the convolution operator is:
[0016]
[0017] Among them, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, x and y represent the integral variables, representing the integration in the direction of x or y axis, and the configured energy function is:
[0018]
[0019] According to the method of the first aspect of the present invention, the step S3 specifically includes: the user end extracts the network structure and connection type of the unified learning model via the first interface, and extracts the energy function of the unified learning model via the second interface to construct the multi-layer neural network structure; for each layer of the multi-layer neural network structure, the same learning rate is set and training is performed, the real-time status of the network structure, the connection type and the configured energy function during the training process is analyzed, the real-time weight and gradient distribution are calculated, and the gradient range for learning of each layer of the neural network is determined; according to the gradient range, the global learning rate and the global gradient are determined, and the optimal learning rate is assigned to each layer of the neural network based on the global learning rate and the global gradient, and an independent optimizer is set in each layer of the neural network, and the parameters of the optimizer are continuously optimized during the learning process until the cutoff condition is reached.
[0020] The second aspect of the present invention discloses a unified learning system that supports balanced propagation and predictive coding. The system includes: a first processing unit, configured to: determine the network structure and connection type of a unified learning model that supports both the balanced propagation algorithm and the predictive coding algorithm based on the calculation graphs of the balanced propagation algorithm and the predictive coding algorithm; a second processing unit, configured to: extract the energy functions of the balanced propagation algorithm and the predictive coding algorithm, configure the interaction terms of the energy functions, and use the configured energy function as the energy function of the unified learning model to support multi-convolutional network calculations; a third processing unit, configured to: extract the network structure, connection type and energy function of the unified learning model to construct a qualified multi-layer neural network structure, and optimize the multi-layer neural network structure using an optimizer.
[0021] According to the system of the second aspect of the present invention, the first processing unit is specifically configured to: parse the calculation graph of the balanced propagation algorithm to extract the network state and weight of the balanced propagation algorithm as the first network state and the first weight, respectively; parse the calculation graph of the predictive coding algorithm to extract the network state and the weight of the predictive coding algorithm as the second network state and the second weight, respectively; use the first network state and the second network state as nodes, and the association relationship between the nodes as edges to construct the network structure of the unified learning model; determine the weights between the nodes according to the first weight and the second weight as the values of the edges to characterize the connection type of the unified learning model; create a first interface so that the user end obtains the network structure and connection type of the unified learning model via the first interface.
[0022] According to the system of the second aspect of the present invention, the second processing unit is specifically configured to: extract the energy functions of the balanced propagation algorithm and the predictive coding algorithm, encapsulate the energy functions, and create a second interface so that the user terminal obtains the energy function via the second interface; parse several interaction terms of the energy function, define a convolution operator between two state quantities on the interaction terms, and obtain the configured energy function; wherein the energy function before configuration is:
[0023]
[0024] Among them, s i represents the state of node i, ρ() represents the activation function, and w ij represents the weight between node i and node j, b ij represents the deviation of the weight between node i and node j; the convolution operation of the convolution operator is:
[0025]
[0026] Among them, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, x and y represent the integral variables, representing the integration in the direction of x or y axis, and the configured energy function is:
[0027]
[0028] According to the system of the second aspect of the present invention, the third processing unit is specifically configured to: extract the network structure and connection type of the unified learning model via the first interface, and extract the energy function of the unified learning model via the second interface to construct the multi-layer neural network structure; for each layer of the multi-layer neural network structure, set the same learning rate and perform training, analyze the real-time status of the network structure, the connection type and the configured energy function during the training process, calculate the real-time weight and gradient distribution, and determine the gradient range for learning of each layer of the neural network; determine the global learning rate and global gradient based on the gradient range, assign the optimal learning rate to each layer of the neural network based on the global learning rate and the global gradient, and set an independent optimizer for each layer of the neural network, and continuously optimize the parameters of the optimizer during the learning process until the cutoff condition is reached.
[0029] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the unified learning method supporting balanced propagation and predictive coding described in the first aspect of the present disclosure are implemented.
[0030] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the unified learning method supporting balanced propagation and predictive coding described in the first aspect of the present disclosure.
[0031] In summary, the technical solution proposed in the present invention abstracts the commonalities of two local learning algorithms (balanced propagation and predictive coding), integrates them together, and through this framework, enables the two algorithms to produce results that approximate BP. Different energy model-based algorithms can use this feature in a flexible way, which can enable users to achieve scientific research results and define new computing modes according to their own needs. The present invention also provides a theoretical method that unifies two different algorithms to approximate BP with weak feedback (predictive coding (PC) and balanced propagation (EP). The above algorithms are all cases of general mathematical properties of the energy-based model framework on which they are based, and therefore can be generalized to new energy functions and derive new algorithms that have not yet been described. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A flowchart of a unified learning method supporting balanced propagation and predictive coding according to an embodiment of the present invention;
[0034] Figure 2 is a pseudo code for the operation of the optimizer according to an embodiment of the present invention;
[0035] Figure 3 is a schematic diagram of a topological structure according to an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of a feasibility verification result according to an embodiment of the present invention;
[0037] Figure 5 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0039] The present invention aims to use a unified theory to link a variety of isolated algorithms based on energy models, and solve the problem that the classical balanced propagation algorithm cannot use convolution in the form of Hopfield energy function and it is difficult to select appropriate learning rates for different layers in deep networks. The main technical concepts of the present invention include: abstracting the commonalities of methods based on energy models and linking these models with a unified theory; defining convolution operators in the form of Hopfield energy functions and extending linear calculations to convolution calculations; defining methods for adaptively adjusting learning rates based on gradients, making training under different network structures more convenient. Based on the classical algorithms based on energy models, the present invention abstracts the commonalities between different algorithms, fully explores the gradients and weight distributions between network layers, combines learning rate adjustment rules, effectively improves the convergence speed of the network, and applies convolution to the calculation of Hopfield energy functions. The unified learning framework is highly convenient and practical, and at the same time strongly supports the development of a variety of algorithms based on energy models.
[0040] A first aspect of the present invention discloses a unified learning method supporting balanced propagation and predictive coding. Figure 1 FIG. 4 is a flowchart of a unified learning method supporting balanced propagation and predictive coding according to an embodiment of the present invention; Figure 1 As shown, the method includes: step S1, based on the calculation graph of the balanced propagation algorithm and the predictive coding algorithm, determining the network structure and connection type of a unified learning model that simultaneously supports the balanced propagation algorithm and the predictive coding algorithm; step S2, extracting the energy functions of the balanced propagation algorithm and the predictive coding algorithm, configuring the interaction terms of the energy functions, and using the configured energy function as the energy function of the unified learning model to support multi-convolutional network calculation; step S3, the user end extracts the network structure, connection type and energy function of the unified learning model to construct a qualified multi-layer neural network structure, and uses an optimizer to optimize the multi-layer neural network structure.
[0041] In some embodiments, the step S1 specifically includes: parsing the calculation graph of the balanced propagation algorithm to extract the network state and weight of the balanced propagation algorithm as the first network state and the first weight, respectively; parsing the calculation graph of the predictive coding algorithm to extract the network state and the weight of the predictive coding algorithm as the second network state and the second weight, respectively; taking each state of the first network state and the second network state as a node, and taking the association relationship between each node as an edge, to construct the network structure of the unified learning model; according to the first weight and the second weight, determining the weight between each node as the value of each edge to characterize the connection type of the unified learning model; creating a first interface so that the user terminal obtains the network structure and connection type of the unified learning model via the first interface.
[0042] In some embodiments, the step S2 specifically includes: extracting the energy functions of the balanced propagation algorithm and the predictive coding algorithm, encapsulating the energy functions, and creating a second interface so that the user terminal obtains the energy function via the second interface; parsing several interaction terms of the energy function, defining a convolution operator between two state quantities on the interaction terms, and obtaining the configured energy function; wherein the energy function before configuration is:
[0043]
[0044] Among them, s i represents the state of node i, ρ() represents the activation function, and w ij represents the weight between node i and node j, b ij represents the deviation of the weight between node i and node j; the convolution operation of the convolution operator is:
[0045]
[0046] Among them, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, x and y represent the integral variables, representing the integration in the direction of x or y axis, and the configured energy function is:
[0047]
[0048] In some embodiments, step S3 specifically includes: the user end extracts the network structure and connection type of the unified learning model via the first interface, and extracts the energy function of the unified learning model via the second interface to construct the multi-layer neural network structure; for each layer of the multi-layer neural network structure, the same learning rate is set and training is performed, the real-time status of the network structure, the connection type and the configured energy function during the training process is analyzed, the real-time weight and gradient distribution are calculated, and the gradient range for learning of each layer of the neural network is determined; according to the gradient range, the global learning rate and the global gradient are determined, and the optimal learning rate is assigned to each layer of the neural network based on the global learning rate and the global gradient, and an independent optimizer is set in each layer of the neural network, and the parameters of the optimizer are continuously optimized during the learning process until the cutoff condition is reached.
[0049] Specifically, the commonality of energy model-based algorithms is extracted, and an interface is provided for users to create connections and define energy functions. Convolution operators are defined in the calculation form of energy functions, and linear operations are extended to convolution calculations to support more convolutional network calculations. Based on the energy and weight distribution in network connections, the law of gradient and weight changes is found, and the optimizer is designed according to the law.
[0050] Specifically, the computational graph of balanced propagation is parsed, and the network state and weight are abstracted from the computational graph; the computational graph of predictive coding is parsed, and the network state and weight are abstracted from the computational graph; the network state is abstracted into a node class, the weight connection is abstracted into an edge class, and related operations are defined on the two base classes to form the lowest level interface of the framework; the definition of the energy function is encapsulated into a module, and a user-defined interface is given.
[0051] Specifically, the interaction terms of different energy functions are analyzed, and the convolution operator is defined in the form of the interaction term. For example, the Hopfield energy function is in the form of E1, where w is the connection weight of the fully connected neural network. The connection between two states is defined as a convolution operation, and the transformation of the convolution is as follows:
[0052]
[0053] Therefore, the energy function becomes:
[0054] Specifically, a multi-layer neural network structure is built, the same learning rate is set for all layers, and training is performed; the weights and gradient distributions generated by the network during the training process are analyzed to find the gradient range that each layer of the neural network can learn; based on the gradient range, the global learning rate and global gradient that can be learned are found, and based on this standard, the optimal learning rate is assigned to each layer; after the learning rate allocation for each layer is completed, an independent optimizer is set for each layer to continuously optimize the parameters during the learning process.
[0055] Specifically, according to the sequence g composed of the characteristics of all layers, it is necessary to find a suitable learning rate based on the gradient. Define the global learning rate as l, define the method for transforming the gradient as f1, define the method for obtaining the global standard gradient as f2, define the optimizer used as f3, define the transformed gradient after combining historical information as v, and define the proportional coefficient as β. Use f1 to transform the gradient information of each layer to obtain measure, and use the proportional factor β to control the proportion of combining historical information. After obtaining the global standard gradient, use the formula Calculate the appropriate learning rate for each layer of the network. The pseudo code for the optimizer is as follows: Figure 2 shown.
[0056] In some other embodiments, the cifar10 dataset is loaded and processed to complete the image classification task experiment. The custom energy function is as follows:
[0057]
[0058] The energy calculated at each layer is set to a scaling factor α(i) so that each layer can converge to its own lowest energy, thereby further reducing the total energy. Customize the network topology and create a network adjacency matrix. The topology is as follows: Figure 3 Experiments on such a setting produce the following results: Figure 4 shown.
[0059] In current scientific research, many problems will arise in the practical application of existing methods. First, in the existing energy model-based methods, their commonality is obvious, and they are all algorithms based on energy models. However, in current research work, these algorithms exist in isolation, and there is no unified theory to link them together; secondly, for current energy functions, such as the Hopfield energy function, the design of the energy function cannot use convolution calculations in the intermediate calculation process, so the energy calculation cannot be extended to convolution; finally, for training neural networks using balanced propagation or predictive coding, the design of the network structure has a great impact on performance. The network will become very sensitive to changes in network parameters, and for different network structures, it is difficult to find a suitable learning rate. The setting of the learning rate will affect the convergence speed of the network model. In response to the above problems.
[0060] The technical solution of the present invention unifies the energy model-based methods (such as balanced propagation and predictive coding) in a framework, and users can customize energy functions and flexibly change the modifiable items and functions in the calculation process, so that the unified framework can complete various types of complex tasks according to their own needs. The technical solution of the present invention defines the convolution operator of the interaction term of the network state calculation in the interaction term in the energy function (such as Hopfield) used in the energy model-based method, and expands the convolution calculation from linear calculation to convolution calculation, making the framework more flexible and the coverage of the energy function wider; the hierarchical adaptive self-adjusting optimization rate optimizer of the present invention assigns the search for the most suitable learning rate for each layer of the network to the optimizer, so that the optimizer supervises the gradient of each layer of the network and adjusts the learning rate according to the change of the gradient.
[0061] The second aspect of the present invention discloses a unified learning system that supports balanced propagation and predictive coding. The system includes: a first processing unit, configured to: determine the network structure and connection type of a unified learning model that supports both the balanced propagation algorithm and the predictive coding algorithm based on the calculation graphs of the balanced propagation algorithm and the predictive coding algorithm; a second processing unit, configured to: extract the energy functions of the balanced propagation algorithm and the predictive coding algorithm, configure the interaction terms of the energy functions, and use the configured energy function as the energy function of the unified learning model to support multi-convolutional network calculations; a third processing unit, configured to: extract the network structure, connection type and energy function of the unified learning model to construct a qualified multi-layer neural network structure, and optimize the multi-layer neural network structure using an optimizer.
[0062] According to the system of the second aspect of the present invention, the first processing unit is specifically configured to: parse the calculation graph of the balanced propagation algorithm to extract the network state and weight of the balanced propagation algorithm as the first network state and the first weight, respectively; parse the calculation graph of the predictive coding algorithm to extract the network state and the weight of the predictive coding algorithm as the second network state and the second weight, respectively; use the first network state and the second network state as nodes, and the association relationship between the nodes as edges to construct the network structure of the unified learning model; determine the weights between the nodes according to the first weight and the second weight as the values of the edges to characterize the connection type of the unified learning model; create a first interface so that the user end obtains the network structure and connection type of the unified learning model via the first interface.
[0063] According to the system of the second aspect of the present invention, the second processing unit is specifically configured to: extract the energy functions of the balanced propagation algorithm and the predictive coding algorithm, encapsulate the energy functions, and create a second interface so that the user terminal obtains the energy function via the second interface; parse several interaction terms of the energy function, define a convolution operator between two state quantities on the interaction terms, and obtain the configured energy function; wherein the energy function before configuration is:
[0064]
[0065] Among them, s i represents the state of node i, ρ() represents the activation function, and w ij represents the weight between node i and node j, b ij represents the deviation of the weight between node i and node j; the convolution operation of the convolution operator is:
[0066]
[0067] Among them, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, x and y represent the integral variables, representing the integration in the direction of x or y axis, and the configured energy function is:
[0068]
[0069] According to the system of the second aspect of the present invention, the third processing unit is specifically configured to: extract the network structure and connection type of the unified learning model via the first interface, and extract the energy function of the unified learning model via the second interface to construct the multi-layer neural network structure; for each layer of the multi-layer neural network structure, set the same learning rate and perform training, analyze the real-time status of the network structure, the connection type and the configured energy function during the training process, calculate the real-time weight and gradient distribution, and determine the gradient range for learning of each layer of the neural network; determine the global learning rate and global gradient based on the gradient range, assign the optimal learning rate to each layer of the neural network based on the global learning rate and the global gradient, and set an independent optimizer for each layer of the neural network, and continuously optimize the parameters of the optimizer during the learning process until the cutoff condition is reached.
[0070] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the unified learning method supporting balanced propagation and predictive coding described in the first aspect of the present disclosure are implemented.
[0071] Figure 5 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 5 As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.
[0072] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0073] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the unified learning method supporting balanced propagation and predictive coding described in the first aspect of the present disclosure.
[0074] It can be seen that the technical solution proposed by the present invention abstracts the commonality of balanced propagation and predictive coding based on the energy model, and unifies them with a unified theory. The present invention defines the convolution operator in the form of the Hopfield energy function, and extends the linear calculation to the convolution calculation. The present invention defines the rule of adaptively adjusting the learning rate according to the gradient, and based on this rule, designs and implements an optimizer for adaptively adjusting the learning rate, so that training under different network structures becomes more convenient.
[0075] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A unified learning method supporting balanced propagation and predictive coding, characterized in that The method comprises: Step S1, based on the calculation graphs of the balanced propagation algorithm and the predictive coding algorithm, determining the network structure and connection type of a unified learning model that supports both the balanced propagation algorithm and the predictive coding algorithm; Step S2, extracting energy functions of the balanced propagation algorithm and the predictive coding algorithm, configuring interaction terms of the energy functions, and using the configured energy functions as the energy function of the unified learning model to support multi-convolutional network calculations; Step S3: The user terminal extracts the network structure, connection type and energy function of the unified learning model to construct a multi-layer neural network structure that meets the conditions, and optimizes the multi-layer neural network structure using an optimizer.
2. A unified learning method supporting balanced propagation and predictive coding according to claim 1, characterized in that: The step S1 specifically includes: Parsing the calculation graph of the balanced propagation algorithm to extract the network state and weight of the balanced propagation algorithm as the first network state and the first weight respectively; parsing the calculation graph of the predictive coding algorithm to extract the network state and weight of the predictive coding algorithm as the second network state and the second weight respectively; The first network state and the second network state are respectively used as nodes, and the association relationship between the nodes is used as an edge to construct the network structure of the unified learning model; according to the first weight and the second weight, the weight between the nodes is determined as the value of each edge to characterize the connection type of the unified learning model; A first interface is created so that the user terminal obtains the network structure and connection type of the unified learning model via the first interface.
3. A unified learning method supporting balanced propagation and predictive coding according to claim 2, characterized in that: The step S2 specifically includes: Extracting energy functions of the balanced propagation algorithm and the predictive coding algorithm, encapsulating the energy functions, and creating a second interface so that the user end obtains the energy function via the second interface; Analyze several interaction terms of the energy function, define a convolution operator between two state quantities on the interaction terms, and obtain the configured energy function; wherein the energy function before configuration is: Among them, s i represents the state of node i, ρ() represents the activation function, and w ij represents the weight between node i and node j, b ij represents the deviation of the weight between node i and node j; the convolution operation of the convolution operator is: AND conv =∫∫ρ(s j (x))k ij (xy)ρ(s i (y))d n xd n and ∫ρ(s j (x))[∫k ij (x-y)ρ(s i (y))d n y]d n =∫ρ(s i (x))(k ij *ρ(s i ))(x)d n x Among them, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, x and y represent the integral variables, representing the integration in the direction of x or y axis, and the configured energy function is:
4. A unified learning method supporting balanced propagation and predictive coding according to claim 3, characterized in that: The step S3 specifically includes: The user terminal extracts the network structure and connection type of the unified learning model via the first interface, and extracts the energy function of the unified learning model via the second interface to construct the multi-layer neural network structure; For each layer of the multi-layer neural network structure, the same learning rate is set and training is performed, the real-time status of the network structure, the connection type and the configured energy function are analyzed during the training process, the real-time weight and gradient distribution are calculated, and the gradient range for learning of each layer of the neural network is determined; According to the gradient range, a global learning rate and a global gradient are determined, and based on the global learning rate and the global gradient, an optimal learning rate is assigned to each layer of the neural network, and an independent optimizer is set in each layer of the neural network, and the parameters of the optimizer are continuously optimized during the learning process until a cutoff condition is reached.
5. A unified learning system supporting balanced propagation and predictive coding, characterized in that: The system comprises: A first processing unit is configured to: determine a network structure and a connection type of a unified learning model that supports both the balanced propagation algorithm and the predictive coding algorithm based on the calculation graphs of the balanced propagation algorithm and the predictive coding algorithm; A second processing unit is configured to: extract energy functions of the balanced propagation algorithm and the predictive coding algorithm, configure interaction terms of the energy functions, and use the configured energy functions as the energy function of the unified learning model to support multi-convolutional network calculation; The third processing unit is configured to extract the network structure, connection type and energy function of the unified learning model to construct a qualified multi-layer neural network structure, and optimize the multi-layer neural network structure using an optimizer.
6. A unified learning system supporting balanced propagation and predictive coding according to claim 5, characterized in that: The first processing unit is specifically configured as follows: Parsing the calculation graph of the balanced propagation algorithm to extract the network state and weight of the balanced propagation algorithm as the first network state and the first weight respectively; parsing the calculation graph of the predictive coding algorithm to extract the network state and weight of the predictive coding algorithm as the second network state and the second weight respectively; The first network state and the second network state are respectively used as nodes, and the association relationship between the nodes is used as an edge to construct the network structure of the unified learning model; according to the first weight and the second weight, the weight between the nodes is determined as the value of each edge to characterize the connection type of the unified learning model; A first interface is created so that the user terminal obtains the network structure and connection type of the unified learning model via the first interface.
7. A unified learning system supporting balanced propagation and predictive coding according to claim 6, characterized in that: The second processing unit is specifically configured as follows: Extracting energy functions of the balanced propagation algorithm and the predictive coding algorithm, encapsulating the energy functions, and creating a second interface so that the user end obtains the energy function via the second interface; Analyze several interaction terms of the energy function, define a convolution operator between two state quantities on the interaction terms, and obtain the configured energy function; wherein the energy function before configuration is: Among them, s i represents the state of node i, ρ() represents the activation function, and w ij represents the weight between node i and node j, b ij represents the deviation of the weight between node i and node j; the convolution operation of the convolution operator is: AND conv =∫∫ρ(s j (x))k ij (xy)ρ(s i (y))d n xd n and =∫ρ(s j (x))[∫k ij (x-y)ρ(s i (y))d n y]d n =∫ρ(s i (x))(k ij *ρ(s i ))(x)d n x Among them, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, x and y represent the integral variables, representing the integration in the direction of x or y axis, and the configured energy function is:
8. A unified learning system supporting balanced propagation and predictive coding according to claim 7, characterized in that: The third processing unit is specifically configured as follows: Extracting the network structure and connection type of the unified learning model via the first interface, and extracting the energy function of the unified learning model via the second interface to construct the multi-layer neural network structure; For each layer of the multi-layer neural network structure, the same learning rate is set and training is performed, the real-time status of the network structure, the connection type and the configured energy function are analyzed during the training process, the real-time weight and gradient distribution are calculated, and the gradient range for learning of each layer of the neural network is determined; According to the gradient range, a global learning rate and a global gradient are determined, and based on the global learning rate and the global gradient, an optimal learning rate is assigned to each layer of the neural network, and an independent optimizer is set in each layer of the neural network, and the parameters of the optimizer are continuously optimized during the learning process until a cutoff condition is reached.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements a unified learning method supporting balanced propagation and predictive coding as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the unified learning method supporting balanced propagation and predictive coding as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Systems and methods of propagating data packets in a network of nodes
CN112189328A
Optimization learning method for neural network
JP2001256212A
Efficient message representations for belief propagation algorithms
US20090164192A1
Light weight and real time slam for robots
US20220026920A1
Systems and methods for training energy-efficient spiking growth transform neural networks
US20230021621A1
