CN111860786A - 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
CN111860786A
CN111860786A CN202010725977.5A CN202010725977A CN111860786A CN 111860786 A CN111860786 A CN 111860786A CN 202010725977 A CN202010725977 A CN 202010725977A CN 111860786 A CN111860786 A CN 111860786A
Authority
CN
China
Prior art keywords
pulse sequence
time
pulse
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.)
Granted
Application number
CN202010725977.5A
Other languages
Chinese (zh)
Other versions
CN111860786B (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

Images

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, which convert an input numerical value into a pulse sequence of a pulse neural network and comprise the following steps: determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to the input numerical value; forming a pulse sequence of continuous pulse trains or continuous non-pulse trains in the current time period according to the time number n1 and the time number n2, and determining the time number n3 of the pulse sequence, wherein data need to be changed in the current time period; and randomly changing data corresponding to n3 moments in the current time period in the pulse sequence according to the moment number n3 to form the target pulse sequence. The invention has the beneficial effects that: random pulse sequences with high biological characteristic conformity 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, for a pulse neural network, a Poisson distribution expected to be n is generally adopted to generate a random pulse sequence, although the Poisson distribution is in accordance with biological characteristics, the complexity is high, hardware implementation is not friendly, the pulse generation speed is low, and the power consumption efficiency is insufficient. The method also directly generates continuous n pulses, and then does not send any pulse, although the hardware efficiency is high, the generated sequences are alternate in density and not random enough, so that the conformity with biological characteristics is low, and the performance of the pulse neural network is influenced to a certain extent.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method and an apparatus for converting numerical values into pulses, which can generate random pulse sequences with high conformity of biological characteristics and low cost.
The invention provides a value-to-pulse method, which is used for converting an input value into a pulse sequence of a pulse neural network, and comprises the following steps:
determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to the input numerical values, 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 trains or continuous non-pulse trains in the current time period according to the time number n1 and the time number n2, and determining the time number n3 of the pulse sequence, wherein the time number n3 is greater than or equal to 0, and the data of the pulse sequence needs to be changed in the current time period;
and randomly changing data corresponding to n3 moments in the current time period in the pulse sequence according to the moment number n3 to form the target pulse sequence.
As a further improvement of the present invention, wherein, according to the time number n1 and the time number n2, a pulse sequence of consecutive pulse trains or consecutive non-pulse trains is formed in the current time period, and the time number n3 of the pulse sequence at which data change is required in the current time period is determined, the method comprises:
if the time number n1 is greater than or equal to the time number n2, generating a pulse for each time in the current time period to form a pulse sequence of continuous pulse trains, and determining the time number n 3-n 2 of the pulse sequence at which data needs to be changed in the current time period.
As a further improvement of the present invention, in which, according to the time number n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence, includes:
randomly generating a moment t at which data needs to be changed in the pulse sequence every time, deleting the pulse corresponding to the moment t in the pulse sequence, and traversing n3 moments until the data corresponding to n3 moments in the current time period in the pulse sequence are deleted to form the target pulse sequence.
As a further improvement of the present invention, wherein, according to the time number n1 and the time number n2, a pulse sequence of consecutive pulse trains or consecutive non-pulse trains is formed in the current time period, and the time number n3 of the pulse sequence at which data change is required in the current time period is determined, the method comprises:
if the time number n1 is less than the time number n2, no pulse is generated at each time in the current time period, a pulse sequence of continuous non-pulse trains is formed, and the time number n3 which is n1 of the pulse sequence and needs to change data in the current time period is determined.
As a further improvement of the present invention, in which, according to the time number n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form the target pulse sequence, includes:
randomly generating a time t at which data needs to be changed in the pulse sequence every time, sending pulses to the time t in the pulse sequence, and traversing n3 times until the pulses are sent to n3 times in the current time period in the pulse sequence, so as to form the target pulse sequence.
The invention also provides a value-to-pulse apparatus for converting an input value to a pulse train of a pulsed neural network, the apparatus comprising:
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 number n1 at which pulses are generated and a time number n2 at which pulses are not generated according to 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;
a random number generator for randomly generating n3 times at which data needs to be changed in the pulse sequence storage area according to the number of times n3 at which data needs to be changed in the current time period in the pulse sequence storage area, wherein n3 is greater than or equal to 0;
and the control logic is used for changing the data corresponding to the 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, the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by a number of times n1 at which pulses are generated and a number of times n2 at which pulses are not generated within a time period according to the target pulse sequence to be generated, and includes:
determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to input numerical values;
if the time number n1 is greater than or equal to the time number n2, writing a value c into each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous pulse trains, wherein c is 1;
if the time number n1 is less than the time number n2, writing a c value into the pulse sequence storage area at each time in the current time period to form a pulse sequence of continuous non-pulse trains, wherein c is 0.
As a further improvement of the present invention, if the time number n1 is greater than or equal to the time number n2, and c is 1, the time number n3 is n2 for the time period in which data change is required in the pulse sequence storage area;
if the time number n1 is less than the time number n2, and c is 0, the time number n3 of the time period needing to change data in the current time period in the pulse sequence storage area is determined to be n 1.
As a further improvement of the present invention, wherein the random number generator is configured to randomly generate one time t at which the data needs to be changed in the pulse sequence storage area at a time until n3 times at which the data needs to be changed in the pulse sequence storage area are generated.
As a further improvement of the present invention, the modifying, by the control logic, data corresponding to n3 time instants in the current time period in the pulse sequence storage area includes:
and the control logic writes the time t in the current time period in the pulse sequence storage area into a 1-c value every time, and traverses n3 time t until n3 time in the current time period in the pulse sequence storage area are respectively written into 1-c values, wherein 1-c is 0 or 1.
As a further improvement of the present invention, wherein the control logic writes the time t in the current time period in the pulse sequence storage area with 1-c values each time, includes:
if the time number n1 is greater than or equal to the time number n2, the control logic writes 0 at each time at the time t in the current time period in the pulse sequence storage area;
if the time number n1 is smaller than the time number n2, the control logic writes 1 at each time the time t in the current time period in the pulse sequence storage area.
As a further improvement of the present invention, wherein the apparatus further comprises:
and the cycle control counter is used for counting the number of data changed by the control logic, and when the control logic changes one piece of data, the cycle control counter decrements by 1 and repeats the cycle until the control logic finishes changing the data corresponding to n3 times in the current time period in the pulse sequence storage area.
As a further improvement of the present invention, wherein the loop control counter includes:
the judging device is used for judging the data of the pulse sequence storage area in the current time period;
a down counter for storing the time number n3 of the data to be changed, wherein the down counter decrements the time number of the data to be changed by 1 after the c judger judges that the pulse sequence storage area is written with the full c value and the control logic writes 1-c values into one time in the current time period in the pulse sequence storage area;
and the return-to-0 judger is used for judging whether the down counter returns to 0 or not.
As a further development of the invention, wherein the random number generator employs a linear feedback shift register structure.
The invention also provides an electronic device comprising a memory and a processor, the memory storing one or more computer instructions, 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, on which a computer program is stored, characterized in that the computer program is executed by a processor to implement the method.
The invention has the beneficial effects that:
the method can be adapted to a short time period, and is beneficial to reducing the number of time moments in a calculation time domain, thereby reducing the calculation amount;
the generated pulse sequence is random and uniform in density, and the conformity of biological characteristics is improved;
the complexity of the hardware is reduced, the hardware resource is saved, and the efficiency of the hardware is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without undue inventive faculty.
FIG. 1 is a schematic flow chart illustrating a method for converting a value to a pulse according to an exemplary embodiment of the present disclosure;
fig. 2 is a schematic diagram of an apparatus for converting a value into a pulse according to an exemplary embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It should be noted that, if directional indications (such as up, down, left, right, front, and back … …) are involved in the disclosed embodiment, the directional indications are only used to explain the relative position relationship between the components, the motion situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indications are changed accordingly.
In addition, in the description of the present disclosure, the terms used are for illustrative purposes only and are 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 to describe various elements, not necessarily order, and not necessarily limit the elements. In addition, in the description of the present disclosure, "a plurality" means two or more unless otherwise specified. These terms are only used to distinguish one element from another. These and/or other aspects will become apparent to those of ordinary skill in the art in view of the following drawings, and the description of the embodiments of the disclosure will be more readily understood by those of ordinary skill in the art. The drawings are only for purposes of illustrating the described embodiments of the disclosure. One 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 described in the present disclosure.
A method for converting a value into a pulse sequence of a pulse neural network according to an embodiment of the present disclosure is shown in fig. 1, and includes:
determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to the input numerical values, 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 the pulse neural network in a time period;
forming a pulse sequence of continuous pulse trains or continuous non-pulse trains in the current time period according to the time number n1 and the time number n2, and determining the time number n3 of the pulse sequence, wherein the time number n3 is greater than or equal to 0, and the data of the pulse sequence needs to be changed in the current time period;
and randomly changing data corresponding to n3 moments in the current time period in the pulse sequence according to the moment number n3 to form a target pulse sequence.
The input value may be, for example, a pixel value of an image, a value of a voice waveform conversion, a value of a text conversion, a calculation result after image preprocessing, or the like. The present disclosure does not specifically limit the input numerical value. The n3 times at which data needs to be changed are different times.
The impulse neural network is a network with time dimension encoded 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, and the pulse information at each time is a binary variable, i.e., whether there is a pulse or not. For example, one period contains R times. R-n 1+ n2, where n1 are pulsed and n2 are non-pulsed, and the pulses are positioned at times as randomly as possible within this time period. The data that needs to be altered may be pulsed (e.g., a value of 1) or non-pulsed (e.g., a value of 0).
The total number n1 of pulses of the target pulse sequence to be generated is in positive correlation with the input numerical value, the target pulse sequence is a time-dimension random pulse sequence, and each input numerical value is converted into a time-dimension random target pulse sequence.
In an alternative embodiment, forming a pulse sequence of consecutive bursts or consecutive non-bursts in the current time period according to the time instant number n1 and the time instant number n2, and determining the time instant number n3 of the pulse sequence at which data needs to be changed in the current time period includes:
if the time number n1 is greater than or equal to the time number n2, a pulse is generated at each time in the current time period to form a pulse sequence of continuous pulse trains, and the time number n3 which is equal to n2 of the data needing to be changed in the current time period in the pulse sequence is determined.
In another optional embodiment, according to the time number n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form a target pulse sequence, including:
randomly generating a moment t at which data needs to be changed in the pulse sequence every time, deleting data corresponding to the moment t in the pulse sequence, and traversing n3 moments until the data corresponding to n3 moments in the current time period in the pulse sequence are deleted to form a target pulse sequence. When the pulse sequence is a continuous pulse train, the data to be changed is a pulse (for example, a value of 1).
In an alternative embodiment, a pulse sequence of consecutive pulse trains or consecutive non-pulse trains is formed in the current time period according to the time instant number n1 and the time instant number n2, and the time instant number n3 of the pulse sequence at which data needs to be changed in the current time period is determined, which includes:
if the time number n1 is less than the time number n2, no pulse is generated at each time in the current time period, a pulse sequence of continuous non-pulse trains is formed, and the time number n3 which is the time number n1 of the pulse sequence, wherein the data needs to be changed in the current time period, is determined.
In another optional embodiment, according to the time number n3, randomly changing data corresponding to n3 times in the current time period in the pulse sequence to form a target pulse sequence, including:
randomly generating a moment t at which data needs to be changed in the pulse sequence every time, sending pulses to the moment t in the pulse sequence, and traversing n3 moments until the pulses are sent to n3 moments in the current time period in the pulse sequence to form a target pulse sequence. When the pulse sequence is a continuous non-pulse train, the data to be changed is a non-pulse (e.g., a value of 0).
The method disclosed by the disclosure is applied to a pulse neural network, and a time period comprises a plurality of time instants, wherein each time instant position can be 1 (pulse) or 0 (non-pulse), and all the time instants in the time period form a target pulse sequence. For example, the total number of times in a time period is R, where n1+ n2 has pulses at n1 times, n2 times has no pulses, and the time positions of the pulses in the time period are as random as possible. The number of the time numbers n1 and n2 can be judged in advance according to the input numerical value, if the time number n1 is greater than or equal to the time number n2, all the time points of the current time period can be firstly set to 1 (namely, pulses are generated), and then the pulses corresponding to n2 time points in the current time period can be randomly deleted; if the number of times n2 is greater than the number of times n1, all the times may be set to 0 (i.e., no pulse is generated) first, and then n1 of the times may be randomly pulsed.
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 time-domain moments is reduced, and the calculation amount is reduced; on the other hand, by randomly changing part of pulses, the generated pulse sequence is random and uniform in density, and the conformity of biological characteristics can be improved.
The apparatus for converting a value into a pulse according to an embodiment of the present disclosure is configured to convert an input value into a pulse sequence of a pulse neural network, as shown in fig. 2, and includes:
the pulse sequence storage area is used for storing pulse sequences, wherein the pulse sequences are continuous pulse trains or continuous non-pulse trains formed by the number n1 of the time instants when the pulses are generated and the number n2 of the time instants when the pulses are not generated according to the target pulse sequence to be generated, 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 the pulse neural network in a time period;
a random number generator for randomly generating n3 times at which data needs to be changed in the pulse sequence storage area, according to the number of times n3 at which data needs to be changed in the current time period in the pulse sequence storage area, wherein n3 is greater than or equal to 0;
and the control logic is used for changing the data corresponding to the 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 encoded 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, and the pulse information at each time is a binary variable, i.e., whether there is a pulse or not. For example, one period contains R times. R-n 1+ n2, where n1 are pulsed and n2 are non-pulsed, and the pulses are positioned at times as randomly as possible within this time period.
The total number n1 of pulses of the target pulse sequence to be generated is in positive correlation with the input numerical value, the target pulse sequence is a time dimension random pulse sequence, and each input numerical value is converted into a time dimension random target pulse sequence.
In an alternative embodiment, the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by the number of times n1 when pulses are generated and the number of times n2 when no pulses are generated according to the target pulse sequence, comprising:
determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to the input numerical value;
if the time number n1 is greater than or equal to the time number n2, writing a value c into each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous pulse trains, wherein c is 1;
and if the time number n1 is less than the time number n2, writing a c value into the pulse sequence storage area at each time in the current time period to form a pulse sequence of continuous non-pulse trains, wherein c is 0.
Where c-1 indicates that a pulse is generated for each time in the current time period, and c-0 indicates that no pulse is generated for each time in the current time period.
The input value may be, for example, a pixel value of an image, a value of a voice waveform conversion, a value of a text conversion, a calculation result after image preprocessing, or the like. The present disclosure does not specifically limit the input numerical value.
In another alternative embodiment, if the time number n1 is greater than or equal to the time number n2, and c is 1, the time number n3 of the time period in which the data needs to be changed in the pulse sequence storage area is determined to be n 2; if the time number n1 is less than the time number n2, and c is 0, the time number n3 of the time period required to change data in the current time period in the pulse sequence storage area is determined to be n 1.
In an alternative embodiment, the random number generator is adapted to randomly generate the data-requiring changes in the pulse train storage area one time t at a time until n3 times the data-requiring changes in the pulse train storage area have been generated.
In an alternative embodiment, the random number generator employs a Linear Feedback Shift Register (LFSR) architecture, which may reduce hardware power consumption.
In an alternative embodiment, the control logic changes the data corresponding to n3 moments in the current time period in the pulse sequence storage area, and includes:
and the control logic writes the time t in the current time period in the pulse sequence storage area into a 1-c value every time, and traverses n3 time t until n3 time in the current time period in the pulse sequence storage area are respectively written into 1-c values, wherein 1-c is 0 or 1.
In another alternative embodiment, the writing of the control logic to the values 1-c at each time instant t in the current time period in the pulse sequence storage area comprises:
if the time number n1 is greater than or equal to the time number n2, the control logic writes the time t in the current time period in the pulse sequence storage area into 0 each time, namely deletes the pulse corresponding to the time t in the current time period in the pulse sequence storage area;
if the time number n1 is smaller than the time number n2, the control logic writes 1 to 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 apparatus of the present disclosure may determine the number of the time numbers n1 and n2 in advance from the input value, and write the value of c to each time within the current period in the pulse sequence storage area according to the number of the time numbers n1 and n 2. If the time number n1 is greater than or equal to the time number n2, 1 may be written first (i.e., a pulse is generated) at all times of the current time interval in the pulse sequence storage area, and then the control logic writes 0 to n3 of the times, i.e., deletes the pulses corresponding to n3 of the times; if the number of times n2 is greater than the number of times n1, all the times of the current period in the pulse sequence storage area may be written first with 0 (i.e., no pulse is generated), and then the control logic writes 1 to n3 of the times, i.e., pulses are issued to n3 of the times.
In another alternative embodiment, the apparatus further comprises: and the cycle control counter is used for counting the number of data changed by the control logic, and the cycle control counter is decremented by 1 when the control logic changes one data until the control logic finishes changing the data corresponding to n3 times in the current time period in the pulse sequence storage area.
The control logic is responsible for checking whether the data at the moment t is changed or not by generating a random number t, namely the moment position of the data to be changed, each time through the random number generator, 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 determined to be not changed; if the time t is not changed, the control logic informs the random number generator to regenerate the random number t after changing the data corresponding to the time t, informs the cycle control counter to subtract 1 from the number of the data needing to be changed and repeats the cycle process until the number of the data needing to be changed is equal to 0, ends the change process and outputs the result.
In an alternative embodiment, the loop control counter comprises:
the 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 number n3 of the data to be changed, and the down counter decrements 1 to the time number of the data to be changed after judging that the full c value is written in the pulse sequence storage area by the c judger and writing 1-c values in the control logic to one time in the current time period in the pulse sequence storage area;
and the return-to-0 judger is used for judging whether the down counter returns to 0 or not.
As shown in fig. 2, the device of the present disclosure can have three states:
state 1, load state:
and traversing all addresses (all time in each time period) by using a write address line, writing the full c value into the pulse sequence storage area, and writing the number n3 to be changed into a 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, the judgment of the judger c is carried out, if the address is c, the down counter is informed to decrement by 1, the write enable is opened, 1-c values are written into the address position of the pulse sequence storage area, meanwhile, whether the count-down value is returned to 0 is judged, if the count-down value is returned 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 new addresses and circulates.
State 3, output state:
and reading the address line to traverse all the addresses and outputting the data in the pulse sequence storage area.
On one hand, 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 adaptive to a short time period, and contribute to reducing the number of time-domain moments for calculation, thereby reducing the operation amount; on the other hand, by randomly changing part of pulses, the generated pulse sequence is random and uniform in density, and the conformity of biological characteristics can be improved.
The disclosure also relates to an electronic device comprising 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 communicatively coupled to 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, and the instructions are executed by the at least one processor to implement the method for converting a value into a pulse in the above embodiments.
In an alternative embodiment, the memory is used as a non-volatile computer-readable storage medium for storing 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 converting numerical values into pulses, by executing nonvolatile software programs, instructions, and modules stored in the memory.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, 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 located remotely from the processor, and such remote memory may be connected to the external device via 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 the memory and, when executed by the one or more processors, perform the method of numeric conversion pulsing in any of the method embodiments described above.
The above-mentioned product can execute the method for converting numerical value into pulse provided by the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
The present disclosure also relates to a computer-readable storage medium for storing a computer-readable program for causing a computer to perform some or all of the above-described method embodiments.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description provided herein, numerous specific details are set forth. It is understood, however, 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, those of ordinary skill in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, 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 present 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 (16)

1. A method of value-to-pulse conversion, the method for converting an input value to a pulse train of a pulsed neural network, the method comprising:
determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to the input numerical values, 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 trains or continuous non-pulse trains in the current time period according to the time number n1 and the time number n2, and determining the time number n3 of the pulse sequence, wherein the time number n3 is greater than or equal to 0, and the data of the pulse sequence needs to be changed in the current time period;
and randomly changing data corresponding to n3 moments in the current time period in the pulse sequence according to the moment number n3 to form the target pulse sequence.
2. The method of claim 1, wherein forming a pulse sequence of consecutive bursts or consecutive non-bursts within a current time period according to the number of time instants n1 and the number of time instants n2, and determining the number of time instants n3 within the pulse sequence at which data needs to be changed within the current time period comprises:
if the time number n1 is greater than or equal to the time number n2, generating a pulse for each time in the current time period to form a pulse sequence of continuous pulse trains, and determining the time number n 3-n 2 of the pulse sequence at which data needs to be changed in the current time period.
3. The method of claim 2, wherein randomly modifying the data corresponding to n3 time instants within the current time period in the pulse sequence according to the time instant number n3 to form the target pulse sequence comprises:
randomly generating a moment t at which data needs to be changed in the pulse sequence every time, deleting the pulse corresponding to the moment t in the pulse sequence, and traversing n3 moments until n3 pulses corresponding to the current time period in the pulse sequence are deleted to form the target pulse sequence.
4. The method of claim 1, wherein forming a pulse sequence of consecutive bursts or consecutive non-bursts within a current time period according to the number of time instants n1 and the number of time instants n2, and determining the number of time instants n3 within the pulse sequence at which data needs to be changed within the current time period comprises:
if the time number n1 is less than the time number n2, no pulse is generated at each time in the current time period, a pulse sequence of continuous non-pulse trains is formed, and the time number n3 which is n1 of the pulse sequence and needs to change data in the current time period is determined.
5. The method of claim 4, wherein randomly modifying the data corresponding to n3 time instants within the current time period in the pulse sequence according to the time instant number n3 to form the target pulse sequence comprises:
randomly generating a time t at which data needs to be changed in the pulse sequence every time, sending pulses to the time t in the pulse sequence, and traversing n3 times until the pulses are sent to n3 times in the current time period in the pulse sequence, so as to form the target pulse sequence.
6. An apparatus for converting a value to a pulse, the apparatus being configured to convert an input value to a pulse train of a spiking neural network, the apparatus comprising:
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 number n1 at which pulses are generated and a time number n2 at which pulses are not generated according to 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;
a random number generator for randomly generating n3 times at which data needs to be changed in the pulse sequence storage area according to the number of times n3 at which data needs to be changed in the current time period in the pulse sequence storage area, wherein n3 is greater than or equal to 0;
and the control logic is used for changing the data corresponding to the n3 moments in the current time period in the pulse sequence storage area to form the target pulse sequence.
7. The apparatus of claim 6, wherein the pulse sequence is a continuous pulse train or a continuous non-pulse train formed by a number of times n1 when pulses are generated and a number of times n2 when no pulses are generated according to the target pulse sequence to be generated, comprising:
determining the number of times n1 when the target pulse sequence to be generated generates pulses and the number of times n2 when the target pulse sequence to be generated does not generate pulses according to input numerical values;
if the time number n1 is greater than or equal to the time number n2, writing a value c into each time in the current time period in the pulse sequence storage area to form a pulse sequence of continuous pulse trains, wherein c is 1;
if the time number n1 is less than the time number n2, writing a c value into the pulse sequence storage area at each time in the current time period to form a pulse sequence of continuous non-pulse trains, wherein c is 0.
8. The apparatus according to claim 7, wherein if the time number n1 is greater than or equal to the time number n2, c is 1, the time number n3 is n2 for which data change is required in the current time period in the pulse sequence storage area;
if the time number n1 is less than the time number n2, and c is 0, the time number n3 of the time period needing to change data in the current time period in the pulse sequence storage area is determined to be n 1.
9. The apparatus of claim 6 wherein said random number generator is operative to randomly generate a time t at which data needs to be changed in said pulse sequence storage area at a time until n3 times at which data needs to be changed in said pulse sequence storage area have been generated.
10. The apparatus of claim 9, wherein the control logic modifies the data corresponding to n3 time instants in the current time period in the pulse sequence storage area comprising:
and the control logic writes the time t in the current time period in the pulse sequence storage area into a 1-c value every time, and traverses n3 time t until n3 time in the current time period in the pulse sequence storage area are respectively written into 1-c values, wherein 1-c is 0 or 1.
11. The apparatus of claim 10, wherein the control logic writes a 1-c value at a time t in the pulse sequence storage area within a current time period, comprising:
if the time number n1 is greater than or equal to the time number n2, the control logic writes 0 at each time at the time t in the current time period in the pulse sequence storage area;
if the time number n1 is smaller than the time number n2, the control logic writes 1 at each time the time t in the current time period in the pulse sequence storage area.
12. The apparatus of claim 6, wherein the apparatus further comprises:
and the cycle control counter is used for counting the number of data changed by the control logic, and when the control logic changes one piece of data, the cycle control counter decrements by 1 and repeats the cycle until the control logic finishes changing the data corresponding to n3 times in the current time period in the pulse sequence storage area.
13. The apparatus of claim 12, wherein the loop control counter comprises:
the judging device is used for judging the data of the pulse sequence storage area in the current time period;
a down counter for storing the time number n3 of the data to be changed, wherein the down counter decrements the time number of the data to be changed by 1 after the c judger judges that the pulse sequence storage area is written with the full c value and the control logic writes 1-c values into one time in the current time period in the pulse sequence storage area;
and the return-to-0 judger is used for judging whether the down counter returns to 0 or not.
14. The apparatus of claim 6 wherein said random number generator employs a linear feedback shift register structure.
15. 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-5.
16. A computer-readable storage medium, on which a computer program is stored, the computer program being executable by a processor for implementing the method according to any of claims 1-5.
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 true CN111860786A (en) 2020-10-30
CN111860786B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022017498A1 (en) * 2020-07-24 2022-01-27 北京灵汐科技有限公司 Method and apparatus for converting numerical values to spikes, electronic device, and storage medium
CN114466153A (en) * 2022-04-13 2022-05-10 深圳时识科技有限公司 Self-adaptive pulse generation method and device, brain-like chip and electronic equipment
CN114495178A (en) * 2022-04-14 2022-05-13 深圳时识科技有限公司 Pulse sequence randomization 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
杨静;赵欣;徐彦;姜赢;: "基于梯度下降的脉冲神经元精确序列学习算法", 计算机工程与应用, no. 23 *
蔡荣太;吴庆祥;: "基于脉冲神经网络的边缘检测", 微电子学与计算机, no. 10 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022017498A1 (en) * 2020-07-24 2022-01-27 北京灵汐科技有限公司 Method and apparatus for converting numerical values to spikes, electronic device, and storage medium
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
CN114466153A (en) * 2022-04-13 2022-05-10 深圳时识科技有限公司 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
CN114495178A (en) * 2022-04-14 2022-05-13 深圳时识科技有限公司 Pulse sequence randomization method and device, brain-like chip and electronic equipment
CN114495178B (en) * 2022-04-14 2022-06-21 深圳时识科技有限公司 Pulse sequence randomization method and device, brain-like chip and electronic equipment

Also Published As

Publication number Publication date
CN111860786B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN111860786A (en) Method and device for converting numerical value into pulse
CN111898737B (en) Method and device for converting image into pulse
Feng et al. Symbolic generalization for on-line planning
CN108834086A (en) Method, apparatus, computer equipment and the storage medium that short message is sent
CN105487987B (en) A kind of concurrent sequence of processing reads the method and device of IO
Meyer et al. Specification and construction of performability models
CN107589411A (en) A kind of fast multi-target signal synthesis method
CN107589410A (en) One kind is without breakpoint Multiple Target Signals synthetic method
Halbach et al. Optimal 6-state algorithms for the behavior of several moving creatures
WO2014108734A1 (en) Method and control device for launch-off-shift at-speed scan testing
US11783166B2 (en) Method and apparatus for converting numerical values into spikes, electronic device and storage medium
CN109716301A (en) For monitoring the monitor of processor
CN115629371A (en) Transmission delay control method, device, controller, chip and ultrasonic system
KR101003121B1 (en) Refresh Circuit of Semiconductor Memory Apparatus
CN111640012A (en) Block chain transaction tracing method and device
US7246251B2 (en) Adaptive data processing scheme based on delay forecast
CN107391440A (en) A kind of processing unit and method of fast fourier transform algorithm output data
CN108414988B (en) Digital delay method and device based on FPGA
CN208285339U (en) A kind of inverting equipment and electronic equipment
CN112379858A (en) Method and device for generating random number, electronic equipment and readable storage medium
CN110053253A (en) The optimization method and device in vibration mirror scanning path
KR100278429B1 (en) Micro computer with pulse output function
Stagge et al. Organisation of past states in recurrent neural networks: Implicit embedding
CN114861176A (en) Countermeasure method and system based on intelligent analysis
CN114242138B (en) Time delay controller, memory controller and time delay control method

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