Coding Method, Apparatus, Device, and Storage Medium

By encoding the simulation value into a target pulse signal including at least one spatial dimension, the problem of low computational efficiency of the pulse neural network model is solved, and the effect of reducing delay and improving computational efficiency is achieved.

CN112529164BActive Publication Date: 2025-05-30LYNXI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011517768.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-21
Publication Date
2025-05-30
Estimated Expiration
2040-12-21

AI Technical Summary

Technical Problem

When processing simulated values, the pulse neural network model has low computational efficiency, resulting in high latency and large computational volume.

Method used

By encoding the simulation value into a target pulse signal including at least one spatial dimension, the simulation value is expressed in fewer time steps, thereby reducing the delay of the model and improving the computational efficiency.

Benefits of technology

The analog signal is expressed in fewer time steps, which reduces the high delay generated by the model and improves the computational efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112529164B_ABST
    Figure CN112529164B_ABST
Patent Text Reader

Abstract

The present invention discloses an encoding method, device, equipment and storage medium. The method includes obtaining an analog value to be encoded; encoding the analog value according to preset encoding information to obtain a target pulse signal including at least one spatial dimension. In this embodiment, according to the preset encoding information, the analog signal can be converted into a pulse signal with only spatial dimension, that is, a pure spatial dimension pulse signal; or the analog signal can be converted into a non-pure spatial dimension pulse signal, that is, a multi-dimensional pulse signal including time dimension and spatial dimension. In this way, an analog signal can be expressed with fewer time steps, thereby reducing the high latency generated by the model and improving the computational efficiency of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of coding technologies, and particularly to a coding method, apparatus, device, and storage medium. Background Art

[0002] In a spiking neuron network (SNN), data is transmitted between neurons in the form of pulses. When the data to be processed in the spiking neuron network is an analog value, the analog value can be converted into a pulse sequence of a certain time length for data transmission.

[0003] However, in related technologies, converting an analog value into a pulse sequence of a certain time length results in low computational efficiency of the spiking neuron network model. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a coding method, apparatus, device, and storage medium to solve the technical problem of low computational efficiency of the model. The specific technical solutions are as follows:

[0005] In the first aspect of the embodiments of the present invention, a coding method is first provided, including the following steps:

[0006] Obtain an analog value to be encoded;

[0007] Encode the analog value according to preset coding information to obtain a target pulse signal;

[0008] Wherein, the target pulse signal includes at least one spatial dimension.

[0009] In the second aspect of the embodiments of the present invention, a coding apparatus is further provided. The coding apparatus includes:

[0010] An obtaining module, configured to obtain an analog value to be encoded;

[0011] An encoding module, configured to encode the analog value according to preset coding information to obtain a target pulse signal;

[0012] Wherein, the target pulse signal includes at least one spatial dimension.

[0013] In the third aspect of the embodiments of the present invention, a device is further provided. The device includes a processor, a memory, and instructions stored on the memory and executable on the processor. When it runs on a computer, it causes the computer to execute the coding method described in any of the above embodiments.

[0014] In the fourth aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which instructions are stored, and when they run on a computer, the computer is enabled to execute the encoding method described in any of the above embodiments.

[0015] In the embodiments of the present invention, an analog value to be encoded is obtained; according to the pre-set encoding information, the analog value is encoded to obtain a target pulse signal including at least one spatial dimension. In this embodiment, according to the pre-set encoding information, the analog signal can be converted into a pulse signal with only a spatial dimension, that is, a pure spatial dimension pulse signal; or the analog signal can be converted into a non-pure spatial dimension pulse signal, that is, a multi-dimensional pulse signal including a time dimension and a spatial dimension. In this way, an analog signal can be expressed with fewer time steps, thereby reducing the high latency generated by the model and improving the computing efficiency of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.

[0017] Figure 1 Schematic diagram of a three-dimensional tensor in the embodiments of the present invention;

[0018] Figure 2 Schematic diagram of a pulse signal in the embodiments of the present invention;

[0019] Figure 3 Flow chart of the encoding method in the embodiments of the present invention;

[0020] Figure 4 Schematic diagram of a pulse signal in the embodiments of the present invention;

[0021] Figure 5 Schematic diagram of another pulse signal in the embodiments of the present invention;

[0022] Figure 6 Schematic diagram of yet another pulse signal in the embodiments of the present invention;

[0023] Figure 7 Schematic diagram of an application scenario of the encoding method in the embodiments of the present invention;

[0024] Figure 8 Schematic diagram of the structure of the encoding device in the embodiments of the present invention;

[0025] Figure 9 Schematic diagram of the structure of the device in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] Next, the technical solutions in the embodiments of the present invention will be described in conjunction with the accompanying drawings in the embodiments of the present invention.

[0027] The encoding method provided by the embodiments of the present invention is applicable to any situation where an analog value needs to be encoded into a pulse signal, and the present disclosure places no restrictions on the applicable scenarios of the encoding method.

[0028] Hereinafter, taking the hybrid communication of an artificial neural network and a spiking neural network as an example, the application scenarios of this embodiment will be elaborated. In the related art, data is transmitted between neurons of an artificial neural network in the form of analog signals, and data is transmitted between neurons of a spiking neural network in the form of pulse signals. By encoding the analog values output by the neurons of the artificial neural network into target pulse signals that can be transmitted and processed by the spiking neural network, the hybrid communication of the artificial neural network and the spiking neural network can be achieved.

[0029] Exemplarily, a convolutional neural network (CNN) is a commonly used artificial neural network in the field of image processing. In a convolutional neural network, each convolutional layer uses a tensor as the data structure. A tensor can be understood as a multi-dimensional array X∈R N*H*W*C , where X represents the multi-dimensional array and R represents any real number. The dimension size of the feature map represented by this multi-dimensional array is [N, H, W, C], where N represents the number of batch data set by the user, H represents the height of the feature map, W represents the width of the feature map, and C represents the number of channels of the feature map. As Figure 1 shown, Figure 1 represents a three-dimensional tensor. Assuming that the height and width of each rectangle are both 1, then, Figure 1 the height of the represented feature map is 4, the width is 5, and the number of channels is 3.

[0030] Among them, a value in the multi-dimensional array represents a neuron activation or pixel point that can be represented by an analog value.

[0031] In the related art, the analog value can be converted into a pulse signal with a single time dimension for processing in the spiking neural network. In this way, a relatively long pulse signal is required to represent an analog value.

[0032] The pulse signal with a single time dimension will be described below in conjunction with the accompanying drawings of the specification. Please refer to Figure 2 , as shown in the figure, the figure includes a rectangular coordinate system. The horizontal axis represents the time dimension, and the vertical axis represents the space dimension. The length of a rectangle on the horizontal axis can be understood as a time step, the filled black rectangle can be understood as emitting a pulse, and the unfilled rectangle can be understood as not emitting a pulse. As shown in the figure, Figure 2The pulse signal therein is a pulse signal including 8 time steps, wherein the pulse signal emits pulses at the 1st, 4th, and 7th time steps and does not emit pulses at the remaining time steps.

[0033] The inventors found that in the case where the analog value can only be converted into a pulse signal with a time dimension, the following technical problems will arise:

[0034] First, it is necessary to express an analog value with a pulse signal of a long time, which will reduce the coding efficiency.

[0035] Second, if an analog value is input during the calculation process of the spiking neural network model, then it is necessary to convert the analog value into a pulse signal of a long time. In this way, it may cause a high delay in the model, thereby reducing the calculation efficiency of the model.

[0036] Third, if an analog value is input during the training process of the spiking neural network model, then it is necessary to convert the analog value into a pulse signal of a long time. In this way, it will increase the calculation amount of the model and occupy a large amount of memory.

[0037] Based on the above possible technical problems, the present invention proposes the following technical concept:

[0038] Express an analog value with a pulse signal including at least one spatial dimension, so as to express an analog value with a pulse signal of a short time.

[0039] Please refer to Figure 3 , Figure 3 which is a flowchart of the encoding method in an embodiment of the present invention. The encoding method provided in this embodiment includes the following steps:

[0040] S101, obtain the analog value to be encoded.

[0041] In this embodiment, the analog value to be encoded can be determined according to the analog signal output by the artificial neural network; or, the analog value can be obtained through the memory address of the analog value. This embodiment does not specifically limit the obtaining manner of the analog value.

[0042] S102, encode the analog value according to the pre-set encoding information to obtain a target pulse signal.

[0043] Wherein, the target pulse signal includes at least one spatial dimension. For example, in the case where the target pulse signal is used to represent the pixels of an image, the target pulse signal includes 2 spatial dimensions.

[0044] Among them, the encoding information can be various types of information preset related to the target pulse signal. For example, it can be the spatial dimension information, time dimension information, etc. of the target pulse signal. Among them, the spatial dimension information can be the number of spatial dimensions, the number of pulse values included in each spatial dimension, etc. The time dimension information can be the number of time dimensions, the number of time steps in the time dimension, the number of pulse values included in each time step, etc. Among them, the encoding information can include one or more specific types of information related to the target pulse signal. For example, the number of time steps is M, and the spatial dimension is N dimensions. It can also be one or more parameters used to determine the information related to the target pulse signal. For example, the parameters of the array corresponding to the target pulse signal, etc. The present disclosure does not limit the form of the encoding information and the content included in the encoding information.

[0045] It should be noted that the target pulse signal can be a pure spatial dimension pulse signal. For example, it can be a pulse signal that only includes the spatial dimension. For example, it can be a pulse signal that includes one or more spatial dimensions. The target pulse signal can also be a multi-dimensional pulse signal that simultaneously includes the spatial dimension and the time dimension. Among them, the time dimension can be 0 or 1, and the spatial dimension can be one or more. The present disclosure does not limit this.

[0046] Exemplarily, an analog value can be represented by a multi-dimensional array. For example, it can be represented by a multi-dimensional array of [r, i, j, k]. Among them, r, i, j, and k can be preset parameters. For example, when r = 1, i = 1, j = 1, and k = 6, an analog value is expressed by the pulse values of 1 time step and 6 feature map channels. For example, it is expressed as [1, 1, 1, 6]. When r = 3, i = 1, j = 1, and k = 2, an analog value is expressed by the target pulse signals of 3 time steps and 2 feature map channels. For example, it is expressed as [3, 1, 1, 2].

[0047] In a possible implementation manner, the analog value array can be represented by a multi-dimensional array with dimensions of [T’, H’, W’, C’]. Among them, T’ represents the time step of the target pulse signal, H’ represents the height of the feature map of the target pulse signal, W’ represents the width of the feature map of the target pulse signal, and C’ represents the number of channels of the feature map of the target pulse signal.

[0048] In some optional embodiments, T’ = r, H’ = iH, W’ = jW, C’ = kC. Exemplarily, when r = 1, i = 1, j = 1, and k = 6, the analog value array can be expressed by the multi-dimensional array [1, H, W, 6C].

[0049] Among them, the multi-dimensional cube composed of [0, r-1], [iH, iH+i-1], [jW, jW+j-1], and [kC, kC+k-1] can be used to represent analog values, and the pulse values in this multi-dimensional cube are determined by the analog values.

[0050] For example, please refer to Figure 4 , as shown in the figure, Figure 4 includes 3 coordinate axes, where 2 coordinate axes are spatial coordinate axes and 1 coordinate axis is a time coordinate axis. The spatial coordinate axes represent the spatial dimensions of the target pulse signal, and the time coordinate axis represents the time dimension of the target pulse signal. Figure 4 The target pulse signal shown includes 2 spatial dimensions and 1 time dimension. Figure 4 The target pulse signal shown can be understood as expressing an analog value with a target pulse signal including 16 pulse values. Among them, the target pulse signal includes 4 time steps in the time dimension, each time step includes 4 pulse values, and each spatial dimension includes 2 pulse values.

[0051] In this embodiment, the analog signal can be converted into a pulse signal with only spatial dimensions, that is, a pure spatial dimension pulse signal, according to the pre-set coding information; or the analog signal can be converted into a non-pure spatial dimension pulse signal, that is, a multi-dimensional pulse signal including time and spatial dimensions. In this way, an analog signal can be expressed with fewer time steps, thereby reducing the high latency generated by the model and improving the computational efficiency of the model. As long as the analog value is encoded into a target pulse signal with at least one spatial dimension, the present disclosure does not limit the number of spatial dimensions of the target pulse signal, the number of pulse values in each spatial dimension, and the determination method of the pulse values in the target pulse signal, etc.

[0052] Exemplarily, when the target pulse signal only includes the spatial dimension, it can be to generate a pulse sequence according to the analog value, and determine the pulse values included in each spatial dimension according to the pulse sequence to obtain the target pulse sequence. It can also be to generate the pulse values included in each spatial dimension respectively according to the analog value to generate the target pulse sequence. When the target pulse signal includes the spatial dimension and the time dimension, it can be to generate a pulse sequence according to the analog value, determine the pulse values included in each time step in the time dimension according to the pulse sequence, and determine the pulse values included in each spatial dimension in each time step. It can also be to determine the pulse values included in each spatial dimension according to the pulse sequence and the number of spatial dimensions, and determine the pulse values included in each time step in each spatial dimension. It can also be to generate the pulse values included in each spatial dimension in each time step respectively according to the analog value, etc. Among them, when generating the pulse sequence, any coding method can be adopted, for example, frequency coding, one-hot coding, group coding, etc. When determining the pulse values included in each dimension, the pulse sequence can be divided, or some pulse values in the pulse sequence can be randomly selected. The present disclosure does not limit this.

[0053] Optionally, the coding information includes the number of time steps and the number of spatial dimensions. The encoding the analog value according to the preset coding information to obtain the target pulse signal includes:

[0054] Encoding the analog value to obtain a pulse signal; converting the pulse signal into a target pulse signal according to the number of time steps and the number of spatial dimensions. The target pulse signal includes M time steps, and the spatial dimension of the target pulse signal is N-dimensional, where M is the number of time steps and N is the number of spatial dimensions. Among them, M is a positive integer and N is a positive integer.

[0055] In this embodiment, after obtaining the analog value, the analog value is encoded to obtain a pulse signal. For the specific technical solution, please refer to the subsequent embodiments.

[0056] An optional implementation manner is that the preset coding information includes but is not limited to the number of time steps and the number of spatial dimensions. The pulse signal is converted into a target pulse signal according to the coding information. Among them, the number of time steps of the target pulse signal is the same as the number of time steps in the coding information, and the spatial dimension of the target pulse signal is also the same as the number of spatial dimensions in the coding information.

[0057] Exemplarily, when the pulse signal is [10001100], and the number of time steps in the coding information is 4 and the number of spatial dimensions is 1, the target pulse signal can be

[10]

[00]

[11]

[00] , where 1 represents emitting a pulse. Please refer to Figure 5 , Figure 5It includes a coordinate system, in which the horizontal axis is the time axis and the vertical axis is the space axis. As shown in the figure, if the target pulse signal is

[10]

[00]

[11]

[00] , the target pulse signal emits a pulse in the first time step; correspondingly, the target pulse signal does not emit a pulse in the second time step; the target pulse signal emits two pulses in the third time step; the target pulse signal does not emit a pulse in the fourth time step, where a pulse value of 1 indicates emitting a pulse and a pulse value of 0 indicates not emitting a pulse.

[0058] An optional implementation is that the encoded information further includes the number of time dimensions. When the number of time dimensions is 0, it indicates that the target pulse signal is a pure spatial pulse signal.

[0059] Exemplarily, when the pulse signal is [10001100] and the number of time dimensions in the encoded information is 0 and the number of spatial dimensions is 1, please refer to Figure 6 , Figure 6 It includes a coordinate system, in which the horizontal axis is the time axis and the vertical axis is the space axis. As shown in the figure, when the target pulse signal is a pure spatial pulse signal, the target pulse signal emits all pulses simultaneously.

[0060] Another optional implementation is that the number of spatial dimensions in the encoded information is greater than 1. In this case, pulses need to be emitted to multiple spatial dimensions.

[0061] Exemplarily, please refer to Figure 4 , Figure 4 It includes a coordinate system that includes three axes, where one axis represents time and the other two axes represent space. As Figure 4 represented by the target pulse signal includes 2 spatial dimensions and 1 time dimension. Among them, the target pulse signal includes 4 time steps in the time dimension, each time step includes 4 pulse values, and each spatial dimension includes 2 pulse values. In this case, the target pulse signal emits pulses to 2 spatial dimensions in one time step.

[0062] Next, an example is given to illustrate how to encode an analog value to obtain a pulse signal:

[0063] Optionally, encoding the analog value to obtain a pulse signal includes:

[0064] Performing quantization processing on the analog value to obtain a quantized analog value; converting the quantized analog value into a binary value to obtain the pulse signal.

[0065] Among them, the quantization simulation value can be an integer within a target range, and the target range can be determined according to the number of pulse values included in the target pulse signal.

[0066] Optionally, a quantization model or a quantization calculation formula can be used to obtain the quantization simulation value, and the specific quantization method is not limited in this embodiment. Among them, the target range of the quantization simulation value is [0, 2 k -1], and k can be the number of pulse values included in the target pulse signal determined according to the preset coding information.

[0067] For example, if the target pulse signal includes 8 pulse values, the target range can be [0, 2 8 -1]. The read analog value can be quantized into this target range to obtain the quantization simulation value, and the quantization simulation value can be converted into an 8-bit binary value, so as to obtain the pulse signal. In this way, the analog value can be converted into a binary value with the number of bits equal to the number of pulse values, and the pulse signal can be determined according to the binary value.

[0068] Optionally, the encoding the analog value to obtain the pulse signal includes:

[0069] Determining the firing frequency of the pulse corresponding to the analog value, where the firing frequency is positively correlated with the analog value; based on the firing frequency, determining the number of times the pulse is fired and the number of times the pulse is not fired; based on the number of times the pulse is fired and the number of times the pulse is not fired, determining the pulse signal.

[0070] In this implementation, the analog value can be input into a frequency encoding model to determine the firing frequency of the pulse corresponding to the analog value, and the firing frequency is positively correlated with the analog value, that is, the larger the value of the analog value, the higher the firing frequency. The firing frequency can be characterized by the ratio of the number of times the pulse is fired to the total number of pulse values, where the total number of pulse values is the sum of the number of times the pulse is fired and the number of times the pulse is not fired. Therefore, the pulse signal can be determined based on the number of times the pulse is fired and the number of times the pulse is not fired.

[0071] For example, if the firing frequency of the pulse corresponding to the analog value is 3 / 8, it means that the pulse signal fires 3 pulses. Then, if it is set that binary number 1 represents the firing of the pulse, the pulse signal can be expressed as [10100010] or [10001100] and other forms including 3 1s. Among them, the positions of the 3 1s can be randomly generated.

[0072] Optionally, the encoding the analog value to obtain the pulse signal includes:

[0073] Quantize the analog value into a decimal value less than or equal to a preset value; convert the decimal value into a binary array to obtain the pulse signal; wherein, the number of elements included in the binary array is the same as the preset value, and the position of the emission element in the binary array is related to the decimal value, and the emission element is used to indicate the emission of a pulse.

[0074] In this embodiment, the read analog value is quantized, and the analog value is quantized into a decimal value less than or equal to a preset value. Wherein, the above preset value can be the number of pulse values of the target pulse signal determined according to the coding information. Convert the quantized decimal value into a binary array.

[0075] Exemplarily, when the preset value is 8, if the analog value is quantized into the decimal value 3, then convert the decimal value 3 into a binary array. Wherein, the binary array includes 8 elements, that is, includes 8 binary numbers. The binary number 1 can be defined as the emission element, and the emission element represents the emission of a pulse. The binary number 0 is defined as the non-emission element, and the non-emission element represents the non-emission of a pulse.

[0076] Further, determine the position of the emission element in the binary array according to the decimal value. When the decimal value is 3, in one case, it can be determined that the 3rd element from the low address to the high address in the array is the emission element, that is, the binary array is 00000100; in another case, it can be determined that the 3rd element from the high address to the low address in the array is the emission element, that is, the binary array is 00100000.

[0077] Optionally, the obtaining of the analog value to be encoded includes:

[0078] Read the analog value address sent by the address generator, where the analog value address is used to indicate the actual memory address of the analog value to be encoded; through the analog value address, obtain the analog value to be encoded.

[0079] An optional embodiment is to obtain the analog value through the memory address of the analog value.

[0080] In the above embodiment, the analog value address sent by the address generator can be read. Wherein, the address generator can be a module preset in the coding device or an external device. The address generator is used to generate an analog value address, and the analog value address indicates the actual memory address of the analog value to be encoded.

[0081] By reading the analog value address, obtain the analog signal to be encoded from the actual memory address of the analog value.

[0082] Taking the encoding of analog values in the form of group encoding as an example, the technical solution of the present invention will be further elaborated in detail. Among them, determining the target pulse sequence according to the encoding information includes 1 time step, 1 spatial dimension, and the target pulse sequence includes 8 pulse values.

[0083] Please refer to Figure 7 , by reading the analog value address sent by the address generator, the analog signal to be encoded is read, and the analog value memory in the figure is the actual memory of the analog value. Quantify the analog value, and quantify it into an integer in [0, 2 8 -1], which is the quantified analog value. Express the quantified analog value in the form of an 8-bit binary number to obtain a pulse sequence. Further, the target pulse signal can be determined according to the pulse sequence. In one embodiment, the target pulse signal includes 1 spatial dimension, and there are 8 pulse values on this spatial dimension. The pulse sequence can be divided bit by bit to determine 8 pulse values on 1 spatial dimension, and the above 8 binary numbers are written in parallel into the corresponding 8 pulse signal memory chips, that is, the pulse value memory shown in the figure. In this way, an analog signal is expressed as a target pulse signal including 1 time step and 1 spatial dimension.

[0084] As Figure 8 shown, the embodiment of the present invention also provides an encoding device 200, including:

[0085] An acquisition module 201, configured to acquire an analog value to be encoded;

[0086] An encoding module 202, configured to encode the analog value according to preset encoding information to obtain a target pulse signal;

[0087] Wherein, the target pulse signal includes at least one spatial dimension.

[0088] Optionally, the encoding module 202 includes:

[0089] An encoding unit, configured to encode the analog value to obtain a pulse signal;

[0090] A partitioning unit, configured to convert the pulse signal into a target pulse signal according to the number of time steps and the number of spatial dimensions. The target pulse signal includes M time steps, and the spatial dimension of the target pulse signal is N-dimensional, where M is the number of time steps and N is the number of spatial dimensions.

[0091] Optionally, the encoding unit is specifically configured to:

[0092] Perform quantization processing on the analog value to obtain a quantified analog value;

[0093] Convert the quantified analog value into a binary number to obtain the pulse signal.

[0094] Optionally, the encoding unit is specifically configured to:

[0095] Determine the firing frequency of the pulse corresponding to the analog value, where the firing frequency is positively correlated with the analog value;

[0096] Based on the firing frequency, determine the number of times the pulse is fired and the number of times the pulse is not fired;

[0097] Based on the number of times fired and the number of times not fired, determine the pulse signal.

[0098] Optionally, the encoding unit is further specifically configured to:

[0099] Quantize the analog value into a decimal value less than or equal to a preset value;

[0100] Convert the decimal value into a binary array to obtain the pulse signal;

[0101] Wherein, the number of elements included in the binary array is the same as the preset value, the position of the firing element in the binary array is related to the decimal value, and the firing element is used to indicate the firing of the pulse.

[0102] Optionally, the obtaining module 201 is specifically configured to:

[0103] Read the analog value address sent by the address generator, where the analog value address is used to indicate the actual memory address of the analog value to be encoded;

[0104] Obtain the analog value to be encoded through the analog value address.

[0105] An embodiment of the present invention further provides a device, as Figure 9 shown, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 complete communication with each other through the communication bus 304;

[0106] The memory 303 is used to store a computer program;

[0107] The processor 301 is configured to execute the program stored on the memory 303;

[0108] When the computer program is executed by the processor, it is used to obtain the analog value to be encoded;

[0109] According to the pre-set encoding information, encode the analog value to obtain a target pulse signal.

[0110] Optionally, when the computer program is executed by the processor, it is further used to encode the analog value to obtain a pulse signal;

[0111] Convert the pulse signal into a target pulse signal according to the number of time steps and the number of spatial dimensions.

[0112] Optionally, when the computer program is executed by a processor, it is further configured to perform quantization processing on the analog value to obtain a quantized analog value;

[0113] Convert the quantized analog value into a binary value to obtain the pulse signal.

[0114] Optionally, when the computer program is executed by a processor, it is further configured to determine the firing frequency of the pulse corresponding to the analog value;

[0115] Based on the firing frequency, determine the number of times the pulse is fired and the number of times the pulse is not fired;

[0116] Based on the number of times the pulse is fired and the number of times the pulse is not fired, determine the pulse signal.

[0117] Optionally, when the computer program is executed by a processor, it is further configured to quantize the analog value into a decimal value less than or equal to a preset value;

[0118] Convert the decimal value into a binary array to obtain the pulse signal.

[0119] Optionally, when the computer program is executed by a processor, it is further configured to read the analog value address sent by the address generator;

[0120] Obtain the analog value to be encoded through the analog value address.

[0121] The communication bus mentioned in the above device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0122] The communication interface is used for communication between the above terminal and other devices.

[0123] The memory may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0124] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0125] In another embodiment provided by the present invention, a computer-readable storage medium is further provided. Instructions are stored in the computer-readable storage medium. When it runs on a computer, the computer is enabled to execute the encoding method described in any one of the above embodiments.

[0126] In another embodiment provided by the present invention, a computer program product containing instructions is further provided. When it runs on a computer, the computer is enabled to execute the encoding method described in any one of the above embodiments.

[0127] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

[0128] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0129] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the related content.

[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.

Claims

1. An encoding method, applied in the field of image processing, Characterized in that, It includes the following steps: Obtain the analog value to be encoded; According to the pre-set encoding information, encode the analog value to obtain a target pulse signal, and write the target pulse signal into the corresponding pulse signal memory chip in parallel; Wherein, the target pulse signal includes at least one spatial dimension, and the target pulse signal is used to represent the pixels of the image; The obtaining the analog value to be encoded includes: Read the analog value address sent by the address generator, and the analog value address is used to indicate the actual memory address of the analog value to be encoded; Through the analog value address, obtain the analog value to be encoded.

2. The encoding method according to claim 1, Characterized in that, The encoding information includes the number of time steps and the number of spatial dimensions. The encoding the analog value according to the pre-set encoding information to obtain a target pulse signal includes: Encode the analog value to obtain a pulse signal; According to the number of time steps and the number of spatial dimensions, convert the pulse signal into a target pulse signal. The target pulse signal includes M time steps, and the spatial dimension of the target pulse signal is N dimensions. M is the number of time steps, and N is the number of spatial dimensions.

3. The encoding method according to claim 2, Characterized in that, The encoding the analog value to obtain a pulse signal includes: Perform quantization processing on the analog value to obtain a quantized analog value; Convert the quantized analog value into a binary value to obtain the pulse signal.

4. The encoding method according to claim 2, Characterized in that, The encoding the analog value to obtain a pulse signal includes: Determine the firing frequency of the pulse corresponding to the analog value, and the firing frequency is positively correlated with the analog value; Based on the firing frequency, determine the number of times the pulse is fired and the number of times the pulse is not fired; Based on the number of times the pulse is fired and the number of times the pulse is not fired, determine the pulse signal.

5. The encoding method according to claim 2, Characterized in that, The encoding the analog value to obtain a pulse signal includes: Quantize the analog value into a decimal value less than or equal to a preset value; Convert the decimal value into a binary array to obtain the pulse signal; Wherein, the number of elements included in the binary array is the same as the preset value, and the position of the firing element in the binary array is related to the decimal value, and the firing element is used to indicate the firing pulse.

6. An encoding device, applied in the field of image processing, Characterized in that, The device includes: An acquisition module, configured to acquire the analog value to be encoded; An encoding module, configured to encode the analog value according to the pre-set encoding information to obtain a target pulse signal, and write the target pulse signal into the corresponding pulse signal memory chip in parallel; Wherein, the target pulse signal includes at least one spatial dimension, and the target pulse signal is used to represent the pixels of the image; The acquisition module is used for: Read the analog value address sent by the address generator, where the analog value address is used to indicate the actual memory address of the analog value to be encoded; Obtain the analog value to be encoded through the analog value address.

7. The encoding device according to claim 6, wherein, the encoding information includes the number of time steps and the number of spatial dimensions, and the encoding module includes: an encoding unit configured to encode the analog value to obtain a pulse signal; a partitioning unit configured to convert the pulse signal into a target pulse signal according to the number of time steps and the number of spatial dimensions, where the target pulse signal includes M time steps, and the spatial dimension of the target pulse signal is N-dimensional, M is the number of time steps, and N is the number of spatial dimensions.

8. A device, wherein, it includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is used to store computer programs; the processor is configured to implement the encoding method according to any one of claims 1-5 when executing the programs stored on the memory.

9. A computer-readable storage medium, on which a computer program is stored, wherein, when the program is executed by a processor, it implements the encoding method according to any one of claims 1-5.

Citation Information

Patent Citations

  • ARTIFICIAL ACTION POTENTIAL GENERATOR, CONVERTER AND ENCODER FOR PULSATED NEURAL NETWORKS

    BR102015004646A2

  • Coded signal generating method and system

    CN106357566A