WO2017142670A1 - Technologies for shifted neural networks - Google Patents
Technologies for shifted neural networks Download PDFInfo
- Publication number
- WO2017142670A1 WO2017142670A1 PCT/US2017/014101 US2017014101W WO2017142670A1 WO 2017142670 A1 WO2017142670 A1 WO 2017142670A1 US 2017014101 W US2017014101 W US 2017014101W WO 2017142670 A1 WO2017142670 A1 WO 2017142670A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- shift
- activation function
- compute device
- neural network
- transcendental
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0495—Quantised networks; Sparse networks; Compressed networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0499—Feedforward networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/09—Supervised learning
Definitions
- pattern recognition generally involves machine learning to recognize patterns in data by virtue, for example, of data regularities and/or irregularities.
- a pattern recognition system may be "trained" to properly identify patterns by using training data that has pre-identified the relevant classes of the data points and/or may be used to recognize patterns in a previously unclassified set of data.
- One of the most common techniques for pattern recognition involves the use of Artificial Neural Networks (ANN), or simply neural networks, which were initially modeled after biological neural systems. Artificial Neural Networks are capable of learning and solving highly non-linear pattern recognition problems.
- ANN Artificial Neural Networks
- neural networks typically involve the use of transcendental functions (e.g., sigmoid functions, hyperbolic tangent functions, etc.) and/or memory-intensive algorithms. Accordingly, the use of neural networks for pattern recognition is often limited or non-existent with wearable computing devices, low-power devices, and/or other hardware-limited devices (e.g., devices without a dedicated acceleration unit suitable for pattern recognition).
- transcendental functions e.g., sigmoid functions, hyperbolic tangent functions, etc.
- FIG. 1 is a simplified block diagram of at least one embodiment of a compute device for using a shifted neural network
- FIG. 2 is a simplified block diagram of at least one embodiment of an environment of a compute device of FIG. 1;
- FIG. 3 is a simplified flow diagram of at least one embodiment of a method for using a shifted neural network that may be executed by the compute device of FIG. 1;
- FIG. 4 is a simplified flow diagram of at least one embodiment of a method of determining a shift-based activation function for the shifted neural network;
- FIG. 5 is a simplified graph illustrating the determination of a piecewise linear approximation of a transcendental activation function for the shifted neural network.
- references in the specification to "one embodiment,” “an embodiment,” “an illustrative embodiment,” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may or may not necessarily include that particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
- items included in a list in the form of "at least one A, B, and C” can mean (A); (B); (C): (A and B); (B and C); (A and C); or (A, B, and C).
- items listed in the form of "at least one of A, B, or C” can mean (A); (B); (C): (A and B); (B and C); (A and C); or (A, B, and C).
- the disclosed embodiments may be implemented, in some cases, in hardware, firmware, software, or any combination thereof.
- the disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage medium, which may be read and executed by one or more processors.
- a machine-readable storage medium may be embodied as any storage device, mechanism, or other physical structure for storing or transmitting information in a form readable by a machine (e.g., a volatile or non-volatile memory, a media disc, or other media device).
- the compute device 100 utilizes a shifted neural network for machine learning, pattern recognition, and/or other suitable purposes.
- the shifted neural network eliminates the use of double precision floating point units in neural network calculations, eliminates the use of transcendental functions, eliminates the need for multiplication operations in the feed-forward layers of a typical neural network, avoids input pattern normalization, and/or reduces the memory footprint of the neural network relative to typical neural networks.
- hardware for floating-point operations and/or multiplication may not be included in the circuitry for shifted neural network computations.
- the processor 110 of the compute device 100 may consume less power and/or process the neural network computations more quickly with the shifted neural network described herein.
- the compute device 100 determines a shift-based activation function of the shifted neural network (e.g., a piecewise linear approximation of transcendental activation function) and stores the shifted neural network weights as bitwise shifts (e.g., as four bit values) of the input values.
- the compute device 100 may train the shifted neural network based on the shift-based input weights and the shift-based activation function and/or apply the shifted neural network (e.g., for pattern recognition).
- the shifted neural network techniques are described herein as being performed by the same compute device 100, it should be appreciated that one or more of the techniques may be performed by various compute devices 100 in other embodiments.
- one compute device 100 may determine the shift-based activation function and train the shifted neural network, whereas another compute device 100 may apply the shifted neural network (e.g., a wearable computing device).
- the compute device 100 may be embodied as any type of computing device capable of performing the functions described herein.
- the compute device 100 may be embodied as a wearable computing device, smartphone, cellular phone, personal digital assistant, mobile Internet device, tablet computer, netbook, notebook, UltrabookTM, laptop computer, desktop computer, server, and/or any other mobile computing/communication device.
- the compute device 100 is embodied as a wearable computing device or other mobile computing device having relatively limited hardware resources.
- the illustrative compute device 100 includes a processor 110, an input/output ("I/O") subsystem 112, a memory 114, a data storage 116, a communication circuitry 118, and one or more peripheral devices 120.
- I/O input/output
- the compute device 100 may include a shifted neural network circuitry 122.
- the compute device 100 may include other or additional components, such as those commonly found in a typical computing device (e.g., various input/output devices and/or other components), in other embodiments.
- one or more of the illustrative components may be incorporated in, or otherwise form a portion of, another component.
- the memory 114, or portions thereof, may be incorporated in the processor 110 in some embodiments.
- the processor 110 may be embodied as any type of processor capable of performing the functions described herein.
- the processor 110 may be embodied as a single or multi-core processor(s), digital signal processor, microcontroller, or other processor or processing/controlling circuit.
- the memory 114 may be embodied as any type of volatile or non-volatile memory or data storage capable of performing the functions described herein. In operation, the memory 114 may store various data and software used during operation of the compute device 100 such as operating systems, applications, programs, libraries, and drivers.
- the memory 114 is communicatively coupled to the processor 110 via the I/O subsystem 112, which may be embodied as circuitry and/or components to facilitate input/output operations with the processor 110, the memory 114, and other components of the compute device 100.
- the I/O subsystem 112 may be embodied as, or otherwise include, memory controller hubs, input/output control hubs, firmware devices, communication links (i.e., point-to-point links, bus links, wires, cables, light guides, printed circuit board traces, etc.) and/or other components and subsystems to facilitate the input/output operations.
- the I/O subsystem 112 may form a portion of a system-on-a-chip (SoC) and be incorporated, along with the processor 110, the memory 114, and other components of the compute device 100, on a single integrated circuit chip.
- SoC system-on-a-chip
- the data storage 116 may be embodied as any type of device or devices configured for short-term or long-term storage of data such as, for example, memory devices and circuits, memory cards, hard disk drives, solid-state drives, or other data storage devices.
- the data storage 116 and/or the memory 114 may store various data during operation of the compute device 100 as described herein.
- the communication circuitry 118 may be embodied as any communication circuit, device, or collection thereof, capable of enabling communications between the compute device 100 and other devices over a network.
- the communication circuitry 118 may be configured to use any one or more communication technologies (e.g., wireless or wired communications) and associated protocols (e.g., Ethernet, Bluetooth ® , Wi-Fi ® , WiMAX, LTE, 5G, etc.) to effect such communication.
- technologies e.g., wireless or wired communications
- protocols e.g., Ethernet, Bluetooth ® , Wi-Fi ® , WiMAX, LTE, 5G, etc.
- the peripheral devices 120 may include any number of additional peripheral or interface devices, such as speakers, microphones, additional storage devices, and so forth.
- the particular devices included in the peripheral devices 120 may depend on, for example, the type and/or intended use of the compute device 100.
- the compute device 100 may include a shifted neural network circuitry 122 configured to perform one or more functions related to the shifted neural network (e.g., pattern recognition).
- the shifted neural network circuitry 122 may include various circuit elements/components to perform operations for the shifted neural network (e.g., multiplexers, summers, bit shifters, etc.). Such components may, for example, be discrete and/or embedded on an integrated circuit depending on the particular embodiment. Further, in some embodiments, floating-point circuitry and/or multiplication circuit components may be omitted from the shifted neural network circuitry 122.
- the compute device 100 establishes an environment for using a shifted neural network.
- the illustrative environment 200 includes a data handling module 202, a linear approximation module 204, a training module 206, a pattern recognition module 208, and a communication module 210.
- the various modules of the environment 200 may be embodied as hardware, software, firmware, or a combination thereof.
- the various modules, logic, and other components of the environment 200 may form a portion of, or otherwise be established by, the processor 110 or other hardware components of the compute device 100.
- one or more of the modules of the environment 200 may be embodied as circuitry or collection of electrical devices (e.g., a data handling circuitry, a linear approximation circuitry, a training circuitry, a pattern recognition circuitry, and/or a communication circuitry). Additionally, in some embodiments, one or more of the illustrative modules may form a portion of another module and/or one or more of the illustrative modules may be independent of one another.
- electrical devices e.g., a data handling circuitry, a linear approximation circuitry, a training circuitry, a pattern recognition circuitry, and/or a communication circuitry.
- one or more of the illustrative modules may form a portion of another module and/or one or more of the illustrative modules may be independent of one another.
- the data handling module 202 is configured to identify, receive, and/or retrieve input values by which to train the shifted neural network and/or to which to apply the shifted neural network. For example, in some embodiments, the data handling module 202 may identify/retrieve a set of predefined image patterns for recognition (e.g., Mixed National Institute of Standards and Technology (MNIST) database or other image patterns approved by a standards body). Further, the data handling module 202 may identify and/or retrieve the set of shift-based input weights for each neuron of the shifted neural network at a given point in time.
- MNIST Mixed National Institute of Standards and Technology
- the weights may be stored as four bits in memory (e.g., in a four-bit memory region) such that three of the bits are indicative of an amount of bitwise shift of the corresponding weight and the other bit is indicative of a sign of the weight.
- each of the weights is essentially a power of two (i.e., may be expressed as 2" for some integer n) if multiplication were to be used instead of a bitwise shift operation.
- the linear approximation module 204 is configured to determine a shift-based activation function of the shifted neural network.
- the shift-based activation function is a piecewise linear approximation of a transcendental activation function (see FIG. 5) and is defined by a plurality of line segments such that the slope of each line segment is a power of two.
- the slopes may be stored and/or calculated as bitwise shifts.
- the transcendental functions may be embodied, for example, as a sigmoid function or a hyberbolic tangent function depending on the desired operating range.
- the shift-based activation function may be determined based on k-means clustering.
- the training module 206 is configured to train the shifted neural network based on the shift-based input weights and the determined shift-based activation function. It should be appreciated that the training module 206 may utilize any suitable techniques, algorithms, and/or mechanisms for training the shifted neural network. For example, in some embodiments, the training module 206 may utilize many neurons and variations in the shift- based weights iteratively in order to distinguish/label various classes of data. Depending on the particular embodiment, the training module 206 may utilize supervised and/or unsupervised training techniques.
- the pattern recognition module 208 is configured to apply the shifted neural network to various inputs for pattern recognition.
- the pattern recognition module 208 may apply the trained shifted neural network to a set of unclassified input data points in order to determine the corresponding classes of those data points.
- various techniques described herein may be employed on different devices. For example, one compute device 100 may perform the training of the shifted neural network and another compute device 100 may apply the shifted neural network (e.g., for pattern recognition).
- the communication module 210 handles the communication between the compute device 100 and other computing devices.
- the compute device 100 may transmit the shift-based activation function, shift-based weights, and/or other data associated with the shifted neural network to another compute device 100.
- the compute device 100 may execute a method
- the illustrative method 300 begins with block 302 in which the compute device 100 identifies, receives, and/or retrieves a set of input values by which to train the shifted neural network and/or to which to apply the shifted neural network.
- the compute device 100 may identify/receive one or more image patterns such as MNIST patterns.
- image patterns such as MNIST patterns.
- the input values are often normalized
- the compute device 100 determines a shift-based activation function of the shifted neural network.
- the compute device 100 determines a piecewise linear approximation of a transcendental activation function such that the piecewise linear approximation is defined by a set of line segments, each having a slope that is a power of two (and therefore calculable by virtue of bitwise shift operations).
- the compute device 100 may generate a linear approximation of a sigmoid function in block 310 or generate a linear approximation of a hyperbolic tangent function in block 312 (see, for example, function 504 of FIG. 5).
- the compute device 100 may utilize another transcendental function suitable for the performance of the functions described herein in other embodiments.
- the compute device 100 may generate the linear approximation of the transcendental activation function based on k-means clustering. To do so, the compute device 100 may execute a method 400 of FIG. 4.
- the illustrative method 400 begins with block 402 in which the compute device 100 computes a slope value as a base- two logarithm of a tangent line (see, for example, tangent lines 502 of FIG. 5) of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function (see, for example, function 504 of FIG. 5).
- the compute device 100 associates each slope with the nearest cluster. In other words, the compute device 100 determines the "distance" of each slope value to each of the centroid values and associates the slope with the nearest cluster. More formally, the compute device 100 may determine a p - m (t) ⁇ p - m ⁇ (t)
- b i is an offset of the corresponding tangent line relative to the origin
- 5 ⁇ is a particular set/cluster
- ⁇ ' . is a corresponding slope of the function
- m i+1 is a mean of the corresponding cluster
- y . is the corresponding output value
- x j is the corresponding input value.
- VI ⁇ z ⁇ k - 1 may determine the piecewise linear approximation
- the compute device 100 trains the shifted neural network based on the relevant shift-based weights and the determined shift-based activation function.
- the compute device 100 may utilize any suitable techniques, algorithms, and/or mechanisms for training the shifted neural network.
- the compute device 100 may utilize many neurons and variations in the shift-based weights iteratively in order to distinguish/label various classes of data.
- the input values are multiplied by various weights and summed.
- each of the weights is indicative of an amount by which to perform a bitwise shift on the input value.
- the compute device 100 may utilize three bits to store the shift amount (e.g., 0, 1, 2, 3, 4, 5, 6, or 7) and one bit for the sign.
- An embodiment of the technologies may include any one or more, and any combination of, the examples described below.
- Example 2 includes the subject matter of Example 1, and further including a data handling module to identify a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
- Example 3 includes the subject matter of any of Examples 1 and 2, and wherein the set of input values comprises a set of predefined image patterns for recognition.
- Example 4 includes the subject matter of any of Examples 1-3, and wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
- Example 5 includes the subject matter of any of Examples 1-4, and wherein the transcendental activation function comprises a sigmoid function.
- Example 6 includes the subject matter of any of Examples 1-5, and wherein the transcendental activation function comprises a hyperbolic tangent function.
- Example 7 includes the subject matter of any of Examples 1-6, and wherein to determine the shift-based activation function comprises to determine the shift-based activation function based on k-means clustering.
- Example 8 includes the subject matter of any of Examples 1-7, and wherein to determine the shift-based activation function based on k-means clustering comprises to compute a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function; associate each slope value with a corresponding nearest cluster; and update a centroid associated with each cluster.
- Example 9 includes the subject matter of any of Examples 1-8, and wherein to determine the shift-based activation function based on k-means clustering further comprises to compute an offset of the tangent line relative to an origin.
- Example 10 includes the subject matter of any of Examples 1-9, and wherein to determine the shift-based activation function based on k-means clustering further comprises to compute intersections of the tangent lines in response to a determination that each centroid value is stable.
- Example 11 includes the subject matter of any of Examples 1-10, and wherein to determine the shift-based activation function comprises to generate the piecewise linear approximation according to
- x is an input value
- ⁇ is the scope value of the i tangent line
- b ⁇ is an offset of the i tangent line relative to the transcendental activation function
- r i is an intersection of two tangent lines
- » is a bitwise shift operator
- Example 12 includes the subject matter of any of Examples 1-11, and further including a pattern recognition module to apply the shifted neural network to an input for pattern recognition.
- Example 13 includes the subject matter of any of Examples 1-12, and wherein each corresponding slope is computed by a bitwise shift operation.
- Example 14 includes the subject matter of any of Examples 1-13, and wherein each of the input weights is stored in a four-bit memory region; and wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
- Example 15 includes a method for use of a shifted neural network, the method comprising determining, by a compute device, a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and training, by the compute device, the shifted neural network based on shift-based input weights and the determined shift-based activation function.
- Example 16 includes the subject matter of Example 15, and further including identifying, by the compute device, a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
- Example 17 includes the subject matter of any of Examples 15 and 16, and wherein the set of input values comprises a set of predefined image patterns for recognition.
- Example 18 includes the subject matter of any of Examples 15-17, and wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
- Example 19 includes the subject matter of any of Examples 15-18, and wherein the transcendental activation function comprises a sigmoid function.
- Example 20 includes the subject matter of any of Examples 15-19, and wherein the transcendental activation function comprises a hyperbolic tangent function.
- Example 21 includes the subject matter of any of Examples 15-20, and wherein determining the shift-based activation function comprises determining the shift-based activation function based on k-means clustering.
- Example 22 includes the subject matter of any of Examples 15-21, and wherein determining the shift-based activation function based on k-means clustering comprises computing a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function; associating each slope value with a corresponding nearest cluster; and updating a centroid associated with each cluster.
- Example 23 includes the subject matter of any of Examples 15-22, and wherein determining the shift-based activation function based on k-means clustering further comprises computing an offset of the tangent line relative to an origin.
- Example 24 includes the subject matter of any of Examples 15-23, and wherein determining the shift-based activation function based on k-means clustering further comprises computing intersections of the tangent lines in response to a determination that each centroid value is stable.
- Example 25 includes the subject matter of any of Examples 15-24, and wherein determining the shift-based activation function comprises generating the piecewise linear approximation according to
- x is an input value
- ⁇ is the scope value of the i tangent line
- b ⁇ is an offset of the i tangent line relative to the transcendental activation function
- r i is an intersection of two tangent lines
- » is a bitwise shift operator
- Example 26 includes the subject matter of any of Examples 15-25, and further including applying, by the compute device, the shifted neural network to an input for pattern recognition.
- Example 27 includes the subject matter of any of Examples 15-26, and wherein each corresponding slope is computed by a bitwise shift operation.
- Example 28 includes the subject matter of any of Examples 15-27, and wherein each of the input weights is stored in a four-bit memory region; and wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
- Example 29 includes a computing device comprising a processor; and a memory having stored therein a plurality of instructions that when executed by the processor cause the computing device to perform the method of any of Examples 15-28.
- Example 30 includes one or more machine-readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a computing device performing the method of any of Examples 15-28.
- Example 31 includes a computing device comprising means for performing the method of any of Examples 15-28.
- Example 32 includes a compute device for use of a shifted neural network, the compute device comprising means for determining a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and means for training the shifted neural network based on shift-based input weights and the determined shift-based activation function.
- Example 33 includes the subject matter of Example 32, and further including means for identifying a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
- Example 34 includes the subject matter of any of Examples 32 and 33, and wherein the set of input values comprises a set of predefined image patterns for recognition.
- Example 35 includes the subject matter of any of Examples 32-34, and wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
- Example 36 includes the subject matter of any of Examples 32-35, and wherein the transcendental activation function comprises a sigmoid function.
- Example 37 includes the subject matter of any of Examples 32-36, and wherein the transcendental activation function comprises a hyperbolic tangent function.
- Example 38 includes the subject matter of any of Examples 32-37, and wherein the means for determining the shift-based activation function comprises means for determining the shift-based activation function based on k-means clustering.
- Example 39 includes the subject matter of any of Examples 32-38, and wherein the means for determining the shift-based activation function based on k-means clustering comprises means for computing a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function; means for associating each slope value with a corresponding nearest cluster; and means for updating a centroid associated with each cluster.
- Example 40 includes the subject matter of any of Examples 32-39, and wherein the means for determining the shift-based activation function based on k-means clustering further comprises means for computing an offset of the tangent line relative to an origin.
- Example 41 includes the subject matter of any of Examples 32-40, and wherein the means for determining the shift-based activation function based on k-means clustering further comprises means for computing intersections of the tangent lines in response to a determination that each centroid value is stable.
- Example 42 includes the subject matter of any of Examples 32-41, and wherein the means for determining the shift-based activation function comprises means for generating the piecewise linear approximation according to
- x is an input value
- ⁇ ⁇ is the scope value of the i tangent line
- b ⁇ is an offset of the i tangent line relative to the transcendental activation function
- r i is an intersection of two tangent lines
- » is a bitwise shift operator
- Example 43 includes the subject matter of any of Examples 32-42, and further including means for applying the shifted neural network to an input for pattern recognition.
- Example 44 includes the subject matter of any of Examples 32-43, and wherein each corresponding slope is computed by a bitwise shift operation.
- Example 45 includes the subject matter of any of Examples 32-44, and wherein each of the input weights is stored in a four-bit memory region; and wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
Technologies for using a shifted neural network include a compute device to determine a shift-based activation function of the shifted neural network. The shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments such that a corresponding slope of each line segment is a power of two. The compute device further trains the shifted neural network based on shift-based input weights and the determined shift-based activation function.
Description
TECHNOLOGIES FOR SHIFTED NEURAL NETWORKS
CROSS-REFERENCE TO RELATED PATENT APPLICATION
[0001] The present application claims priority to U.S. Utility Patent Application Serial
No. 15/046,894, entitled "TECHNOLOGIES FOR SHIFTED NEURAL NETWORKS," which was filed on February 18, 2016.
BACKGROUND
[0002] The development and use of pattern recognition generally involves machine learning to recognize patterns in data by virtue, for example, of data regularities and/or irregularities. For example, a pattern recognition system may be "trained" to properly identify patterns by using training data that has pre-identified the relevant classes of the data points and/or may be used to recognize patterns in a previously unclassified set of data. One of the most common techniques for pattern recognition involves the use of Artificial Neural Networks (ANN), or simply neural networks, which were initially modeled after biological neural systems. Artificial Neural Networks are capable of learning and solving highly non-linear pattern recognition problems. In doing so, such networks typically involve the use of transcendental functions (e.g., sigmoid functions, hyperbolic tangent functions, etc.) and/or memory-intensive algorithms. Accordingly, the use of neural networks for pattern recognition is often limited or non-existent with wearable computing devices, low-power devices, and/or other hardware-limited devices (e.g., devices without a dedicated acceleration unit suitable for pattern recognition).
BRIEF DESCRIPTION OF THE DRAWINGS
[0003] The concepts described herein are illustrated by way of example and not by way of limitation in the accompanying figures. For simplicity and clarity of illustration, elements illustrated in the figures are not necessarily drawn to scale. Where considered appropriate, reference labels have been repeated among the figures to indicate corresponding or analogous elements.
[0004] FIG. 1 is a simplified block diagram of at least one embodiment of a compute device for using a shifted neural network;
[0005] FIG. 2 is a simplified block diagram of at least one embodiment of an environment of a compute device of FIG. 1;
[0006] FIG. 3 is a simplified flow diagram of at least one embodiment of a method for using a shifted neural network that may be executed by the compute device of FIG. 1;
[0007] FIG. 4 is a simplified flow diagram of at least one embodiment of a method of determining a shift-based activation function for the shifted neural network; and
[0008] FIG. 5 is a simplified graph illustrating the determination of a piecewise linear approximation of a transcendental activation function for the shifted neural network.
DETAILED DESCRIPTION OF THE DRAWINGS
[0009] While the concepts of the present disclosure are susceptible to various modifications and alternative forms, specific embodiments thereof have been shown by way of example in the drawings and will be described herein in detail. It should be understood, however, that there is no intent to limit the concepts of the present disclosure to the particular forms disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives consistent with the present disclosure and the appended claims.
[0010] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may or may not necessarily include that particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described. Additionally, it should be appreciated that items included in a list in the form of "at least one A, B, and C" can mean (A); (B); (C): (A and B); (B and C); (A and C); or (A, B, and C). Similarly, items listed in the form of "at least one of A, B, or C" can mean (A); (B); (C): (A and B); (B and C); (A and C); or (A, B, and C).
[0011] The disclosed embodiments may be implemented, in some cases, in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage medium, which may be read and executed by one or more processors. A machine-readable storage medium may be embodied as any storage device, mechanism, or other physical structure for storing or transmitting information in a form readable by a machine (e.g., a volatile or non-volatile memory, a media disc, or other media device).
[0012] In the drawings, some structural or method features may be shown in specific arrangements and/or orderings. However, it should be appreciated that such specific
arrangements and/or orderings may not be required. Rather, in some embodiments, such features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of a structural or method feature in a particular figure is not meant to imply that such feature is required in all embodiments and, in some embodiments, may not be included or may be combined with other features.
[0013] Referring now to FIG. 1, a compute device 100 for using a shifted neural network is shown. As described in detail below, in the illustrative embodiment, the compute device 100 utilizes a shifted neural network for machine learning, pattern recognition, and/or other suitable purposes. In some embodiments, the shifted neural network eliminates the use of double precision floating point units in neural network calculations, eliminates the use of transcendental functions, eliminates the need for multiplication operations in the feed-forward layers of a typical neural network, avoids input pattern normalization, and/or reduces the memory footprint of the neural network relative to typical neural networks. Accordingly, in some embodiments, hardware for floating-point operations and/or multiplication may not be included in the circuitry for shifted neural network computations. Further, the processor 110 of the compute device 100 may consume less power and/or process the neural network computations more quickly with the shifted neural network described herein.
[0014] As described below, the compute device 100 determines a shift-based activation function of the shifted neural network (e.g., a piecewise linear approximation of transcendental activation function) and stores the shifted neural network weights as bitwise shifts (e.g., as four bit values) of the input values. The compute device 100 may train the shifted neural network based on the shift-based input weights and the shift-based activation function and/or apply the shifted neural network (e.g., for pattern recognition). Although the shifted neural network techniques are described herein as being performed by the same compute device 100, it should be appreciated that one or more of the techniques may be performed by various compute devices 100 in other embodiments. For example, in some embodiments, one compute device 100 may determine the shift-based activation function and train the shifted neural network, whereas another compute device 100 may apply the shifted neural network (e.g., a wearable computing device).
[0015] The compute device 100 may be embodied as any type of computing device capable of performing the functions described herein. For example, the compute device 100 may be embodied as a wearable computing device, smartphone, cellular phone, personal digital assistant, mobile Internet device, tablet computer, netbook, notebook, Ultrabook™, laptop computer, desktop computer, server, and/or any other mobile computing/communication
device. In the illustrative embodiment, the compute device 100 is embodied as a wearable computing device or other mobile computing device having relatively limited hardware resources. As shown in FIG. 1, the illustrative compute device 100 includes a processor 110, an input/output ("I/O") subsystem 112, a memory 114, a data storage 116, a communication circuitry 118, and one or more peripheral devices 120. Additionally, in some embodiments, the compute device 100 may include a shifted neural network circuitry 122. Of course, the compute device 100 may include other or additional components, such as those commonly found in a typical computing device (e.g., various input/output devices and/or other components), in other embodiments. Additionally, in some embodiments, one or more of the illustrative components may be incorporated in, or otherwise form a portion of, another component. For example, the memory 114, or portions thereof, may be incorporated in the processor 110 in some embodiments.
[0016] The processor 110 may be embodied as any type of processor capable of performing the functions described herein. For example, the processor 110 may be embodied as a single or multi-core processor(s), digital signal processor, microcontroller, or other processor or processing/controlling circuit. Similarly, the memory 114 may be embodied as any type of volatile or non-volatile memory or data storage capable of performing the functions described herein. In operation, the memory 114 may store various data and software used during operation of the compute device 100 such as operating systems, applications, programs, libraries, and drivers. The memory 114 is communicatively coupled to the processor 110 via the I/O subsystem 112, which may be embodied as circuitry and/or components to facilitate input/output operations with the processor 110, the memory 114, and other components of the compute device 100. For example, the I/O subsystem 112 may be embodied as, or otherwise include, memory controller hubs, input/output control hubs, firmware devices, communication links (i.e., point-to-point links, bus links, wires, cables, light guides, printed circuit board traces, etc.) and/or other components and subsystems to facilitate the input/output operations. In some embodiments, the I/O subsystem 112 may form a portion of a system-on-a-chip (SoC) and be incorporated, along with the processor 110, the memory 114, and other components of the compute device 100, on a single integrated circuit chip.
[0017] The data storage 116 may be embodied as any type of device or devices configured for short-term or long-term storage of data such as, for example, memory devices and circuits, memory cards, hard disk drives, solid-state drives, or other data storage devices. The data storage 116 and/or the memory 114 may store various data during operation of the compute device 100 as described herein.
[0018] The communication circuitry 118 may be embodied as any communication circuit, device, or collection thereof, capable of enabling communications between the compute device 100 and other devices over a network. The communication circuitry 118 may be configured to use any one or more communication technologies (e.g., wireless or wired communications) and associated protocols (e.g., Ethernet, Bluetooth®, Wi-Fi®, WiMAX, LTE, 5G, etc.) to effect such communication.
[0019] The peripheral devices 120 may include any number of additional peripheral or interface devices, such as speakers, microphones, additional storage devices, and so forth. The particular devices included in the peripheral devices 120 may depend on, for example, the type and/or intended use of the compute device 100.
[0020] As indicated above, in some embodiments, the compute device 100 may include a shifted neural network circuitry 122 configured to perform one or more functions related to the shifted neural network (e.g., pattern recognition). In some embodiments, the shifted neural network circuitry 122 may include various circuit elements/components to perform operations for the shifted neural network (e.g., multiplexers, summers, bit shifters, etc.). Such components may, for example, be discrete and/or embedded on an integrated circuit depending on the particular embodiment. Further, in some embodiments, floating-point circuitry and/or multiplication circuit components may be omitted from the shifted neural network circuitry 122.
[0021] Referring now to FIG. 2, in use, the compute device 100 establishes an environment for using a shifted neural network. The illustrative environment 200 includes a data handling module 202, a linear approximation module 204, a training module 206, a pattern recognition module 208, and a communication module 210. The various modules of the environment 200 may be embodied as hardware, software, firmware, or a combination thereof. For example, the various modules, logic, and other components of the environment 200 may form a portion of, or otherwise be established by, the processor 110 or other hardware components of the compute device 100. As such, in some embodiments, one or more of the modules of the environment 200 may be embodied as circuitry or collection of electrical devices (e.g., a data handling circuitry, a linear approximation circuitry, a training circuitry, a pattern recognition circuitry, and/or a communication circuitry). Additionally, in some embodiments, one or more of the illustrative modules may form a portion of another module and/or one or more of the illustrative modules may be independent of one another.
[0022] The data handling module 202 is configured to identify, receive, and/or retrieve input values by which to train the shifted neural network and/or to which to apply the shifted
neural network. For example, in some embodiments, the data handling module 202 may identify/retrieve a set of predefined image patterns for recognition (e.g., Mixed National Institute of Standards and Technology (MNIST) database or other image patterns approved by a standards body). Further, the data handling module 202 may identify and/or retrieve the set of shift-based input weights for each neuron of the shifted neural network at a given point in time. As described herein, in the illustrative embodiment, the weights may be stored as four bits in memory (e.g., in a four-bit memory region) such that three of the bits are indicative of an amount of bitwise shift of the corresponding weight and the other bit is indicative of a sign of the weight. Accordingly, in the illustrative embodiments, each of the weights is essentially a power of two (i.e., may be expressed as 2" for some integer n) if multiplication were to be used instead of a bitwise shift operation.
[0023] The linear approximation module 204 is configured to determine a shift-based activation function of the shifted neural network. In particular, in the illustrative embodiment, the shift-based activation function is a piecewise linear approximation of a transcendental activation function (see FIG. 5) and is defined by a plurality of line segments such that the slope of each line segment is a power of two. Accordingly, in the illustrative embodiment, the slopes may be stored and/or calculated as bitwise shifts. The transcendental functions may be embodied, for example, as a sigmoid function or a hyberbolic tangent function depending on the desired operating range. As described below, in some embodiments, the shift-based activation function may be determined based on k-means clustering.
[0024] The training module 206 is configured to train the shifted neural network based on the shift-based input weights and the determined shift-based activation function. It should be appreciated that the training module 206 may utilize any suitable techniques, algorithms, and/or mechanisms for training the shifted neural network. For example, in some embodiments, the training module 206 may utilize many neurons and variations in the shift- based weights iteratively in order to distinguish/label various classes of data. Depending on the particular embodiment, the training module 206 may utilize supervised and/or unsupervised training techniques.
[0025] The pattern recognition module 208 is configured to apply the shifted neural network to various inputs for pattern recognition. For example, in some embodiments, the pattern recognition module 208 may apply the trained shifted neural network to a set of unclassified input data points in order to determine the corresponding classes of those data points. As indicated above, in some embodiments, various techniques described herein may be employed on different devices. For example, one compute device 100 may perform the training
of the shifted neural network and another compute device 100 may apply the shifted neural network (e.g., for pattern recognition).
[0026] The communication module 210 handles the communication between the compute device 100 and other computing devices. For example, in some embodiments, the compute device 100 may transmit the shift-based activation function, shift-based weights, and/or other data associated with the shifted neural network to another compute device 100.
[0027] Referring now to FIG. 3, in use, the compute device 100 may execute a method
300 for use of a shifted neural network. The illustrative method 300 begins with block 302 in which the compute device 100 identifies, receives, and/or retrieves a set of input values by which to train the shifted neural network and/or to which to apply the shifted neural network. For example, in block 304, the compute device 100 may identify/receive one or more image patterns such as MNIST patterns. Of course, in other embodiments, it should be appreciated that the techniques described herein may be applied to non-image data.
[0028] In typical neural network implementations, the input values are often normalized
(e.g., from the signed char range of (-128,127) to the floating-point range of (- 1.Of, l.Of)) to reach consistency within the data's dynamic range, which results in floating-point multiplications in the convolutional neural network engine. However, in the illustrative embodiment, the input values may be utilized without normalization in the shifted neural network, which may save memory, time, operations, and/or power.
[0029] In block 306, the compute device 100 determines a shift-based activation function of the shifted neural network. In particular, in block 308, the compute device 100 determines a piecewise linear approximation of a transcendental activation function such that the piecewise linear approximation is defined by a set of line segments, each having a slope that is a power of two (and therefore calculable by virtue of bitwise shift operations). For example, the compute device 100 may generate a linear approximation of a sigmoid function in block 310 or generate a linear approximation of a hyperbolic tangent function in block 312 (see, for example, function 504 of FIG. 5). Of course, it should be appreciated that the compute device 100 may utilize another transcendental function suitable for the performance of the functions described herein in other embodiments.
[0030] In some embodiments, in block 314, the compute device 100 may generate the linear approximation of the transcendental activation function based on k-means clustering. To do so, the compute device 100 may execute a method 400 of FIG. 4. The illustrative method 400 begins with block 402 in which the compute device 100 computes a slope value as a base- two logarithm of a tangent line (see, for example, tangent lines 502 of FIG. 5) of the
transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function (see, for example, function 504 of FIG. 5).
More and
activation function, . is the corresponding output value, x . is the corresponding input value, and σ j is a slope of the function. It should be appreciated that, in some embodiments, the tangent lines may be initialized randomly or according to some other suitable algorithm.
[0031] In block 404, the compute device 100 associates each slope with the nearest cluster. In other words, the compute device 100 determines the "distance" of each slope value to each of the centroid values and associates the slope with the nearest cluster. More formally, the compute device 100 may determine ap - m (t) < p - m} (t)
,Vl≤j≤k} , where S . is a particular set/cluster (of the k clusters), σρ is a corresponding slope of the function, m/f) and m . f) are means of the corresponding clusters, and p,j, i, and k are indices.
[0032] In block 406, the compute device 100 updates the centroid (e.g., mean) associated with each cluster and computes the offset for each tangent line. More formally, the compute device 100 may determine b{
, where bi is an offset of the corresponding tangent line relative to the origin, 5 · ( is a particular set/cluster, σ ' . is a corresponding slope of the function, m i+1) is a mean of the corresponding cluster, y . is the corresponding output value, and xj is the corresponding input value.
In block 408, the compute device 100 determines whether each centroid value is stable. In other words, the compute device 100 determines whether the centroid values of the clusters are unchanged (or minimally changed) relative to the previous iteration. More formally, the compute device 100 may determine whether m(. i+1) = m(. i) ,Vl≤i≤ k - l . If the centroid values are not stable, the method 400 returns to block 404 in which the compute device 100 again determines the nearest cluster to each of the slopes and re-associates the slopes accordingly (i.e., to the extent there is a change). However, if the compute device 100
determines that the centroid values are stable, the compute device 100 determines the piecewise linear approximation in block 410. In doing so, in the illustrative embodiment, the compute device 100 computes the intersections of the tangent lines in block 412. More formally, the com ute device 100 may determine the intersections according to
wherein η is an intersection of two tangent lines and » is a bitwise shift operator. It should be appreciated that the techniques described herein may be employed to map a continuous neural network into a shifted neural network. In some embodiments, the shifted neural network may have significant memory compression (e.g., eight times) relative to typical neural networks. Further, in some embodiments, the shifted neural network may permit an implementation on a small SoC by avoiding floating-point and integer multiplication operations as described above.
[0033] Referring back to FIG. 3, in block 316, the compute device 100 trains the shifted neural network based on the relevant shift-based weights and the determined shift-based activation function. As indicated above, it should be appreciated that the compute device 100 may utilize any suitable techniques, algorithms, and/or mechanisms for training the shifted neural network. For example, in some embodiments, the compute device 100 may utilize many neurons and variations in the shift-based weights iteratively in order to distinguish/label various classes of data.
[0034] In typical neural networks, it should be appreciated that the neuron weights may be accumulated according to s = wixi , where wt is a weight and xt is the corresponding input. In other words, the input values are multiplied by various weights and summed. However, in the illustrative embodiment, each of the weights is indicative of an amount by which to perform a bitwise shift on the input value. Accordingly, in memory, the compute device 100 may utilize three bits to store the shift amount (e.g., 0, 1, 2, 3, 4, 5, 6, or 7) and one bit for the sign. As such, in the illustrative embodiment, each of the weights is a power of two (e.g., -128, -64, -32, -16, -8, -4, -2, -1, 1, 2, 4, 8, 16, 32, 64, or 128). It should be appreciated that such a data representation and operations may represent a significant memory compression relative to integer and/or floating-point multiplication associated with a convolutional engine.
[0035] In block 318, the compute device 100 applies the shifted neural network to various inputs for pattern recognition. For example, in some embodiments, the compute device 100 may apply the trained shifted neural network to a set of unclassified input data points in order to determine the corresponding classes of those data points. As indicated above, in some embodiments, it should be appreciated that one compute device 100 may perform the training of the shifted neural network and another compute device 100 may apply the shifted neural network (e.g., for pattern recognition).
EXAMPLES
[0036] Illustrative examples of the technologies disclosed herein are provided below.
An embodiment of the technologies may include any one or more, and any combination of, the examples described below.
[0037] Example 1 includes a compute device for use of a shifted neural network, the compute device comprising a linear approximation module to determine a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and a training module to train the shifted neural network based on shift-based input weights and the determined shift-based activation function.
[0038] Example 2 includes the subject matter of Example 1, and further including a data handling module to identify a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
[0039] Example 3 includes the subject matter of any of Examples 1 and 2, and wherein the set of input values comprises a set of predefined image patterns for recognition.
[0040] Example 4 includes the subject matter of any of Examples 1-3, and wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
[0041] Example 5 includes the subject matter of any of Examples 1-4, and wherein the transcendental activation function comprises a sigmoid function.
[0042] Example 6 includes the subject matter of any of Examples 1-5, and wherein the transcendental activation function comprises a hyperbolic tangent function.
[0043] Example 7 includes the subject matter of any of Examples 1-6, and wherein to determine the shift-based activation function comprises to determine the shift-based activation function based on k-means clustering.
[0044] Example 8 includes the subject matter of any of Examples 1-7, and wherein to determine the shift-based activation function based on k-means clustering comprises to compute a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function; associate each slope value with a corresponding nearest cluster; and update a centroid associated with each cluster.
[0045] Example 9 includes the subject matter of any of Examples 1-8, and wherein to determine the shift-based activation function based on k-means clustering further comprises to compute an offset of the tangent line relative to an origin.
[0046] Example 10 includes the subject matter of any of Examples 1-9, and wherein to determine the shift-based activation function based on k-means clustering further comprises to compute intersections of the tangent lines in response to a determination that each centroid value is stable.
[0047] Example 11 includes the subject matter of any of Examples 1-10, and wherein to determine the shift-based activation function comprises to generate the piecewise linear approximation according to
x » al + bl, 0 < x < rx
y « wherein x is an input value, σν is the scope value of the i tangent line, b{ is an offset of the i tangent line relative to the transcendental activation function, ri is an intersection of two tangent lines, and » is a bitwise shift operator.
[0048] Example 12 includes the subject matter of any of Examples 1-11, and further including a pattern recognition module to apply the shifted neural network to an input for pattern recognition.
[0049] Example 13 includes the subject matter of any of Examples 1-12, and wherein each corresponding slope is computed by a bitwise shift operation.
[0050] Example 14 includes the subject matter of any of Examples 1-13, and wherein each of the input weights is stored in a four-bit memory region; and wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
[0051] Example 15 includes a method for use of a shifted neural network, the method comprising determining, by a compute device, a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation
of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and training, by the compute device, the shifted neural network based on shift-based input weights and the determined shift-based activation function.
[0052] Example 16 includes the subject matter of Example 15, and further including identifying, by the compute device, a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
[0053] Example 17 includes the subject matter of any of Examples 15 and 16, and wherein the set of input values comprises a set of predefined image patterns for recognition.
[0054] Example 18 includes the subject matter of any of Examples 15-17, and wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
[0055] Example 19 includes the subject matter of any of Examples 15-18, and wherein the transcendental activation function comprises a sigmoid function.
[0056] Example 20 includes the subject matter of any of Examples 15-19, and wherein the transcendental activation function comprises a hyperbolic tangent function.
[0057] Example 21 includes the subject matter of any of Examples 15-20, and wherein determining the shift-based activation function comprises determining the shift-based activation function based on k-means clustering.
[0058] Example 22 includes the subject matter of any of Examples 15-21, and wherein determining the shift-based activation function based on k-means clustering comprises computing a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function; associating each slope value with a corresponding nearest cluster; and updating a centroid associated with each cluster.
[0059] Example 23 includes the subject matter of any of Examples 15-22, and wherein determining the shift-based activation function based on k-means clustering further comprises computing an offset of the tangent line relative to an origin.
[0060] Example 24 includes the subject matter of any of Examples 15-23, and wherein determining the shift-based activation function based on k-means clustering further comprises computing intersections of the tangent lines in response to a determination that each centroid value is stable.
[0061] Example 25 includes the subject matter of any of Examples 15-24, and wherein determining the shift-based activation function comprises generating the piecewise linear approximation according to
wherein x is an input value, σν is the scope value of the i tangent line, b{ is an offset of the i tangent line relative to the transcendental activation function, ri is an intersection of two tangent lines, and » is a bitwise shift operator.
[0062] Example 26 includes the subject matter of any of Examples 15-25, and further including applying, by the compute device, the shifted neural network to an input for pattern recognition.
[0063] Example 27 includes the subject matter of any of Examples 15-26, and wherein each corresponding slope is computed by a bitwise shift operation.
[0064] Example 28 includes the subject matter of any of Examples 15-27, and wherein each of the input weights is stored in a four-bit memory region; and wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
[0065] Example 29 includes a computing device comprising a processor; and a memory having stored therein a plurality of instructions that when executed by the processor cause the computing device to perform the method of any of Examples 15-28.
[0066] Example 30 includes one or more machine-readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a computing device performing the method of any of Examples 15-28.
[0067] Example 31 includes a computing device comprising means for performing the method of any of Examples 15-28.
[0068] Example 32 includes a compute device for use of a shifted neural network, the compute device comprising means for determining a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and means for training the shifted neural network based on shift-based input weights and the determined shift-based activation function.
[0069] Example 33 includes the subject matter of Example 32, and further including means for identifying a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
[0070] Example 34 includes the subject matter of any of Examples 32 and 33, and wherein the set of input values comprises a set of predefined image patterns for recognition.
[0071] Example 35 includes the subject matter of any of Examples 32-34, and wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
[0072] Example 36 includes the subject matter of any of Examples 32-35, and wherein the transcendental activation function comprises a sigmoid function.
[0073] Example 37 includes the subject matter of any of Examples 32-36, and wherein the transcendental activation function comprises a hyperbolic tangent function.
[0074] Example 38 includes the subject matter of any of Examples 32-37, and wherein the means for determining the shift-based activation function comprises means for determining the shift-based activation function based on k-means clustering.
[0075] Example 39 includes the subject matter of any of Examples 32-38, and wherein the means for determining the shift-based activation function based on k-means clustering comprises means for computing a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function; means for associating each slope value with a corresponding nearest cluster; and means for updating a centroid associated with each cluster.
[0076] Example 40 includes the subject matter of any of Examples 32-39, and wherein the means for determining the shift-based activation function based on k-means clustering further comprises means for computing an offset of the tangent line relative to an origin.
[0077] Example 41 includes the subject matter of any of Examples 32-40, and wherein the means for determining the shift-based activation function based on k-means clustering further comprises means for computing intersections of the tangent lines in response to a determination that each centroid value is stable.
[0078] Example 42 includes the subject matter of any of Examples 32-41, and wherein the means for determining the shift-based activation function comprises means for generating the piecewise linear approximation according to
x » al + bl, 0 < x < rx
y «
wherein x is an input value, σ{ is the scope value of the i tangent line, b{ is an offset of the i tangent line relative to the transcendental activation function, ri is an intersection of two tangent lines, and » is a bitwise shift operator.
[0079] Example 43 includes the subject matter of any of Examples 32-42, and further including means for applying the shifted neural network to an input for pattern recognition.
[0080] Example 44 includes the subject matter of any of Examples 32-43, and wherein each corresponding slope is computed by a bitwise shift operation.
[0081] Example 45 includes the subject matter of any of Examples 32-44, and wherein each of the input weights is stored in a four-bit memory region; and wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
Claims
1. A compute device for use of a shifted neural network, the compute device comprising:
a linear approximation module to determine a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and
a training module to train the shifted neural network based on shift-based input weights and the determined shift-based activation function.
2. The compute device of claim 1, further comprising a data handling module to identify a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
3. The compute device of claim 2, wherein the set of input values comprises a set of predefined image patterns for recognition.
4. The compute device of claim 3, wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
5. The compute device of claim 1, wherein the transcendental activation function comprises a sigmoid function.
6. The compute device of claim 1, wherein the transcendental activation function comprises a hyperbolic tangent function.
7. The compute device of claim 1, wherein to determine the shift-based activation function comprises to determine the shift-based activation function based on k-means clustering.
8. The compute device of claim 7, wherein to determine the shift-based activation function based on k-means clustering comprises to:
compute a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function;
associate each slope value with a corresponding nearest cluster; and update a centroid associated with each cluster.
9. The compute device of claim 8, wherein to determine the shift-based activation function based on k-means clustering further comprises to compute an offset of the tangent line relative to an origin.
10. The compute device of claim 8, wherein to determine the shift-based activation function based on k-means clustering further comprises to compute intersections of the tangent lines in response to a determination that each centroid value is stable.
11. The compute device of claim 10, wherein to determine the shift-based activation function comprises to generate the piecewise linear approximation according to
x » σ, + b. , 0 < x < r.
y =
x » ak + bk, r, , < x < r,
wherein x is an input value, σν is the scope value of the i tangent line, b{ is an offset of the i tangent line relative to the transcendental activation function, ri is an intersection of two tangent lines, and » is a bitwise shift operator.
12. The compute device of claim 1, further comprising a pattern recognition module to apply the shifted neural network to an input for pattern recognition.
13. The compute device of any of claims 1-12, wherein each corresponding slope is computed by a bitwise shift operation.
14. The compute device of any of claims 1-12, wherein each of the input weights is stored in a four-bit memory region; and
wherein three bits of the four-bit memory region store a value associated with an amount of bitwise shift of the corresponding input weight and one bit is indicative of a sign of the weight.
15. A method for use of a shifted neural network, the method comprising: determining, by a compute device, a shift-based activation function of the shifted neural network, wherein the shift-based activation function is a piecewise linear approximation of a transcendental activation function and is defined by a plurality of line segments, and wherein a corresponding slope of each line segment is a power of two; and
training, by the compute device, the shifted neural network based on shift-based input weights and the determined shift-based activation function.
16. The method of claim 15, further comprising identifying, by the compute device, a set of input values and a set of shift-based input weights for each neuron of the shifted neural network.
17. The method of claim 16, wherein the set of input values comprises a set of predefined image patterns for recognition.
18. The method of claim 17, wherein the set of predefined image patterns comprises a set of image patterns approved by a standards body.
19. The method of claim 15, wherein the transcendental activation function comprises a sigmoid function.
20. The method of claim 15, wherein the transcendental activation function comprises a hyperbolic tangent function.
21. The method of claim 15, wherein determining the shift-based activation function comprises determining the shift-based activation function based on k-means clustering by:
computing a slope value as a base-two logarithm of a tangent line of the transcendental activation function for each function value of a plurality of function values in the range of the transcendental activation function;
associating each slope value with a corresponding nearest cluster; and updating a centroid associated with each cluster.
22. The method of claim 21, wherein determining the shift-based activation function based on k- means clustering further comprises:
computing an offset of the tangent line relative to an origin; and
computing intersections of the tangent lines in response to a determination that each centroid value is stable.
23. The method of claim 22, wherein determining the shift-based activation function comprises generating the piecewise linear approximation according to
x » σ, + b. , 0 < x < r.
y =
x » ak + bk, r, , < x < r,
wherein x is an input value, σν is the scope value of the i tangent line, b{ is an offset of the i tangent line relative to the transcendental activation function, ri is an intersection of two tangent lines, and » is a bitwise shift operator.
24. The method of claim 15, wherein each corresponding slope is computed by a bitwise shift operation.
25. One or more machine-readable storage media comprising a plurality of instructions stored thereon that in response to being executed result in a computing device performing the method of any of claims 15-24.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US15/046,894 US10733503B2 (en) | 2016-02-18 | 2016-02-18 | Technologies for shifted neural networks |
| US15/046,894 | 2016-02-18 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017142670A1 true WO2017142670A1 (en) | 2017-08-24 |
Family
ID=59626240
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/US2017/014101 Ceased WO2017142670A1 (en) | 2016-02-18 | 2017-01-19 | Technologies for shifted neural networks |
Country Status (2)
| Country | Link |
|---|---|
| US (1) | US10733503B2 (en) |
| WO (1) | WO2017142670A1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108154224A (en) * | 2018-01-17 | 2018-06-12 | 北京中星微电子有限公司 | For the method, apparatus and non-transitory computer-readable medium of data processing |
Families Citing this family (21)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10936951B1 (en) * | 2016-02-14 | 2021-03-02 | Perceive Corporation | Machine learning through multiple layers of novel machine trained processing nodes |
| US11995554B2 (en) * | 2016-04-15 | 2024-05-28 | Cambricon Technologies Corporation Limited | Apparatus and methods for backward propagation in neural networks supporting discrete data |
| US11017295B1 (en) | 2017-05-01 | 2021-05-25 | Perceive Corporation | Device storing ternary weight parameters for machine-trained network |
| US11481218B2 (en) * | 2017-08-02 | 2022-10-25 | Intel Corporation | System and method enabling one-hot neural networks on a machine learning compute platform |
| JP6919539B2 (en) * | 2017-12-06 | 2021-08-18 | 富士通株式会社 | Arithmetic processing unit and control method of arithmetic processing unit |
| US11475305B2 (en) * | 2017-12-08 | 2022-10-18 | Advanced Micro Devices, Inc. | Activation function functional block for electronic devices |
| CN111602146B (en) * | 2018-01-16 | 2024-05-10 | 奥林巴斯株式会社 | Data processing system, data processing method, and recording medium |
| US11481612B1 (en) | 2018-04-20 | 2022-10-25 | Perceive Corporation | Storage of input values across multiple cores of neural network inference circuit |
| US10977338B1 (en) | 2018-04-20 | 2021-04-13 | Perceive Corporation | Reduced-area circuit for dot product computation |
| US12093696B1 (en) | 2018-04-20 | 2024-09-17 | Perceive Corporation | Bus for transporting output values of a neural network layer to cores specified by configuration data |
| US11210586B1 (en) | 2018-04-20 | 2021-12-28 | Perceive Corporation | Weight value decoder of neural network inference circuit |
| US12518146B1 (en) | 2018-04-20 | 2026-01-06 | Amazon Technologies, Inc. | Address decoding by neural network inference circuit read controller |
| US11361213B1 (en) | 2018-04-20 | 2022-06-14 | Perceive Corporation | Using lookup table to represent neural network activation function |
| US11783167B1 (en) | 2018-04-20 | 2023-10-10 | Perceive Corporation | Data transfer for non-dot product computations on neural network inference circuit |
| US11037027B2 (en) * | 2018-10-25 | 2021-06-15 | Raytheon Company | Computer architecture for and-or neural networks |
| US11347297B1 (en) | 2019-01-23 | 2022-05-31 | Perceive Corporation | Neural network inference circuit employing dynamic memory sleep |
| US11494657B2 (en) | 2019-07-30 | 2022-11-08 | Perceive Corporation | Quantizing neural networks using approximate quantization function |
| US10872295B1 (en) | 2019-09-19 | 2020-12-22 | Hong Kong Applied Science and Technology Institute Company, Limited | Residual quantization of bit-shift weights in an artificial neural network |
| CN114861859B (en) * | 2021-01-20 | 2025-09-09 | 华为技术有限公司 | Training method of neural network model, data processing method and device |
| US12217160B1 (en) | 2021-04-23 | 2025-02-04 | Amazon Technologies, Inc. | Allocating blocks of unified memory for integrated circuit executing neural network |
| US12579416B1 (en) | 2021-09-13 | 2026-03-17 | Amazon Technologies, Inc. | Neural network inference circuit with piecewise linear activation circuit |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070094176A1 (en) * | 2001-04-06 | 2007-04-26 | Goodnight James H | Hybrid neural network generation system and method |
| US20150036920A1 (en) * | 2013-07-31 | 2015-02-05 | Fujitsu Limited | Convolutional-neural-network-based classifier and classifying method and training methods for the same |
| US20150106310A1 (en) * | 2013-10-16 | 2015-04-16 | University Of Tennessee Research Foundation | Method and apparatus for constructing a neuroscience-inspired artificial neural network |
| US20150347870A1 (en) * | 2014-05-29 | 2015-12-03 | International Business Machines Corporation | Scene understanding using a neurosynaptic system |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2940933B2 (en) * | 1989-05-20 | 1999-08-25 | 株式会社リコー | Pattern recognition method |
| EP0566015A3 (en) * | 1992-04-14 | 1994-07-06 | Eastman Kodak Co | Neural network optical character recognition system and method for classifying characters in amoving web |
| US5963460A (en) * | 1996-12-17 | 1999-10-05 | Metaflow Technologies, Inc. | Apparatus for computing transcendental functions quickly |
| US7606850B2 (en) * | 2005-03-30 | 2009-10-20 | Lockheed Martin Corporation | Method and apparatus for providing a base-2 logarithm approximation to a binary number |
| US10068170B2 (en) * | 2013-09-23 | 2018-09-04 | Oracle International Corporation | Minimizing global error in an artificial neural network |
| JP6314628B2 (en) * | 2014-04-28 | 2018-04-25 | 株式会社デンソー | Arithmetic processing unit |
| EP3107040A1 (en) * | 2015-06-19 | 2016-12-21 | Tata Consultancy Services Limited | Assurance-enabled linde buzo gray (albg) data clustering based segmentation |
-
2016
- 2016-02-18 US US15/046,894 patent/US10733503B2/en not_active Expired - Fee Related
-
2017
- 2017-01-19 WO PCT/US2017/014101 patent/WO2017142670A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070094176A1 (en) * | 2001-04-06 | 2007-04-26 | Goodnight James H | Hybrid neural network generation system and method |
| US20150036920A1 (en) * | 2013-07-31 | 2015-02-05 | Fujitsu Limited | Convolutional-neural-network-based classifier and classifying method and training methods for the same |
| US20150106310A1 (en) * | 2013-10-16 | 2015-04-16 | University Of Tennessee Research Foundation | Method and apparatus for constructing a neuroscience-inspired artificial neural network |
| US20150347870A1 (en) * | 2014-05-29 | 2015-12-03 | International Business Machines Corporation | Scene understanding using a neurosynaptic system |
Non-Patent Citations (1)
| Title |
|---|
| SCHUYLER ELDRIDGE ET AL.: "Towards General-Purpose Neural Network Computing", INTERNATIONAL CONFERENCE ON PARALLEL ARCHITECTURE AND COMPILATION, 21 October 2015 (2015-10-21), pages 99 - 112, XP032878635, Retrieved from the Internet <URL:http://ieeexplore.ieee.org/document/7429298> * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108154224A (en) * | 2018-01-17 | 2018-06-12 | 北京中星微电子有限公司 | For the method, apparatus and non-transitory computer-readable medium of data processing |
Also Published As
| Publication number | Publication date |
|---|---|
| US20170243110A1 (en) | 2017-08-24 |
| US10733503B2 (en) | 2020-08-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10733503B2 (en) | Technologies for shifted neural networks | |
| TWI830938B (en) | Method and system of quantizing artificial neural network and artificial neural network apparatus | |
| CN110880038B (en) | FPGA-based system for accelerating convolution computing, convolutional neural network | |
| US20190171927A1 (en) | Layer-level quantization in neural networks | |
| JP7331303B2 (en) | Artificial Neural Network Training with Flexible Floating-Point Tensors | |
| EP3657398B1 (en) | Processing method and accelerating device | |
| US11657254B2 (en) | Computation method and device used in a convolutional neural network | |
| CN109478144B (en) | A data processing device and method | |
| US10789734B2 (en) | Method and device for data quantization | |
| US10282641B2 (en) | Technologies for classification using sparse coding in real time | |
| CN110007959B (en) | Hierarchical mantissa bit length selection for hardware implementation of deep neural networks | |
| CN108475252B (en) | Method for distributed machine learning, mobile computing device and cloud server | |
| US20200302283A1 (en) | Mixed precision training of an artificial neural network | |
| KR102765759B1 (en) | Method and apparatus for quantizing deep neural network | |
| US20200320385A1 (en) | Using quantization in training an artificial intelligence model in a semiconductor solution | |
| CN117743974B (en) | Cooling flow distribution method, device and storage medium for liquid-cooled energy storage system | |
| CN110689045A (en) | Distributed training method and device for deep learning model | |
| CN111033462A (en) | Providing efficient floating point operations using matrix processors in processor-based systems | |
| CN112269875B (en) | Text classification method, device, electronic equipment and storage medium | |
| WO2022264387A1 (en) | Training device, training method, and training program | |
| US20200110635A1 (en) | Data processing apparatus and method | |
| CN115148292A (en) | Artificial intelligence-based DNA motif prediction method, device, equipment and medium | |
| CN112799719B (en) | A deep neural network training method and device | |
| CN114065913A (en) | Model quantization method, device and terminal equipment | |
| WO2022151505A1 (en) | Neural network quantization method and apparatus, and computer-readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17753614 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17753614 Country of ref document: EP Kind code of ref document: A1 |




