A unified learning method and system supporting balanced propagation and predictive coding
By defining convolution operators in the energy model and adaptively adjusting the learning rate, the problems of energy functions not being able to use convolution calculations and the difficulty in choosing the learning rate are solved, thus achieving efficient training and fast convergence of multi-convolutional networks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2026-03-17
AI Technical Summary
Existing energy-based algorithms lack a unified theory, cannot use convolution calculations in the energy function, and are difficult to design in terms of learning rate and network structure, resulting in training difficulties and slow convergence speed.
By abstracting the commonalities based on energy models, defining convolution operators and adjusting the learning rate, a unified learning framework is constructed to support multi-convolutional network computation and adaptively adjust the learning rate to optimize the network structure.
It expands convolutional computation and makes network training more convenient, improving network convergence speed and learning efficiency, and is applicable to various network structures.
Smart Images

Figure CN118690819B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of neural network computing and optimization technology, and in particular relates to a unified learning method and system that supports balanced propagation and predictive coding. Background Technology
[0002] The biological mechanisms of the human brain have long been an open question. The methods of neural signal transmission, the fundamental principles underlying them, and how credit allocation is achieved remain unresolved issues in neuroscience. Based on some established biological principles, experts from computer science, physicists, mathematicians, and other fields have begun modeling these principles and have proposed many "biologically plausible" algorithms. These algorithms often target backpropagation (BP), aiming to approximate the computational performance of BP by refining theoretical and technical capabilities. These algorithms also require gradient calculations, and their gradient calculations approximate the gradients of BP calculations to a certain extent. They are also more compatible with neural circuits, operating more tightly to satisfy the constraints imposed by the neural circuits. Many such algorithms combine physical dynamics and thermodynamics, utilizing the inherent principle of thermodynamic energy steady state to consistently adhere to energy field constraints during the learning process. Furthermore, these algorithms utilize the framework of Energy-Based Models (EBM), whose core is the energy function. By defining an appropriate 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 current scientific research, energy-based algorithms are attracting increasing attention, but these algorithms exist in isolation, lacking a unified theory to connect them. Backpropagation (BP) has become a foundational algorithm for the recent significant successes of deep learning. However, from a neuroscience perspective, BP is often criticized as biologically implausible. Given that the credit assignment problem faced by the brain is at least as challenging as that of deep neural networks, a fundamental question arises: does the brain use backpropagation to perform credit assignment? The answer to this question fundamentally depends on whether there exists a biologically feasible algorithm that approximates BP and can be implemented in neural circuits. Numerous potential algorithms have been proposed in the existing technology; however, little is known about the connections and relationships between them. To date, the field has primarily manifested as a diverse set of algorithms and ideas, without any unified or fundamental principles.
[0004] For different network structures and tasks of varying difficulty, a network's learning ability depends heavily on the design of its energy function. The rationality of the energy function design significantly impacts the overall model performance. Therefore, in general scientific research, the construction of the network topology directly determines the learning difficulty, while the design of the energy function influences the network's convergence rate. Both academia and industry urgently need a unified framework for practical scientific research and development tasks, which can not only assist in the progress of research but also help improve development efficiency in engineering fields.
[0005] In current research, "biological rationality" is being mentioned with increasing frequency. The scientific and industrial communities are showing growing interest in bio-interpretable 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 application of "biologically rational" algorithms in industry is still immature to a certain extent; application scenarios need further exploration, and the scientific community also needs to further refine related work, improving algorithm performance and various indicators to enable algorithms to perform more complex tasks in complex scenarios. Several issues exist regarding the development of algorithms in the scientific community:
[0006] For energy-based algorithms, most exist in isolation. While similar algorithms share many connections, they also exhibit certain differences. These differences, to varying degrees, affect the ability of different algorithms to learn and train using a unified method. Existing energy-based algorithms lack interrelationships. In research tasks, it is often necessary to conduct comparative experiments using different methods to identify their respective advantages. This not only benefits research progress but also improves work efficiency. However, currently, there is a lack of in-depth research focusing on this aspect.
[0007] For example, the energy function used in balanced propagation uses weights and biases from a neural network. Directly using weights and biases for calculation in the energy function is the common practice for most energy functions. When defining connections in the energy function, if weights and biases are needed in the connections, the state and weights need to be calculated. Therefore, only the weights of fully connected neural networks can be used for calculation. Convolutional weights cannot be used in commonly used energy functions. Therefore, convolutional neural networks cannot be used in the calculation of the defined energy function.
[0008] Most current energy-based algorithms suffer from learning and training difficulties. The root cause lies in inappropriate energy function settings, inappropriate learning rate settings, and inappropriate network structures. However, with a suitable learning rate, learning and training are possible to a certain extent for different energy functions and network structures. For energy function calculation, the energy of each layer needs to reach its minimum point; therefore, the learning rate setting for each layer is crucial. To avoid gradient vanishing and diminishing returns, the learning rate needs to be adjusted based on changes in historical gradients, but currently, there is no work on this. Summary of the Invention
[0009] The main technical problems to be solved by this invention are as follows: 1. Abstracting the commonalities of energy-based algorithms and connecting them with a unified theory; 2. For example, the energy function used in the classical balanced propagation algorithm cannot use convolution in the definition of the energy function; 3. There is no optimizer specifically designed to adjust and modify its learning rate for the energy model used.
[0010] To address the aforementioned technical problems, this invention proposes a unified learning scheme that supports balanced propagation and predictive coding.
[0011] The first aspect of this invention discloses a unified learning method supporting balanced propagation and predictive coding. The method includes: Step S1, determining the network structure and connection type of a unified learning model that simultaneously supports the balanced propagation algorithm and the predictive coding algorithm based on the computation graph of 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 functions as the energy function of the unified learning model to support multi-convolutional network computation; Step S3, extracting the network structure, connection type, and energy function of the unified learning model at the user end to construct a multi-layer neural network structure that meets the conditions, and optimizing the multi-layer neural network structure using an optimizer.
[0012] According to the method of the first aspect of the present invention, step S1 specifically includes: parsing the computation graph of the balanced propagation algorithm to extract the network state and weights of the balanced propagation algorithm, which are respectively used as a first network state and a first weight; parsing the computation graph of the predictive coding algorithm to extract the network state and weights of the predictive coding algorithm, which are respectively used as a second network state and a second weight; constructing the network structure of the unified learning model by taking each state of the first network state and the second network state as nodes and the relationships between each node as edges; determining the weights between each node according to the first weight and the second weight, which are used as the values of each edge to characterize the connection type of the unified learning model; and creating a first interface so that the user terminal can obtain the network structure and connection type of the unified learning model through the first interface.
[0013] According to the method of the first aspect of the present invention, 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 functions via the second interface; parsing several interaction terms of the energy functions; defining a convolution operator between two state variables on the interaction terms; and obtaining the configured energy function; wherein the energy function before configuration is:
[0014]
[0015] Among them, s i Let ρ represent the state of node i, ρ() represent the activation function, and w ij b represents the weight between node i and node j. ij This represents the deviation of the weights between node i and node j; the convolution operation of the convolution operator is as follows:
[0016]
[0017] Where, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, and x and y represent the integration variables, indicating integration along the x or y axis. The configured energy function is:
[0018]
[0019] According to the method of the first aspect of the present invention, 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 state of the network structure, the connection type and the configured energy function during the training process is analyzed, the real-time weights and gradient distribution are calculated, and the gradient range for each layer of the neural network to learn is determined; based on the gradient range, the global learning rate and the global gradient are determined, the optimal learning rate is allocated to each layer of the neural network according to the global learning rate and the global gradient, and an independent optimizer is set for 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] A second aspect of this invention discloses a unified learning system supporting 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 simultaneously supports the balanced propagation algorithm and the predictive coding algorithm based on a computational graph 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 functions as the energy function of the unified learning model to support multi-convolutional network computation; and a third processing unit configured to: extract 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 optimize the multi-layer neural network structure using an optimizer.
[0021] According to a system based on a second aspect of the present invention, the first processing unit is specifically configured to: parse the computation graph of the balanced propagation algorithm to extract the network state and weights of the balanced propagation algorithm, respectively as a first network state and a first weight; parse the computation graph of the predictive coding algorithm to extract the network state and weights of the predictive coding algorithm, respectively as a second network state and a second weight; construct the network structure of the unified learning model by treating each state of the first network state and the second network state as nodes and the relationships between the nodes as edges; determine the weights between the nodes according to the first weights and the second weights, as the values of each edge, to characterize the connection type of the unified learning model; and create a first interface so that the user terminal obtains the network structure and connection type of the unified learning model through the first interface.
[0022] According to a system based on a 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 functions via the second interface; parse several interaction terms of the energy functions; define a convolution operator between two state variables on the interaction terms; and obtain the configured energy function; wherein the energy function before configuration is:
[0023]
[0024] Among them, s i Let ρ represent the state of node i, ρ() represent the activation function, and w ij b represents the weight between node i and node j. ij This represents the deviation of the weights between node i and node j; the convolution operation of the convolution operator is as follows:
[0025]
[0026] Where, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, and x and y represent the integration variables, indicating integration along the x or y axis. 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 train it, analyze the real-time state of the network structure, the connection type and the configured energy function during the training process, calculate the real-time weights and gradient distribution, and determine the gradient range for each layer of the neural network to learn; determine the global learning rate and global gradient according to the gradient range, allocate the optimal learning rate to each layer of the neural network according to the global learning rate and the global gradient, and set an independent optimizer for each layer of the neural network, continuously optimizing the parameters of the optimizer during the learning process until the cutoff condition is reached.
[0029] A third aspect of this 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, it implements the steps of the unified learning method supporting balanced propagation and predictive coding described in the first aspect of this disclosure.
[0030] A fourth aspect of this invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, 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 this disclosure.
[0031] In summary, the technical solution proposed in this invention abstracts the commonalities of two local learning algorithms (equilibrium propagation and predictive coding), integrates them, and, through this framework, enables these two algorithms to produce results approximating BP. Different energy-based algorithms can flexibly utilize this characteristic, allowing users to achieve research results or define new computational patterns according to their own needs. This invention also provides a theoretical method that unifies two different algorithms to approximate BP (predictive coding (PC) and equilibrium propagation (EP)) with weak feedback. All of the above algorithms are based on the general mathematical properties of the energy-based model framework, therefore, they can be generalized to new energy functions, and new algorithms not yet described can be derived. Attached Figure Description
[0032] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0033] Figure 1 A flowchart illustrating a unified learning method supporting balanced propagation and predictive coding according to an embodiment of the present invention;
[0034] Figure 2 Here is the pseudocode for the optimizer's operation according to an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the topology according to an embodiment of the present invention;
[0036] Figure 4 This is a schematic diagram illustrating the feasibility verification results according to an embodiment of the present invention;
[0037] Figure 5 This is a structural diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] This invention aims to connect various isolated algorithms based on energy models using a unified theory, and to solve the problems of classical balanced propagation algorithms being unable to use convolution in the form of the Hopfield energy function, and the difficulty in selecting appropriate learning rates for different layers in deep networks. The main technical concepts of this invention include: abstracting the commonalities of energy model-based methods and connecting these models with a unified theory; defining convolution operators in the form of the Hopfield energy function, extending linear computation to convolutional computation; and defining a method for adaptively adjusting the learning rate based on gradients, making training under different network structures more convenient. Based on classical energy model-based algorithms, this invention abstracts the commonalities between different algorithms, fully explores the gradient and weight distribution between network layers, and combines learning rate adjustment rules to effectively improve the convergence speed of the network. It also applies convolution to the calculation of the Hopfield energy function, resulting in a unified learning framework that is highly convenient and practical, while strongly supporting the development of various energy model-based algorithms.
[0040] The first aspect of this invention discloses a unified learning method that supports balanced propagation and predictive coding. Figure 1 This is a flowchart illustrating a unified learning method supporting balanced propagation and predictive coding according to an embodiment of the present invention; as follows: Figure 1 As shown, the method includes: Step S1, determining the network structure and connection type of a unified learning model that simultaneously supports the balanced propagation algorithm and the predictive coding algorithm based on the computation graph of 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 functions as the energy functions of the unified learning model to support multi-convolutional network computation; Step S3, the user end 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.
[0041] In some embodiments, step S1 specifically includes: parsing the computation graph of the balanced propagation algorithm to extract the network state and weights of the balanced propagation algorithm, which are respectively used as the first network state and the first weight; parsing the computation graph of the predictive coding algorithm to extract the network state and weights of the predictive coding algorithm, which are respectively used as the second network state and the second weight; using each state of the first network state and the second network state as nodes, and the relationships between the nodes as edges, to construct the network structure of the unified learning model; determining the weights between the nodes according to the first weight and the second weight, which are used as the values of the edges to characterize the connection type of the unified learning model; and creating a first interface so that the user terminal can obtain the network structure and connection type of the unified learning model through the first interface.
[0042] In some embodiments, 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 functions via the second interface; parsing several interaction terms of the energy functions; defining a convolution operator between two state variables on the interaction terms; and obtaining the configured energy function; wherein, the energy function before configuration is:
[0043]
[0044] Among them, s i Let ρ represent the state of node i, ρ() represent the activation function, and w ij b represents the weight between node i and node j. ij This represents the deviation of the weights between node i and node j; the convolution operation of the convolution operator is as follows:
[0045]
[0046] Where, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, and x and y represent the integration variables, indicating integration along the x or y axis. The configured energy function is:
[0047]
[0048] In some embodiments, 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 state of the network structure, the connection type and the configured energy function during the training process is analyzed, the real-time weights and gradient distribution are calculated, and the gradient range for each layer of the neural network to learn is determined; based on the gradient range, the global learning rate and the global gradient are determined, the optimal learning rate is allocated to each layer of the neural network according to the global learning rate and the global gradient, and an independent optimizer is set for 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, commonalities in energy-based model algorithms are extracted to provide users with an interface for creating connections and defining energy functions. Convolution operators are defined within the computational form of the energy function, extending linear operations to convolutional computation to support more convolutional network computations. Based on the energy and weight distribution in network connections, patterns conforming to gradient and weight changes are sought, and an optimizer is designed according to these patterns.
[0050] Specifically, the computation graph of balance propagation is parsed, and the network state and weights are abstracted from the computation graph; the computation graph of predictive coding is parsed, and the network state and weights are abstracted from the computation graph; the network state is abstracted into node classes, the weight connections are abstracted into edge classes, 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 provided.
[0051] Specifically, the interaction terms of different energy functions are analyzed, and convolution operators are defined in the interaction term form. For example, the Hopfield energy function has the form 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 convolution is shown below:
[0052]
[0053] Therefore, the energy function will take the form of:
[0054] Specifically, a multi-layer neural network structure is built, and the same learning rate is set for all layers and trained. The weight and gradient distribution generated by the network during training 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 the optimal learning rate is assigned to each layer based on this standard. After the learning rate of each layer is assigned, an independent optimizer is set for each layer, and the parameters are continuously optimized during the learning process.
[0055] Specifically, based on the sequence g composed of the eigenvalues of all layers, a suitable learning rate needs to be found according to the gradient. The global learning rate is defined as l, the method for transforming the gradient is defined as f1, the method for obtaining the global standard gradient is defined as f2, the optimizer used is defined as f3, the gradient after incorporating historical information is defined as v, and the scaling factor is defined as β. The gradient information of each layer is transformed using f1 to obtain measure. The scaling factor β controls the proportion of historical information incorporated. After obtaining the global standard gradient, the formula is used... The appropriate learning rate for each layer of the network is calculated, and the pseudocode for the optimizer's operation is as follows: Figure 2 As shown.
[0056] In other embodiments, the CIFAR-10 dataset is loaded, processed, and used to complete an image classification task experiment. A custom energy function is used, as follows:
[0057]
[0058] A scaling factor α(i) is assigned to the energy calculated at each layer, allowing each layer to converge to its lowest energy level, thereby further reducing the total energy. A custom network topology is created, including a network adjacency matrix, as shown in the topology diagram. Figure 3 As shown. Experiments conducted with this setup yielded the following results. Figure 4 As shown.
[0059] Current research methods encounter numerous problems in practical applications. First, while existing energy model-based methods share a commonality—they are all energy model-based algorithms—they exist in isolation, lacking a unified theoretical framework connecting them. Second, current energy functions, such as the Hopfield energy function, cannot be extended to convolutional computations during intermediate steps, thus hindering the expansion of energy calculations to convolution. Finally, for training neural networks using balanced propagation or predictive coding, the network architecture design significantly impacts performance; the network becomes highly sensitive to parameter variations, and finding a suitable learning rate is challenging for different network architectures, as the learning rate setting directly affects the convergence speed of the network model. These issues need to be addressed.
[0060] The technical solution of this invention unifies energy model-based methods (such as balanced propagation and predictive coding) into a single framework. Users can customize energy functions and flexibly modify modifiable terms and functions in the computation process, allowing the unified framework to complete various types of complex tasks according to their needs. The technical solution of this invention defines convolution operators for the interaction terms of network state computation within the interaction terms of the energy functions (such as Hopfield) used in energy model-based methods, extending convolution computation from linear computation to full convolution computation, making the framework more flexible and broadening the coverage of energy functions. The hierarchical adaptive self-adjusting optimization rate optimizer of this invention assigns the search for the most suitable learning rate for each layer of the network to the optimizer, enabling the optimizer to monitor the gradient of each layer and adjust the learning rate according to changes in the gradient.
[0061] A second aspect of this invention discloses a unified learning system supporting 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 simultaneously supports the balanced propagation algorithm and the predictive coding algorithm based on a computational graph 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 functions as the energy function of the unified learning model to support multi-convolutional network computation; and a third processing unit configured to: extract 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 optimize the multi-layer neural network structure using an optimizer.
[0062] According to a system based on a second aspect of the present invention, the first processing unit is specifically configured to: parse the computation graph of the balanced propagation algorithm to extract the network state and weights of the balanced propagation algorithm, respectively as a first network state and a first weight; parse the computation graph of the predictive coding algorithm to extract the network state and weights of the predictive coding algorithm, respectively as a second network state and a second weight; construct the network structure of the unified learning model by treating each state of the first network state and the second network state as nodes and the relationships between the nodes as edges; determine the weights between the nodes according to the first weights and the second weights, as the values of each edge, to characterize the connection type of the unified learning model; and create a first interface so that the user terminal obtains the network structure and connection type of the unified learning model through the first interface.
[0063] According to a system based on a 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 functions via the second interface; parse several interaction terms of the energy functions; define a convolution operator between two state variables on the interaction terms; and obtain the configured energy function; wherein the energy function before configuration is:
[0064]
[0065] Among them, s i Let ρ represent the state of node i, ρ() represent the activation function, and w ij b represents the weight between node i and node j. ij This represents the deviation of the weights between node i and node j; the convolution operation of the convolution operator is as follows:
[0066]
[0067] Where, k ij () represents the convolution kernel function between node i and node j, n represents the dimension of the matrix, and x and y represent the integration variables, indicating integration along the x or y axis. 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 train it, analyze the real-time state of the network structure, the connection type and the configured energy function during the training process, calculate the real-time weights and gradient distribution, and determine the gradient range for each layer of the neural network to learn; determine the global learning rate and global gradient according to the gradient range, allocate the optimal learning rate to each layer of the neural network according to the global learning rate and the global gradient, and set an independent optimizer for each layer of the neural network, continuously optimizing the parameters of the optimizer during the learning process until the cutoff condition is reached.
[0070] A third aspect of this 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, it implements the steps of the unified learning method supporting balanced propagation and predictive coding described in the first aspect of this disclosure.
[0071] Figure 5 This 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, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, Near Field Communication (NFC), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0072] Those skilled in the art will understand that Figure 5 The structure shown is merely a structural diagram of the part related to the technical solution of this disclosure and does not constitute a limitation on the electronic device to which the solution of this application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0073] A fourth aspect of this invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, 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 this disclosure.
[0074] As can be seen, the technical solution proposed in this invention abstracts the commonalities in the methods of energy-based balance propagation and predictive coding, and unifies them using a unified theory. This invention defines a convolution operator in the form of the Hopfield energy function, extending linear computation to convolution computation. This invention defines a rule for adaptively adjusting the learning rate based on the gradient; based on this rule, an optimizer that adaptively adjusts the learning rate is designed and implemented, making training under different network structures more convenient.
[0075] Please note that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A unified learning method supporting balanced propagation and predictive coding, characterized by, The method comprises: Step S1, determining the network structure and connection type of a unified learning model supporting the balance propagation algorithm and the predictive coding algorithm based on the computational graph of the balance propagation algorithm and the predictive coding algorithm; Step S2, extracting the energy function of the balance propagation algorithm and the predictive coding algorithm, configuring the interaction term of the energy function, and taking the configured energy function as the energy function of the unified learning model to support multi-convolution network calculation; Step S3, a user terminal 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 by using an optimizer; The step S1 specifically comprises: Analyzing the computational graph of the balance propagation algorithm to extract the network state and weight of the balance propagation algorithm as a first network state and a first weight respectively, and analyzing the computational graph of the predictive coding algorithm to extract the network state and weight of the predictive coding algorithm as a second network state and a second weight respectively; Taking each state of the first network state and the second network state as a node and the association relationship between each node as an edge to construct the network structure of the unified learning model, and determining the weight between each node as the value of each edge according to the first weight and the second weight to represent 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.
2. The unified learning method supporting balance propagation and predictive coding according to claim 1, wherein, The step S2 specifically comprises: Extracting the energy function of the balance propagation algorithm and the predictive coding algorithm, encapsulating the energy function, and creating a second interface so that the user terminal obtains the energy function via the second interface; Analyzing a plurality of interaction terms of the energy function, defining a convolution operator between two state quantities on the interaction terms to obtain the configured energy function; wherein the energy function before configuration is: wherein s i represents the state of node i, p() represents an activation function, w ij represents the weight between node i and node j, b ij represents the bias of the weight between node i and node j; the convolution operation of the convolution operator is: E conv = ∫∫ ρ(s j (x))k ij (x-y) ρ(s i (y)) d n x d n y = ∫ ρ(s j (x))[∫ k ij (x-y)ρ(s i (y))d n y]d n = ∫ p(s i (x))(k ij *ρ(s i ))(x)d n x where k ij represents a convolution kernel function between node i and node j, n represents a dimension number of a matrix, x and y represent integral variables, represents that integration is performed in a direction with x or y as an axis, and the configured energy function is:
3. The unified learning method supporting balance propagation and predictive coding according to claim 2, wherein, The step S3 specifically comprises: 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 state of the network structure, the connection type and the configured energy function in the training process is analyzed, the real-time weight and gradient distribution is calculated, and the gradient range of each layer of neural network for learning is determined; According to the gradient range, the global learning rate and the global gradient are determined, the optimal learning rate is allocated to each layer of neural network according to the global learning rate and the global gradient, and an independent optimizer is set for each layer of neural network, and the parameters of the optimizer are continuously optimized in the learning process until the stop condition is reached.
4. A unified learning system supporting balanced propagation and predictive coding, characterized by, The system comprises: The first processing unit is configured to determine a network structure and a connection type of a unified learning model supporting the balance propagation algorithm and the predictive coding algorithm based on a computational graph of the balance propagation algorithm and the predictive coding algorithm; The second processing unit is configured to extract an energy function of the balance propagation algorithm and the predictive coding algorithm, configure interaction terms of the energy function, and use the configured energy function as an energy function of the unified learning model to support multi-convolution network calculation; The third processing unit is configured to extract the network structure, the connection type, and the energy function of the unified learning model, construct a qualified multi-layer neural network structure, and optimize the multi-layer neural network structure by using an optimizer. The first processing unit is specifically configured to: analyze the computational graph of the balance propagation algorithm to extract network states and weights of the balance propagation algorithm as first network states and first weights, respectively, and analyze the computational graph of the predictive coding algorithm to extract network states and weights of the predictive coding algorithm as second network states and second weights, respectively; construct the network structure of the unified learning model by taking each state of the first network states and the second network states as a node and an association relationship between each node as an edge, and determine weights between the nodes as values of the edges according to the first weights and the second weights to represent the connection type of the unified learning model; create a first interface to enable a user end to obtain the network structure and the connection type of the unified learning model via the first interface.
5. The unified learning system supporting balance propagation and predictive coding according to claim 4, wherein, The second processing unit is specifically configured to: extract the energy function of the balance propagation algorithm and the predictive coding algorithm, encapsulate the energy function, and create a second interface to enable the user end to obtain the energy function via the second interface; analyze a plurality of interaction terms of the energy function, define a convolution operator between two state quantities on the interaction terms to obtain the configured energy function, and wherein the energy function before configuration is: wherein s i represents the state of node i, p() represents an activation function, w ij represents the weight between node i and node j, b ij represents the bias of the weight between node i and node j; the convolution operation of the convolution operator is: E conv = ∫∫ ρ(s j (x))k ij (x-y) ρ(s i (y)) d n x d n y = ∫ ρ(s j (x))[∫ k ij (x-y)ρ(s i (y))d n y]d n = ∫ p(s i (x))(k ij *ρ(s i ))(x)d n x where k ij represents a convolution kernel function between node i and node j, n represents a dimension number of a matrix, x and y represent integral variables, represents that integration is performed in a direction with x or y as an axis, and the configured energy function is:
6. The unified learning system supporting balance propagation and predictive coding according to claim 5, wherein, The third processing unit is specifically configured to: extract the network structure and the 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; set the same learning rate for each layer of the multi-layer neural network structure and perform training, analyze real-time states of the network structure, the connection type, and the configured energy function in the training process, calculate real-time weights and gradient distributions, and determine a gradient range for learning of each layer of neural network; determine a global learning rate and a global gradient according to the gradient range, allocate an optimal learning rate to each layer of neural network according to the global learning rate and the global gradient, set an independent optimizer for each layer of neural network, and continuously optimize parameters of the optimizer in the learning process until a stop condition is reached.
7. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the unified learning method for supporting balanced propagation and prediction coding according to any one of claims 1-3.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the unified learning method for supporting balanced propagation and prediction coding according to any one of claims 1-3.
Citation Information
Patent Citations
Systems and methods of propagating data packets in a network of nodes
CN112189328A
Light weight and real time slam for robots
US20220026920A1