CN111860786B - Method and device for converting numerical value into pulse - Google Patents

Method and device for converting numerical value into pulse Download PDF

Info

Publication number
CN111860786B
CN111860786B CN202010725977.5A CN202010725977A CN111860786B CN 111860786 B CN111860786 B CN 111860786B CN 202010725977 A CN202010725977 A CN 202010725977A CN 111860786 B CN111860786 B CN 111860786B
Authority
CN
China
Prior art keywords
pulse sequence
pulse
time
time period
current time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010725977.5A
Other languages
Chinese (zh)
Other versions
CN111860786A (en
Inventor
吴臻志
何伟
金罗军
祝夭龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lynxi Technology Co Ltd
Original Assignee
Beijing Lynxi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lynxi Technology Co Ltd filed Critical Beijing Lynxi Technology Co Ltd
Priority to CN202010725977.5A priority Critical patent/CN111860786B/en
Publication of CN111860786A publication Critical patent/CN111860786A/en
Priority to JP2022549708A priority patent/JP7438500B2/en
Priority to PCT/CN2021/108134 priority patent/WO2022017498A1/en
Priority to US17/800,172 priority patent/US11783166B2/en
Priority to EP21846143.2A priority patent/EP4089582A4/en
Application granted granted Critical
Publication of CN111860786B publication Critical patent/CN111860786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Neurology (AREA)
  • Measuring Pulse, Heart Rate, Blood Pressure Or Blood Flow (AREA)

Abstract

The invention discloses a method and a device for converting a numerical value into a pulse sequence of a pulse neural network, wherein the method comprises the following steps of: determining the time n1 of generating the pulse and the time n2 of not generating the pulse of a target pulse sequence to be generated according to the input value; forming a pulse sequence of continuous pulse strings or continuous non-pulse strings in a current time period according to the time quantity n1 and the time quantity n2, and determining the time quantity n3 of the pulse sequence, in which data need to be changed in the current time period; and according to the time quantity n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence. The beneficial effects of the invention are as follows: a random pulse sequence with high biological characteristic coincidence degree and low cost can be generated.

Description

Method and device for converting numerical value into pulse
Technical Field
The invention relates to the technical field of neural networks, in particular to a method and a device for converting numerical values into pulses.
Background
At present, a poisson distribution expected to be n is generally adopted for generating a random pulse sequence for a pulse neural network, and the poisson distribution accords with biological characteristics, but due to higher complexity, hardware implementation is not friendly, so that pulse generation speed is low, and power consumption efficiency is insufficient. There are also n continuous pulses directly generated, and no pulse is transmitted after that, although the hardware efficiency is high, the generated sequence density is not random enough, so the coincidence degree with biological characteristics is low, and the performance of the pulse neural network is affected to a certain extent.
Disclosure of Invention
In order to solve the above problems, the present invention aims to provide a method and a device for converting digital pulse, which can generate a random pulse sequence with high biological characteristic conformity and low cost.
The invention provides a method for converting an input numerical value into a pulse sequence of a pulse neural network, which comprises the following steps:
according to the input numerical value, determining the time n1 of generating the pulse and the time n2 of not generating the pulse of a target pulse sequence to be generated, wherein n1 is greater than or equal to 0, and n2 is greater than or equal to 0, and the target pulse sequence to be generated is a pulse sequence of the pulse neural network in a time period;
forming a pulse sequence of continuous pulse strings or continuous non-pulse strings in a current time period according to the time quantity n1 and the time quantity n2, and determining a time quantity n3 of the pulse sequence, in which data need to be changed in the current time period, wherein n3 is greater than or equal to 0;
and according to the time quantity n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence.
As a further improvement of the present invention, wherein, according to the time n1 and the time n2, a pulse sequence of continuous pulse trains or continuous non-pulse trains is formed in a current time period, and the time n3 in which data need to be changed in the current time period in the pulse sequence is determined, the method includes:
if the time n1 is greater than or equal to the time n2, generating a pulse for each time in the current time period, forming a pulse sequence of continuous pulse strings, and determining the time n3 = n2 in the current time period in the pulse sequence, wherein the data need to be changed.
As a further improvement of the present invention, according to the number of times n3, data corresponding to n3 times in the current time period in the pulse sequence are randomly modified to form the target pulse sequence, including:
and randomly generating a moment t of data to be changed in the pulse sequence every time, deleting the pulse corresponding to the moment t in the pulse sequence, traversing n3 moments until the data corresponding to the n3 moments in the current time period in the pulse sequence are deleted, and forming the target pulse sequence.
As a further improvement of the present invention, wherein, according to the time n1 and the time n2, a pulse sequence of continuous pulse trains or continuous non-pulse trains is formed in a current time period, and the time n3 in which data need to be changed in the current time period in the pulse sequence is determined, the method includes:
if the time n1 is smaller than the time n2, no pulse is generated for each time in the current time period, a pulse sequence of continuous non-pulse strings is formed, and the time n3 = n1 of the pulse sequence, in which data need to be changed in the current time period, is determined.
As a further improvement of the present invention, according to the number of times n3, data corresponding to n3 times in the current time period in the pulse sequence are randomly modified to form the target pulse sequence, including:
and randomly generating a moment t of data to be changed in the pulse sequence every time, transmitting a pulse to the moment t in the pulse sequence, traversing n3 moments until the pulse is transmitted to n3 moments in the current time period in the pulse sequence, and forming the target pulse sequence.
The invention also provides a device for converting an input value into a pulse sequence of a pulse neural network, comprising:
a pulse sequence storage area, configured to store a pulse sequence, where the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by a time n1 when a pulse is generated according to a target pulse sequence to be generated and a time n2 when no pulse is generated, where n1 is greater than or equal to 0, and n2 is greater than or equal to 0, and the target pulse sequence to be generated is a pulse sequence of the pulse neural network in a time period;
the random number generator is used for randomly generating n3 moments in the pulse sequence storage area, in which the data need to be changed, according to the quantity n3 of the moments in the pulse sequence storage area, in which the data need to be changed, in the current time period, wherein n3 is greater than or equal to 0;
and the control logic is used for changing the data corresponding to n3 moments in the current time period in the pulse sequence storage area to form the target pulse sequence.
As a further improvement of the present invention, wherein the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by a number of times n1 of generating pulses and a number of times n2 of not generating pulses in a period of time according to the target pulse sequence to be generated, comprising:
determining the time n1 of the pulse generation of the target pulse sequence to be generated and the time n2 of the pulse generation not according to the input value;
if the time n1 is greater than or equal to the time n2, writing a c value into each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous pulse strings, wherein c=1;
and if the time n1 is smaller than the time n2, writing a value of c at each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous non-pulse strings, wherein c=0.
As a further improvement of the present invention, if the time number n1 is greater than or equal to the time number n2, c=1, determining a time number n3=n2 in the pulse sequence storage area where data needs to be changed in the current time period;
if the time n1 is smaller than the time n2, c=0, determining the time n 3=n1 in which the data needs to be changed in the current time period in the pulse sequence storage area.
As a further improvement of the invention, the random number generator is used for randomly generating one time t of data needing to be changed in the pulse sequence storage area each time until n3 times of data needing to be changed in the pulse sequence storage area are generated.
As a further improvement of the present invention, the control logic changes data corresponding to n3 times in a current time period in the pulse sequence storage area, including:
and the control logic writes the time t in the current time period in the pulse sequence storage area into a 1-c value each time, traverses n3 times t until n3 times in the current time period in the pulse sequence storage area are respectively written into a 1-c value, wherein 1-c is 0 or 1.
As a further improvement of the present invention, wherein said control logic writes a time t within a current time period in said pulse train storage area to a 1-c value each time, comprises:
if the time number n1 is greater than or equal to the time number n2, the control logic writes time t in the current time period in the pulse sequence storage area into 0 each time;
if the time n1 is smaller than the time n2, the control logic writes 1 to the time t in the current time period in the pulse sequence storage area each time.
As a further improvement of the present invention, wherein the apparatus further comprises:
and the circulation control counter is used for counting the number of the data changed by the control logic, and the circulation control counter is decremented by 1 and repeatedly circulated until the control logic changes the data corresponding to n3 moments in the current time period in the pulse sequence storage area every time the control logic changes one data.
As a further improvement of the present invention, wherein the cycle control counter includes:
c, a judging device for judging the data of the pulse sequence storage area in the current time period;
the down counter is used for storing the time quantity n3 of the data to be changed, and the down counter is used for decrementing the time quantity of the data to be changed by 1 after the c judgment device judges that the pulse sequence storage area is written with the full c value and the control logic writes the 1-c value into the pulse sequence storage area at one time in the current time period;
and the return-to-0 judging device is used for judging whether the down counter returns to 0.
As a further improvement of the invention, the random number generator adopts a linear feedback shift register structure.
The invention also provides an electronic device comprising a memory for storing one or more computer instructions, and a processor, wherein the one or more computer instructions are executed by the processor to implement the method.
The invention also provides a computer readable storage medium having stored thereon a computer program, characterized in that the computer program is executed by a processor to implement the method.
The beneficial effects of the invention are as follows:
the method can be adapted to a short period of time, and is beneficial to reducing the number of time domain time calculation so as to reduce the operation amount;
the generated pulse sequence is random and uniform in density, so that the biological characteristic conformity is improved;
the complexity of hardware is reduced, hardware resources are saved, and the efficiency of hardware is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the prior art, the drawings that are used in the description of the embodiments or the prior art will be briefly described below. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without inventive faculty.
FIG. 1 is a flow chart of a method for numerical pulse inversion according to an exemplary embodiment of the present disclosure;
fig. 2 is a schematic diagram of a numerical pulse-turning device according to an exemplary embodiment of the present disclosure.
Detailed Description
The following description of the technical solutions in the embodiments of the present disclosure will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
It should be noted that, if directional indications (such as up, down, left, right, front, and rear … …) are included in the embodiments of the present disclosure, the directional indications are merely used to explain the relative positional relationship, movement conditions, etc. between the components in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indications are correspondingly changed.
In addition, in the description of the present disclosure, the terminology used is for the purpose of illustration only and is not intended to limit the scope of the present disclosure. The terms "comprises" and/or "comprising" are used to specify the presence of stated elements, steps, operations, and/or components, but do not preclude the presence or addition of one or more other elements, steps, operations, and/or components. The terms "first," "second," and the like may be used for describing various elements, do not represent a sequence, and are not intended to limit the elements. Furthermore, in the description of the present disclosure, unless otherwise indicated, the meaning of "a plurality" is two and more. These terms are only used to distinguish one element from another element. These and/or other aspects will become apparent to those of ordinary skill in the art from a review of the following drawings, and a description of the embodiments of the present disclosure will be more readily understood. The drawings are intended to depict the embodiments of the disclosure for purposes of illustration only. Those skilled in the art will readily recognize from the following description that alternative embodiments of the structures and methods illustrated in the present disclosure may be employed without departing from the principles of the present disclosure.
A method for converting an input value into a pulse sequence of a pulse neural network according to an embodiment of the present disclosure, as shown in fig. 1, includes:
according to the input numerical value, determining the time n1 of generating the pulse and the time n2 of not generating the pulse of a target pulse sequence to be generated, wherein n1 is greater than or equal to 0, n2 is greater than or equal to 0, and the target pulse sequence to be generated is a pulse sequence of a pulse neural network in a time period;
forming a pulse sequence of a continuous pulse string or a continuous non-pulse string in a current time period according to the time number n1 and the time number n2, and determining the time number n3 of the pulse sequence, in which data need to be changed in the current time period, wherein n3 is greater than or equal to 0;
and according to the time quantity n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form a target pulse sequence.
The input value may be, for example, a pixel value of an image, a voice waveform converted value, a text converted value, a calculation result after image preprocessing, or the like. The present disclosure does not specifically limit the input values. The n3 times at which the data needs to be changed are different times.
The impulse neural network is a network with time dimension coding information. For example, the minimum time unit of the operation process of the impulse neural network is one time. The pulse may or may not occur at each time instant, and the pulse information at each time instant is a binary variable, i.e. whether there is a pulse. For example, one period of time contains R times. R=n1+n2, where n1 times have pulses, n2 times have no pulses, and the time positions of the pulses are as random as possible during this time period. The data that needs to be modified may be pulsed (e.g., 1 in value) or non-pulsed (e.g., 0 in value).
The total number n1 of pulses of the target pulse sequence to be generated is positively correlated with the input values, the target pulse sequence is a pulse sequence with random time dimension, and each input value is converted into a target pulse sequence with random time dimension.
In an alternative embodiment, forming a pulse sequence of continuous pulse trains or continuous non-pulse trains in a current time period according to the time n1 and the time n2, and determining the time n3 in the pulse sequence, in which data need to be changed in the current time period, includes:
if the time n1 is greater than or equal to the time n2, a pulse is generated for each time in the current time period, a pulse sequence of continuous pulse trains is formed, and the time n3 = n2 of the pulse sequence, in which data need to be changed in the current time period, is determined.
In another alternative embodiment, according to the number of times n3, data corresponding to n3 times in a current time period in the pulse sequence are randomly changed to form a target pulse sequence, including:
and randomly generating a time t for changing data in the pulse sequence every time, deleting the data corresponding to the time t in the pulse sequence, traversing n3 times until the data corresponding to n3 times in the current time period in the pulse sequence are deleted, and forming a target pulse sequence. Where the pulse train is a continuous pulse train, the data to be modified is a pulse (e.g., 1).
In an alternative embodiment, according to the number of times n1 and the number of times n2, a pulse sequence of continuous pulse strings or continuous non-pulse strings is formed in the current time period, and the determining the number of times n3 in which the data needs to be changed in the current time period in the pulse sequence includes:
if the number of times n1 is smaller than the number of times n2, no pulse is generated for each time in the current time period, a pulse sequence of continuous non-pulse strings is formed, and the number of times n3=n1 in which data need to be changed in the current time period in the pulse sequence is determined.
In another alternative embodiment, according to the number of times n3, data corresponding to n3 times in a current time period in the pulse sequence are randomly changed to form a target pulse sequence, including:
and randomly generating a time t for changing data in the pulse sequence every time, transmitting a pulse to the time t in the pulse sequence, traversing n3 times until the pulse is transmitted to n3 times in the current time period in the pulse sequence, and forming a target pulse sequence. Where the pulse train is a continuous non-pulse train, the data to be modified is non-pulse (e.g., 0).
The method disclosed by the disclosure is applied to a pulse neural network, a time period comprises a plurality of time points, each time point position can be 1 (pulse) or 0 (non-pulse), and all the time points in the time period form a target pulse sequence. For example, the total time count of a time period is R, where r=n1+n2, where n1 times have pulses, n2 times have no pulses, and the time positions of the pulses in the time period are as random as possible. The number of the time n1 and the number of the time n2 can be judged in advance according to the input numerical value, if the time n1 is greater than or equal to the time n2, all the time of the current period can be firstly set with 1 (namely pulse is generated), and then the pulses corresponding to the n2 times are randomly deleted; if the number of times n2 is greater than the number of times n1, all times may be first set to 0 (i.e., no pulse is generated), and then pulses may be randomly generated for n1 times.
According to the method disclosed by the disclosure, on one hand, the pulse generation speed can be increased by generating continuous pulses, the hardware complexity is reduced, the hardware efficiency is improved, the method can be adapted to a short time period, the number of calculation time domain moments is reduced, and therefore the operation amount is reduced; on the other hand, by randomly changing part of pulses in the pulse sequence, the generated pulse sequence is random and uniform in density, so that the biological characteristic conformity can be improved.
An apparatus for converting an input value into a pulse sequence of a pulse neural network according to an embodiment of the present disclosure, as shown in fig. 2, includes:
a pulse sequence storage area for storing a pulse sequence, wherein the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by a time n1 for generating a pulse according to a target pulse sequence to be generated and a time n2 for not generating the pulse, n1 is greater than or equal to 0, n2 is greater than or equal to 0, and the target pulse sequence to be generated is a pulse sequence of a pulse neural network in a time period;
the random number generator is used for randomly generating n3 moments of the pulse sequence storage area, which need to change data, according to the n3 moments of the pulse sequence storage area, which need to change data, in the current time period, wherein n3 is greater than or equal to 0;
and the control logic is used for changing the data corresponding to n3 moments in the current time period in the pulse sequence storage area to form a target pulse sequence.
The impulse neural network is a network with time dimension coding information. For example, the minimum time unit of the operation process of the impulse neural network is one time. The pulse may or may not occur at each time instant, and the pulse information at each time instant is a binary variable, i.e. whether there is a pulse. For example, one period of time contains R times. R=n1+n2, where n1 times have pulses, n2 times have no pulses, and the time positions of the pulses are as random as possible during this time period.
The total number n1 of pulses of the target pulse sequence to be generated is positively correlated with the input values, the target pulse sequence is a pulse sequence with random time dimension, and each input value is converted into a target pulse sequence with random time dimension.
In an alternative embodiment, the pulse sequence is a continuous pulse train or continuous non-pulse train formed by a time n1 of generating pulses according to the target pulse sequence and a time n2 of not generating pulses, including:
determining the time n1 of generating the pulse and the time n2 of not generating the pulse of a target pulse sequence to be generated according to the input value;
if the time n1 is greater than or equal to the time n2, writing a c value into each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous pulse strings, wherein c=1;
and if the time n1 is smaller than the time n2, writing a value of c at each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous non-pulse strings, wherein c=0.
Where c=1 indicates that a pulse is generated for each time during the current period, and c=0 indicates that no pulse is generated for each time during the current period.
The input value may be, for example, a pixel value of an image, a voice waveform converted value, a text converted value, a calculation result after image preprocessing, or the like. The present disclosure does not specifically limit the input values.
In another alternative embodiment, if the number of times n1 is greater than or equal to the number of times n2, c=1, determining the number of times n3=n2 in the pulse sequence storage area where the data needs to be changed in the current time period; if the time n1 is smaller than the time n2, c=0, determining the time n 3=n1 in which the data need to be changed in the current time period in the pulse sequence storage area.
In an alternative embodiment, the random number generator is configured to randomly generate one time t of the pulse sequence memory area at a time when the data needs to be changed, until n3 times when the data needs to be changed in the pulse sequence memory area are generated.
In an alternative embodiment, the random number generator employs a Linear Feedback Shift Register (LFSR) structure, which may reduce hardware power consumption.
In an alternative embodiment, the control logic changes the data corresponding to n3 times in the current time period in the pulse sequence storage area, including:
the control logic writes the time t in the current time period in the pulse sequence storage area with the 1-c value each time, traverses n3 times t until n3 times in the current time period in the pulse sequence storage area are respectively written with the 1-c value, wherein 1-c is 0 or 1.
In another alternative embodiment, the control logic writes a 1-c value at a time t within a current time period in the pulse sequence memory area, comprising:
if the time n1 is greater than or equal to the time n2, the control logic writes the time t in the current time period in the pulse sequence storage area into 0 each time, namely deleting the pulse corresponding to the time t in the current time period in the pulse sequence storage area;
if the time n1 is smaller than the time n2, the control logic writes 1 the time t in the current time period in the pulse sequence storage area each time, that is, sends a pulse to the time t in the current time period in the pulse sequence storage area.
The device disclosed by the disclosure can judge the number of the time n1 and the time n2 in advance according to the input value, and write the value of c at each time in the current time period in the pulse sequence storage area according to the number of the time n1 and the number of the time n2. If the time n1 is greater than or equal to the time n2, 1 can be written (i.e. pulse is generated) at all times of the current period in the pulse sequence storage area, then the control logic writes 0 at n3 times, i.e. deletes the pulse corresponding to n3 times; if the number of times n2 is greater than the number of times n1, all times of the current period in the pulse sequence storage area may be written as 0 first (i.e., no pulse is generated), then the control logic writes 1 for n3 of the times, i.e., pulses are issued for n3 of the times.
In another alternative embodiment, the apparatus further comprises: and the circulation control counter is used for counting the number of the data changed by the control logic, and the circulation control counter is decremented by 1 every time the control logic changes one data until the control logic changes the data corresponding to n3 moments in the current time period in the pulse sequence storage area.
The control logic is responsible for checking whether the data is changed at the moment t or not through generating a random number t each time by the random number generator, namely, the moment position of the data to be changed is required, if the moment t is changed, the control logic informs the random number generator to regenerate the random number t, namely, the moment position of the data to be changed is determined again until the data corresponding to the moment t is not changed; if the time t is not changed, the control logic notifies the random number generator to regenerate the random number t after changing the data corresponding to the time t, and notifies the circulation control counter to reduce the number of the data to be changed by 1 and repeat the circulation process until the number of the data to be changed is equal to 0, and the change process is ended and the result is output.
In an alternative embodiment, the loop control counter includes:
c, a judging device for judging the data of the pulse sequence storage area in the current time period;
the down counter is used for storing the time quantity n3 of the data to be changed, and the down counter is used for decrementing the time quantity of the data to be changed by 1 after the c judgment device judges that the pulse sequence storage area is written with the full c value and the control logic writes the 1-c value into the pulse sequence storage area at one time in the current time period;
and the return-to-0 judging device is used for judging whether the down counter returns to 0.
As shown in fig. 2, the device described in the present disclosure may have three states:
state 1, load state:
the write address line is adopted to traverse all addresses (all moments in each time period), the pulse sequence storage area is written with a full c value, and the number n3 to be changed is written into the down counter as an initialization value.
State 2, change state:
the random number generator generates a random address, reads address data from the pulse sequence storage area according to the address, judges for the c judging device, if the address is c, the down counter is informed to decrement 1, the write enable is opened to write the 1-c value into the address position of the pulse sequence storage area, meanwhile, whether the down count value is reset to 0 is judged, if the down count value is reset to 0, the control logic is informed to enter a state 3, otherwise, the state 2 is continued, and the random number generator continues to generate a new address and loops.
State 3, output state:
the read address line traverses all addresses, outputting the data in the pulse sequence storage area.
The device disclosed by the disclosure can improve the pulse generation speed by generating continuous pulses, reduce the hardware complexity, improve the hardware efficiency, be suitable for a short time period, and be beneficial to reducing the number of calculated time domain moments, so that the operation amount is reduced; on the other hand, by randomly changing part of pulses in the pulse sequence, the generated pulse sequence is random and uniform in density, so that the biological characteristic conformity can be improved.
The disclosure also relates to an electronic device, including a server, a terminal, and the like. The electronic device includes: at least one processor; a memory communicatively coupled to the at least one processor; and a communication component in communication with the storage medium, the communication component receiving and transmitting data under control of the processor; the memory stores instructions executable by the at least one processor to implement the numerical pulse inversion method of the above embodiments.
In an alternative embodiment, the memory is implemented as a non-volatile computer-readable storage medium, and is used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor executes various functional applications of the device and data processing, i.e., a method of implementing numerical pulsing, by running non-volatile software programs, instructions, and modules stored in the memory.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store a list of options, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory optionally includes memory remotely located from the processor, the remote memory being connectable to the external device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in memory that, when executed by one or more processors, perform the method of numerical transpulsing in any of the method embodiments described above.
The product may perform the method for converting the numerical value into the pulse provided by the embodiment of the present application, and has the corresponding functional module and beneficial effects of the performing method, and technical details not described in detail in the embodiment of the present application may be referred to the method for converting the numerical value into the pulse provided by the embodiment of the present application.
The present disclosure also relates to a computer-readable storage medium storing a computer-readable program for causing a computer to execute some or all of the above-described method embodiments.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments described herein. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Furthermore, one of ordinary skill in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
It will be understood by those skilled in the art that while the invention has been described with reference to exemplary embodiments, various changes may be made and equivalents may be substituted for elements thereof without departing from the scope of the invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the invention without departing from the essential scope thereof. Therefore, it is intended that the invention not be limited to the particular embodiment disclosed, but that the invention will include all embodiments falling within the scope of the appended claims.

Claims (13)

1. A method of numerical value to pulse for converting an input numerical value to a pulse train of a pulsed neural network, the method comprising:
according to the input numerical value, determining the time n1 of generating the pulse and the time n2 of not generating the pulse of a target pulse sequence to be generated, wherein n1 is greater than or equal to 0, and n2 is greater than or equal to 0, and the target pulse sequence to be generated is a pulse sequence of the pulse neural network in a time period;
forming a pulse sequence of a continuous pulse train or a continuous non-pulse train in a current time period according to the time quantity n1 and the time quantity n2, and determining the time quantity n3 of the pulse sequence, in which data need to be changed, in the current time period, wherein n3 is greater than or equal to 0, and if the time quantity n1 is greater than or equal to the time quantity n2, generating a pulse for each time in the current time period, forming the pulse sequence of the continuous pulse train, and determining the time quantity n3 = n2 of the pulse sequence, in which data need to be changed, in the current time period; if the time n1 is smaller than the time n2, generating no pulse at each time in the current time period, forming a pulse sequence of continuous non-pulse strings, and determining the time n3 = n1 of the pulse sequence in which data need to be changed in the current time period;
and according to the time quantity n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence.
2. The method of claim 1, wherein if n3=n2, according to the number of times n3, randomly modifying data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence, including:
and randomly generating a moment t of data to be changed in the pulse sequence every time, deleting the pulse corresponding to the moment t in the pulse sequence, traversing n3 moments until the pulse corresponding to n3 moments in the current time period in the pulse sequence is deleted, and forming the target pulse sequence.
3. The method of claim 1, wherein if n3=n1, according to the number of times n3, randomly modifying data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence, including:
and randomly generating a moment t of data to be changed in the pulse sequence every time, transmitting a pulse to the moment t in the pulse sequence, traversing n3 moments until the pulse is transmitted to n3 moments in the current time period in the pulse sequence, and forming the target pulse sequence.
4. A numerical to pulse apparatus for converting an input numerical value into a pulse train of a pulsed neural network, the apparatus comprising:
a pulse sequence storage area, configured to store a pulse sequence, where the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by a time n1 when a pulse is generated according to a target pulse sequence to be generated and a time n2 when no pulse is generated, where n1 is greater than or equal to 0, and n2 is greater than or equal to 0, and the target pulse sequence to be generated is a pulse sequence of the pulse neural network in a time period;
a random number generator, configured to randomly generate n3 times of the pulse sequence storage area that need to change data according to a time n3 of the pulse sequence storage area that needs to change data in a current time period, where n3 is greater than or equal to 0, and if the time n1 is greater than or equal to the time n2, determine a time n 3=n2 of the pulse sequence storage area that needs to change data in the current time period; if the time n1 is smaller than the time n2, determining the time n3=n1 of the data needing to be changed in the current time period in the pulse sequence storage area;
and the control logic is used for changing the data corresponding to n3 moments in the current time period in the pulse sequence storage area to form the target pulse sequence.
5. The apparatus of claim 4, wherein the pulse train is a continuous pulse train or a continuous non-pulse train formed of a number of times n1 at which pulses are generated and a number of times n2 at which no pulses are generated according to the target pulse train to be generated, comprising:
determining the time n1 of the pulse generation of the target pulse sequence to be generated and the time n2 of the pulse generation not according to the input value;
if the time n1 is greater than or equal to the time n2, writing a c value into each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous pulse strings, wherein c=1;
and if the time n1 is smaller than the time n2, writing a value of c at each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous non-pulse strings, wherein c=0.
6. The apparatus of claim 4, wherein the random number generator is configured to randomly generate one time t of the pulse sequence storing area at a time when data needs to be changed until n3 times of the pulse sequence storing area when data needs to be changed are generated.
7. The apparatus of claim 6, wherein the control logic to alter data corresponding to n3 times within a current time period in the pulse sequence memory region comprises:
and the control logic writes the time t in the current time period in the pulse sequence storage area into a 1-c value each time, traverses n3 times t until n3 times in the current time period in the pulse sequence storage area are respectively written into a 1-c value, wherein 1-c is 0 or 1.
8. The apparatus of claim 7, wherein the control logic writes a time t within a current time period in the pulse sequence memory area to a 1-c value each time, comprising:
if the time number n1 is greater than or equal to the time number n2, the control logic writes time t in the current time period in the pulse sequence storage area into 0 each time;
if the time n1 is smaller than the time n2, the control logic writes 1 to the time t in the current time period in the pulse sequence storage area each time.
9. The apparatus of claim 4, wherein the apparatus further comprises:
and the circulation control counter is used for counting the number of the data changed by the control logic, and the circulation control counter is decremented by 1 and repeatedly circulated until the control logic changes the data corresponding to n3 moments in the current time period in the pulse sequence storage area every time the control logic changes one data.
10. The apparatus of claim 9, wherein the loop control counter comprises:
c, a judging device for judging the data of the pulse sequence storage area in the current time period;
the down counter is used for storing the time quantity n3 of the data to be changed, and the down counter is used for decrementing the time quantity of the data to be changed by 1 after the c judgment device judges that the pulse sequence storage area is written with the full c value and the control logic writes the 1-c value into the pulse sequence storage area at one time in the current time period;
and the return-to-0 judging device is used for judging whether the down counter returns to 0.
11. The apparatus of claim 4, wherein the random number generator employs a linear feedback shift register structure.
12. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method of any of claims 1-3.
13. A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the method of any of claims 1-3.
CN202010725977.5A 2020-07-24 2020-07-24 Method and device for converting numerical value into pulse Active CN111860786B (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
CN202010725977.5A CN111860786B (en) 2020-07-24 2020-07-24 Method and device for converting numerical value into pulse
JP2022549708A JP7438500B2 (en) 2020-07-24 2021-07-23 Methods, apparatus, electronic devices and storage media for converting numerical values into pulses
PCT/CN2021/108134 WO2022017498A1 (en) 2020-07-24 2021-07-23 Method and apparatus for converting numerical values to spikes, electronic device, and storage medium
US17/800,172 US11783166B2 (en) 2020-07-24 2021-07-23 Method and apparatus for converting numerical values into spikes, electronic device and storage medium
EP21846143.2A EP4089582A4 (en) 2020-07-24 2021-07-23 Method and apparatus for converting numerical values to spikes, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010725977.5A CN111860786B (en) 2020-07-24 2020-07-24 Method and device for converting numerical value into pulse

Publications (2)

Publication Number Publication Date
CN111860786A CN111860786A (en) 2020-10-30
CN111860786B true CN111860786B (en) 2024-04-09

Family

ID=72949561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010725977.5A Active CN111860786B (en) 2020-07-24 2020-07-24 Method and device for converting numerical value into pulse

Country Status (1)

Country Link
CN (1) CN111860786B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11783166B2 (en) 2020-07-24 2023-10-10 Lynxi Technologies Co., Ltd. Method and apparatus for converting numerical values into spikes, electronic device and storage medium
CN114495178B (en) * 2022-04-14 2022-06-21 深圳时识科技有限公司 Pulse sequence randomization method and device, brain-like chip and electronic equipment
CN114466153B (en) * 2022-04-13 2022-09-09 深圳时识科技有限公司 Self-adaptive pulse generation method and device, brain-like chip and electronic equipment
WO2023197429A1 (en) * 2022-04-13 2023-10-19 深圳时识科技有限公司 System for converting frame images into spikes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520292A (en) * 1991-07-12 1993-01-29 Ricoh Co Ltd Random number pulse string generating circuit device and signal processor
CN105095965A (en) * 2015-07-16 2015-11-25 清华大学 Hybrid communication method of artificial neural network and impulsive neural network
CN107798384A (en) * 2017-10-31 2018-03-13 泰山医学院 Can be evolved impulsive neural networks construction method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520292A (en) * 1991-07-12 1993-01-29 Ricoh Co Ltd Random number pulse string generating circuit device and signal processor
CN105095965A (en) * 2015-07-16 2015-11-25 清华大学 Hybrid communication method of artificial neural network and impulsive neural network
CN107798384A (en) * 2017-10-31 2018-03-13 泰山医学院 Can be evolved impulsive neural networks construction method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于梯度下降的脉冲神经元精确序列学习算法;杨静;赵欣;徐彦;姜赢;;计算机工程与应用(23);全文 *
基于脉冲神经网络的边缘检测;蔡荣太;吴庆祥;;微电子学与计算机(10);全文 *

Also Published As

Publication number Publication date
CN111860786A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN111860786B (en) Method and device for converting numerical value into pulse
CN111898737B (en) Method and device for converting image into pulse
Ciardo et al. Analysis of deterministic and stochastic Petri nets
Feng et al. Symbolic generalization for on-line planning
CN105487987B (en) A kind of concurrent sequence of processing reads the method and device of IO
CN109379299A (en) A kind of method for limiting of data traffic, device and system
CN104951361A (en) Method and device for triggering timing task
CN104699422A (en) Determination method and determination device of cache data
CN109857984A (en) A kind of homing method and device of boiler load factor-efficacy curve
CN110532294A (en) Ticket merging method, device, equipment and computer readable storage medium
CN105493024B (en) A kind of data threshold prediction technique and relevant apparatus
Halbach et al. Optimal 6-state algorithms for the behavior of several moving creatures
CN109800074A (en) Task data concurrently executes method, apparatus and electronic equipment
US11783166B2 (en) Method and apparatus for converting numerical values into spikes, electronic device and storage medium
CN107391440B (en) Processing device and method for output data of fast Fourier transform algorithm
CN113726692B (en) Virtual network mapping method and device based on generation of countermeasure network
CN111640012A (en) Block chain transaction tracing method and device
CN111126584B (en) Data write-back system
CN105429733B (en) A kind of message scheduling sending method and device
CN102595192B (en) Video streaming media non-mutual-exclusion buffering method
CN111967395A (en) Bank bill identification method and device
CN112379858A (en) Method and device for generating random number, electronic equipment and readable storage medium
CN111860778A (en) Full-additive convolution method and device
CN115146767B (en) Two-dimensional convolution accelerator and method for accelerating two-dimensional convolution
CN114400032B (en) Method, device and medium for dynamically accelerating resistance value setting of resistive random access memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant