Model training method, system and chip

By employing an on-chip-to-off-chip interactive approach that utilizes collaborative training between the chip and an external processor, the issues of accuracy and resource consumption in neuromorphic computing chip model training are resolved, resulting in highly efficient model training.

CN119026658APending Publication Date: 2024-11-26CENT FOR EXCELLENCE IN BRAIN SCI & INTELLIGENCE TECH CHINESE ACAD OF SCI

Patent Information

Application Number
CN202411098485.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing neuromorphic computing chips suffer from low computational efficiency and accuracy, high resource consumption, and high cost in model training. In particular, the randomness of non-volatile devices and the need for customized chip architectures increase the overall complexity.

Method used

Through an on-chip-off-chip interactive training method that coordinates the chip and an external processor, the chip processes data, the external processor adjusts parameters, and the process is repeated until the loop termination condition is met, thereby training the neural network model.

Benefits of technology

It improves the accuracy of model training, reduces the performance requirements of the chip, avoids resource waste, and simplifies the difficulty of model training on the chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026658A_ABST
    Figure CN119026658A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, system and chip, and the method comprises the steps: obtaining model training data based on the chip, the model training data being initial model training data or intermediate processing data in a certain iteration training; processing the model training data based on a first neural network model in the chip to obtain model processing data; reading the model processing data based on the external processor, and adjusting model parameters of a first neural network model in the external processor according to the model processing data to obtain a second neural network model; adjusting the model parameters of the first neural network model according to the model parameters of the second neural network model based on the chip; and cyclically executing the operation until a cycle ending condition is reached, and obtaining the trained first neural network model. The performance requirement of the chip is reduced, the difficulty of model training in the chip is simplified, the loss of the chip is avoided, and the accuracy of model training is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a model training method, system and chip. Background Art

[0002] In the field of neuromorphic computing, non-volatile technology has attracted much attention due to its potential to simulate the functions of biological synapses, which have synaptic efficacy and synaptic plasticity. Although neuromorphic computing has broad prospects for in-situ computing and synaptic learning, the approximation of its calculations may introduce errors due to changes caused by device, cycle and process-related effects, thereby reducing the overall computing efficiency and accuracy. The non-ideality of selectors such as transistors or diodes, the requirements for analog-to-digital conversion devices, and the limited bit accuracy requirements further increase the overall complexity of designing reliable computing using non-traditional synaptic devices. In addition, the process of writing to non-volatile devices usually consumes a lot of resources. The inherent randomness of such devices can also lead to unreliable write operations, requiring expensive verification schemes. The high demand for customized chip architectures also brings huge costs. Therefore, how to simplify neural network learning on chips is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present invention provides a model training method, system and chip to solve the technical problem of high difficulty and low accuracy of model training in the chip, optimize the training method of the model in the chip, and improve the accuracy of model training.

[0004] According to one aspect of the present invention, a model training method is provided, comprising:

[0005] Acquiring model training data based on the chip, wherein the model training data is initial model training data or intermediate processing data in a certain iterative training;

[0006] Processing the model training data based on the first neural network model in the chip to obtain model processing data;

[0007] The model processing data is read based on an external processor, and model parameters of the first neural network model in the external processor are adjusted according to the model processing data to obtain a second neural network model;

[0008] adjusting the model parameters of the first neural network model according to the model parameters of the second neural network model based on the chip;

[0009] The above operations are executed in a loop until the loop end condition is reached, and the first neural network model after training is obtained.

[0010] Optionally, based on the above solution, the first neural network model includes multiple neural layers, and the first neural network model in the chip is used to process the model training data to obtain model processing data, including:

[0011] The model training data is processed based on the first neural network model to obtain processing data of each neural layer as the model processing data.

[0012] Optionally, based on the above solution, the external processor reads the model processing data, and adjusts the model parameters of the first neural network model in the external processor according to the model processing data to obtain the second neural network model, including:

[0013] Based on the external processor, the processing data of each neural layer in the first neural network model is read layer by layer through the readout pin of the chip, and the first neural network model is trained based on each processing data to obtain adjusted model parameters.

[0014] Optionally, based on the above solution, the training of the first neural network model based on each of the processed data includes:

[0015] The first neural network model is trained based on each of the processed data by at least one of spatiotemporal back propagation (STBP), feedback, and pulse timing dependent plasticity (STDP).

[0016] Optionally, based on the above scheme, the loop end condition includes that the target loss value of the second neural network model meets a set threshold or the number of loops reaches a set number of loops.

[0017] Optionally, based on the above solution, it also includes:

[0018] Based on the chip's response to the detected model deployment instruction, the model to be deployed is deployed according to the model structure of the model to be deployed, wherein each neural layer of the model to be deployed is respectively deployed on different cortical column cores of the chip.

[0019] Optionally, based on the above scheme, the first neural network model is used for behavior decoding of the brain-computer interface system, and / or, visual camera target recognition.

[0020] Optionally, based on the above scheme, the first neural network model is a pulse neural network model.

[0021] According to another aspect of the present invention, a model training chip is provided, comprising a model training module, for:

[0022] Get model training data;

[0023] Processing the model training data based on the first neural network model to obtain model processing data;

[0024] Acquire a second neural network model processed by an external processor, and adjust model parameters of the first neural network model based on the second neural network model;

[0025] The above operations are executed in a loop until the loop end condition is reached, and the first neural network model after training is obtained.

[0026] According to another aspect of the present invention, a model training system is provided, characterized in that it includes a chip and an external processor, wherein:

[0027] Acquiring model training data based on the chip, wherein the model training data is initial model training data or intermediate processing data in a certain iterative training;

[0028] The chip is used to process the model training data according to the first neural network model to obtain model processing data;

[0029] The external processor is used to read the model processing data and adjust the model parameters of the first neural network model in the external processor according to the model processing data to obtain a second neural network model;

[0030] The chip is also used to adjust the model parameters of the first neural network model according to the model parameters of the second neural network model.

[0031] The technical solution of the embodiment of the present invention is to obtain model training data based on the chip, wherein the model training data is the initial model training data or the intermediate processing data in a certain iterative training; the model training data is processed based on the first neural network model in the chip to obtain model processing data; the model processing data is read based on the external processor, and the model parameters of the first neural network model in the external processor are adjusted according to the model processing data to obtain the second neural network model; the model parameters of the first neural network model are adjusted according to the model parameters of the second neural network model based on the chip; the above operations are performed in a loop until the loop end condition is reached to obtain the trained first neural network model. When the neural network model in the chip is trained, the on-chip-off-chip interactive model training is realized by the cooperation between the chip and the external processor, the accuracy of data processing is achieved by processing the model training data in the chip, and the model parameters are called back based on the model training data by the external processor, which reduces the performance requirements of the chip, avoids the consumption of a large amount of resources when the chip performs model training alone, simplifies the difficulty of model training in the chip, avoids chip loss, and improves the accuracy of model training.

[0032] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0034] Figure 1 is a flow chart of a model training method provided in Embodiment 1 of the present invention;

[0035] Figure 2a is a flow chart of a model training method provided in Embodiment 2 of the present invention;

[0036] Figure 2b This is an interactive schematic diagram of a model training provided by the second embodiment of the present invention;

[0037] Figure 3 It is a structural schematic diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 creative work should fall within the scope of protection of the present invention.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0040] Embodiment 1

[0041] Figure 1 1 is a flow chart of a model training method provided in the first embodiment of the present invention. This embodiment is applicable to the case of training a model in a chip. The method can be executed by the chip and an external processor. Figure 1 As shown, the method includes:

[0042] S110. Obtain model training data based on the chip, wherein the model training data is initial model training data or intermediate processing data in a certain iterative training.

[0043] It is understandable that the training of the model is an iterative training process. This embodiment takes any round of iterative training as an example to illustrate the on-chip-off-chip interactive chip model training provided by this embodiment. Taking any iteration as an example, the neural network model in the chip and the neural network model in the external processor are the same. When performing model training, the model training data is processed in the chip to obtain the model training data, and then the model training data obtained by the chip processing is read out by the external processor, and the model parameters in the neural network model are adjusted based on the external processor and the model training data, and then the adjusted model parameters are updated to the neural network model in the chip. Overall, the model training method provided in this embodiment is to perform data processing prediction in the chip, and to adjust parameters in the external processor, and to achieve on-chip-off-chip model training in the above manner.

[0044] In the first iteration, the model training data may be sample data in the model training samples, and in subsequent iterations, the model training data may be sample data in the model training samples and / or intermediate processing data of the previous iteration.

[0045] S120. Process the model training data based on the first neural network model in the chip to obtain model processing data.

[0046] In this embodiment, a neural network model is pre-deployed in the chip, and the same neural network model is also deployed in the external processor, and the neural network model in the chip in each iteration is used as the first neural network model. Taking the chip as a brain-like chip as an example, the neural network model can be a pulse neural network model, that is, the same pulse neural network model can be deployed in the chip and the external processor respectively, such as deploying the same convolutional pulse neural network, fully connected pulse neural network, recurrent pulse neural network and hybrid pulse neural network, etc., which is not limited here, and can be specifically deployed and set based on the application requirements of the neural network model.

[0047] In one embodiment of the present invention, the first neural network model is used for behavior decoding of a brain-computer interface system, and / or, target recognition of a visual camera.

[0048] When the chip is a brain-like chip, the first neural network model in the chip can be used for classification / recognition of brain signals. Specifically, the first neural network model can be used for behavior decoding of the brain-computer interface system, target recognition of visual cameras, etc., and can also be used for processing other brain signals, which is not limited here.

[0049] In addition to the above solutions, it also includes:

[0050] Based on the chip's response to the detected model deployment instruction, the model to be deployed is deployed according to the model structure of the model to be deployed, wherein each neural layer of the model to be deployed is respectively deployed on different cortical column cores of the chip.

[0051] Before model training, researchers can define the neural network structure based on application requirements and trigger model deployment instructions. The chip determines the model structure of the model to be deployed based on the model deployment instructions and deploys the model to be deployed on the chip. Similarly, the external processor can also respond to the model deployment instructions triggered by the user and deploy the same neural network structure in the external processor. When deploying the neural network model in the chip, in order to make the calculation method of the neural network model more compatible with the chip, each neural layer of the model to be deployed can be deployed on different cortical column cores of the chip.

[0052] Optionally, a model deployment interface can be displayed, and researchers can deploy the model structure on the model deployment interface. For example, a model deployment interface including multiple model substructures can be displayed. Researchers set the model structure by selecting the model substructure and determining the connection relationship between each model substructure. After the setting is completed, click the model deployment control to trigger the model deployment instruction. Exemplarily, the neural network model can be a fully connected spiking neural network, which can be set to include linked encoding layers, hidden layers, inhibition layers, and pulse output layers, and the neurons in each layer are connected in a fully connected manner.

[0053] In one embodiment of the present invention, the first neural network model includes a plurality of neural layers, and the first neural network model in the chip is used to process the model training data to obtain model processing data, including:

[0054] The model training data is processed based on the first neural network model to obtain processing data of each neural layer as the model processing data.

[0055] Optionally, the method for processing the model training data based on the first neural network model can refer to the existing model data processing methods (such as feedforward, STDP, etc.), that is, the model training data is used as the input of the first neural network model, and the model training data or the intermediate data obtained based on the model training data is processed using each neural layer of the first neural network to obtain the processing data of each layer as the model processing data. Among them, the model processing data can be data such as vectors and feature maps, which are specifically determined based on the model type of the first neural network model. Exemplarily, when the first neural network model is a pulse neural network model, the processing data of each neural layer can be a feature map, and the model processing data is correspondingly also a feature map.

[0056] S130, reading the model processing data based on the external processor, and adjusting the model parameters of the first neural network model in the external processor according to the model processing data to obtain a second neural network model.

[0057] In this embodiment, the computing environment of the chip is simulated by an external processor, and the parameters of the first neural network model are adjusted by the external processor, thereby reducing the computing pressure of the chip when the neural network model is trained on the chip and improving the life of the chip and the accuracy of the model training.

[0058] Among them, the external processor can be any computing unit that can perform neural network model calculations, such as the external processor can be a central processing unit CPU, a graphics processing unit GPU, etc., which is not limited here.

[0059] In the above implementation, the model processing data includes processing data of each neural layer of the first neural network model in the chip. Accordingly, the external processor reads the model processing data and adjusts the model parameters of the first neural network model in the external processor according to the model processing data to obtain the second neural network model, including:

[0060] Based on the external processor, the processing data of each neural layer in the first neural network model is read layer by layer through the readout pin of the chip, and the first neural network model is trained based on each processing data to obtain adjusted model parameters.

[0061] The chip's readout pins read out the processed data of each neural layer layer by layer, realizing the recording of data processing in the chip. Taking the chip as a brain-like chip as an example, reading out the pulse sequence (processing data) of each neural layer layer by layer realizes the recording of neuronal activity in the brain-like chip, making the back propagation and parameter callback of the external processor based on the model processing data more accurate.

[0062] Optionally, the training the first neural network model based on each of the processed data includes:

[0063] The first neural network model is trained based on each of the processed data by at least one method selected from the group consisting of spatio-temporal backpropagation training (STBP), feedback, and spike timing dependent plasticity (STDP).

[0064] In the same way as the first neural network model in the chip processes data, the external processor can also perform back propagation training on the first neural network model based on each of the processed data through at least one method of STBP, feedback, and STDP, adjust the model parameters of the first neural network model, and obtain a second neural network model. Optionally, the same data processing method as the first neural network model in the chip can be used, so that the adjustment of the model parameters is more adapted to the data processing method in the chip, and the adjustment of the model parameters is more accurate.

[0065] Among them, STDP (Spike-Timing-Dependent Plasticity) is an unsupervised learning rule that adjusts synaptic weights based on the relative spike firing time between neurons. This learning method does not require labeled data, but guides the learning process through the activity of neurons themselves. STBP is a method for directly training SNNs, which can use information in both the spatial and temporal domains for training. By introducing gradient descent training, it can effectively optimize network weights and improve learning performance.

[0066] S140. Adjust the model parameters of the first neural network model according to the model parameters of the second neural network model based on the chip.

[0067] It can be understood that the present embodiment provides a model training method of on-chip-off-chip alternating learning. Based on this, after adjusting the parameters of the first neural network model in the external processor to obtain the second neural network model, the second neural network model in the external processor is synchronized to the chip, and the synchronized neural network model in the chip is used to continue data processing. Among them, the model structure of the first neural network model in the chip is the same as the model structure of the second neural network model in the external processor, so it is only necessary to synchronize the model parameters of the second neural network model in the external processor to the chip to achieve model synchronization.

[0068] S150, executing the above operations in a loop until the loop end condition is reached, thereby obtaining a trained first neural network model.

[0069] After synchronizing the first neural network model in the chip with the second neural network model processed by the external processor, continue to use the first neural network model in the chip to process the model training data, execute S110-S140 again, and loop the above operations until the loop ends, and use the first neural network model in the chip as the trained first neural network model.

[0070] Among them, the loop end condition can be set according to actual needs, such as the loop end condition can include the target loss value of the second neural network model meeting the set threshold and / or the number of loops reaching the set number of loops.

[0071] The technical solution of the embodiment of the present invention is to obtain model training data based on the chip, wherein the model training data is the initial model training data or the intermediate processing data in a certain iterative training; the model training data is processed based on the first neural network model in the chip to obtain model processing data; the model processing data is read based on the external processor, and the model parameters of the first neural network model in the external processor are adjusted according to the model processing data to obtain the second neural network model; the model parameters of the first neural network model are adjusted according to the model parameters of the second neural network model based on the chip; the above operations are performed in a loop until the loop end condition is reached to obtain the trained first neural network model. When the neural network model in the chip is trained, the on-chip-off-chip interactive model training is realized by the cooperation between the chip and the external processor, the accuracy of data processing is achieved by processing the model training data in the chip, and the model parameters are called back based on the model training data by the external processor, which reduces the performance requirements of the chip, avoids the consumption of a large amount of resources when the chip performs model training alone, simplifies the difficulty of model training in the chip, avoids chip loss, and improves the accuracy of model training.

[0072] Embodiment 2

[0073] Figure 2a It is a flow chart of a model training method provided in the second embodiment of the present invention. Based on the above embodiments, this embodiment specifies the chip as a brain-like chip and the neural network model as a pulse neural network model, thereby providing a preferred embodiment.

[0074] In general, the embodiment of the present invention arranges a plurality of monitoring targets on the transverse section of the target monitoring slope, and sets a plurality of cameras on the object of the target monitoring slope, covering all monitoring areas of the target monitoring slope.

[0075] like Figure 2a As shown, the method provided in this embodiment includes:

[0076] S210. Deploy a pulse neural network model in the brain-like chip and a pulse neural network model in an external processor.

[0077] In this embodiment, a 6-layer pulse neural network can be selected to deploy the pulse neural network model. Exemplarily, the specific architecture of the pulse neural network is: 1 input layer, 2 convolutional layers, 2 fully connected layers and 1 output layer. The same pulse neural network model is also deployed in the external processor.

[0078] S220, processing data within the brain-like chip to obtain feature maps of each neural layer of the pulse neural network model within the brain-like chip.

[0079] Data sets can be selected as model training samples based on the application requirements of the pulse neural network model and the characteristics of brain-like chips. For example, considering that different chip architectures have different specificities and different task paradigms are different, the MNIST ten-class dataset can be selected as the basic task paradigm. The MNIST dataset is a widely used handwritten digit image dataset, which contains approximately 60,000 training images and 10,000 test images, and is used for model training and performance evaluation in the fields of machine learning and computer vision.

[0080] Based on the model training samples, data processing is performed on the brain-like chip, forward propagation is performed, and the feature maps of each layer are obtained.

[0081] S230, read out the feature map of each neural layer in the brain-like chip layer by layer, and save it to an external processor.

[0082] The feature maps of each neural layer can be read out separately based on the readout pin of the brain-like chip, and transmitted to the external processor through the general input and output interface for subsequent training by the external processor.

[0083] S240, the external processor performs back propagation on the pulse neural network model in the external processor based on the feature graphs of each neural layer and updates the parameters.

[0084] Optionally, the STBP algorithm can be used to perform back propagation of the spiking neural network, and the weights and gradients can be adjusted according to the time correlation of the pulses to achieve learning and processing of timing information.

[0085] S250, synchronizing the updated parameters in the external processor to the brain-like chip.

[0086] S260, execute the above operations repeatedly until the model training is complete.

[0087] The fully trained pulse convolutional neural network can be used for the ten categories of MNIST tasks. The model training method provided in this embodiment has been verified to have an on-chip classification accuracy of 98% for the trained model, and the on-chip-off-chip accuracy decay is less than 1%, which performs well and is not lower than the current classification accuracy of brain-like chips based on solidified networks prepared with non-volatile memories such as memristors.

[0088] Figure 2b FIG. 1 is an interactive schematic diagram of a model training provided by Embodiment 2 of the present invention. Figure 2b As shown, feedforward propagation is performed in the brain-like chip to obtain the feature map of each neural layer of the pulse neural network, the feature map is transmitted through the transmission pin of the external processor (external microcontroller unit), and back propagation is performed in the external processor to adjust the model parameters of the pulse neural network model. The above operations are repeated to realize on-chip and off-chip alternating model training.

[0089] This embodiment proposes a method for on-chip learning and continuous deployment of a brain-like chip based on on-chip-off-chip interaction, which can complete the on-chip learning of the spiking neural network of the brain-like chip in a more flexible way without the hardware limitation of non-volatile memory. Compared with the traditional on-chip learning based on non-volatile memory architecture, the on-chip learning method of the brain-like chip spiking neural network based on the present invention can carry more spiking neural network algorithms and more flexible spiking neural network structures, and can complete the complete training of spiking neural networks with shorter training iterations.

[0090] Embodiment 3

[0091] This embodiment provides a chip, including a model training module, for obtaining model training data; processing the model training data based on a first neural network model to obtain model processing data; obtaining a second neural network model processed by an external processor, and adjusting the model parameters of the first neural network model based on the second neural network model; looping the above operations until the loop end condition is reached to obtain the trained first neural network model. The specific implementation of the above steps can refer to the above embodiments, which will not be repeated here.

[0092] Embodiment 4

[0093] This embodiment provides a model training system, including a chip and an external processor, wherein: model training data is obtained based on the chip, wherein the model training data is initial model training data or intermediate processing data in a certain iterative training; the chip is used to process the model training data according to the first neural network model to obtain model processing data; the external processor is used to read the model processing data, and adjust the model parameters of the first neural network model in the external processor according to the model processing data to obtain a second neural network model; the chip is also used to adjust the model parameters of the first neural network model according to the model parameters of the second neural network model. The specific implementation of the above steps can refer to the above embodiments, which will not be repeated here.

[0094] The external processor may be implemented in the form of an electronic device. Figure 3 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. Figure 3A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0095] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0096] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0097] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a model training method.

[0098] In some embodiments, the model training method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the model training method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the model training method in any other suitable manner (e.g., by means of firmware).

[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0100] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0101] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0103] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0104] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A model training method, characterized in that: include: Acquiring model training data based on the chip, wherein the model training data is initial model training data or intermediate processing data in a certain iterative training; Processing the model training data based on the first neural network model in the chip to obtain model processing data; The model processing data is read based on an external processor, and model parameters of the first neural network model in the external processor are adjusted according to the model processing data to obtain a second neural network model; adjusting the model parameters of the first neural network model according to the model parameters of the second neural network model based on the chip; The above operations are executed in a loop until the loop end condition is reached, and the first neural network model after training is obtained.

2. The method according to claim 1, characterized in that The first neural network model includes a plurality of neural layers, and the first neural network model in the chip is used to process the model training data to obtain model processing data, including: The model training data is processed based on the first neural network model to obtain processing data of each neural layer as the model processing data.

3. The method according to claim 2, characterized in that The method of reading the model processing data based on the external processor and adjusting the model parameters of the first neural network model in the external processor according to the model processing data to obtain the second neural network model includes: Based on the external processor, the processing data of each neural layer in the first neural network model is read layer by layer through the readout pin of the chip, and the first neural network model is trained based on each processing data to obtain adjusted model parameters.

4. The method according to claim 3, characterized in that The training of the first neural network model based on each of the processed data comprises: The first neural network model is trained based on each of the processed data by at least one of spatiotemporal back propagation (STBP), feedback, and pulse timing dependent plasticity (STDP).

5. The method according to claim 1, characterized in that The loop end condition includes that the target loss value of the second neural network model meets a set threshold or the number of loops reaches a set number of loops.

6. The method according to claim 1, characterized in that Also includes: Based on the chip's response to the detected model deployment instruction, the model to be deployed is deployed according to the model structure of the model to be deployed, wherein each neural layer of the model to be deployed is respectively deployed on different cortical column cores of the chip.

7. The method according to claim 1, characterized in that The first neural network model is used for behavior decoding of a brain-computer interface system and / or target recognition of a visual camera.

8. The method according to claim 1, characterized in that The chip is a brain-like chip, and the first neural network model is a pulse neural network model.

9. A chip, characterized in that: Includes model training modules for: Get model training data; Processing the model training data based on the first neural network model to obtain model processing data; Acquire a second neural network model processed by an external processor, and adjust model parameters of the first neural network model based on the second neural network model; The above operations are executed in a loop until the loop end condition is reached, and the first neural network model after training is obtained.

10. A model training system, characterized in that: Includes chip and external processor, where: Acquiring model training data based on the chip, wherein the model training data is initial model training data or intermediate processing data in a certain iterative training; The chip is used to process the model training data according to the first neural network model to obtain model processing data; The external processor is used to read the model processing data and adjust the model parameters of the first neural network model in the external processor according to the model processing data to obtain a second neural network model; The chip is also used to adjust the model parameters of the first neural network model according to the model parameters of the second neural network model.

Citation Information

Patent Citations

  • A neural network model training method and device for image data classification

    CN109740657A

  • Training first and second neural network models

    CN111492382A

  • Chip-in-loop proxy training method and device, chip and electronic device

    CN114861892A

  • Online visual development method and device for spiking neural network model

    CN116841529A

  • Model training method and device, image segmentation method and device, equipment and medium

    CN117671271A

Cited By

  • Working method for simulating computer chip

    CN119358620A

  • A working method for simulating a computer chip

    CN119358620B