Photoelectric hybrid computing system and method for realizing neural network algorithm
By designing an optoelectronic hybrid computing system including optical power regulation signal generation, optical matrix multiplication and optical nonlinear calculation modules, the problem that the photoelectric hybrid ONNs system in the prior art is difficult to realize optical nonlinear functions, and efficient optical nonlinear calculation is achieved.
Patent Information
- Application Number
- CN202411978805.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
The existing photoelectric hybrid ONNs systems have difficulties in realizing optical nonlinear functions and rely on electronic computing hardware to assist in their work.
A photoelectric hybrid computing system is designed to generate optical power regulation signals through the controller, and combine it with the DAC module, light source module, modulation module, optical matrix multiplication module and optical nonlinear calculation module to realize linear and nonlinear calculation.
Optical nonlinear computing is realized, reducing dependence on electronic computing hardware, and improving computing efficiency and independence.
Smart Images

Figure CN119903885A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an optoelectronic computing system, and in particular to a method for designing an optoelectronic hybrid computing system and realizing a neural network algorithm. Background Art
[0002] Optical Neural Networks (ONNs) are a computing model that uses optical devices (lasers, optical modulators, filters, detectors, etc.) to simulate and implement the reasoning function of neural networks. Compared with electronic neural networks, ONNs use the characteristic quantities of light (amplitude, phase, frequency, etc.) for signal transmission and data processing, completing the reasoning and calculation process of neural networks during the propagation of light. It has the advantages of low latency, low energy consumption, parallel signal processing, and strong resistance to electromagnetic interference.
[0003] However, the current working process of ONNs still cannot do without the assistance of electronic computing hardware, and it is also very difficult for ONNs to realize nonlinear functions in the optical domain. Therefore, the current optoelectronic hybrid ONNs system is more popular. The optoelectronic hybrid ONNs system architecture includes the principle layer, optical computing layer, electronic circuit auxiliary layer and application layer. The positioning of the optoelectronic hybrid ONNs system is that ONNs complete most of the computing tasks of the entire system, while the electronic computing hardware completes the less computationally intensive parts, such as routing, storage and nonlinear functions.
[0004] Typically, operations in neuromorphic computing technology can be decomposed into a series of linear and nonlinear transformations of the input optical signal. However, in the current ONNs system, linear transformations (and certain nonlinear transformations, such as matrix multiplication operations) can be performed at the speed of light and detected at rates exceeding 100 GHz in the photonic network, that is, linear calculations are implemented by the photonic computing layer, while nonlinear calculations are implemented by the electronic circuit part.
[0005] For example, the Chinese invention patent application with publication number CN 112424796 A discloses an optoelectronic computing system, which performs linear conversion of optical input signals through an optical interference unit in a matrix multiplication unit; and performs nonlinear conversion through a dedicated digital integrated circuit in a controller. That is, the controller performs nonlinear conversion in the digital domain. Of course, analog electronic devices can also be set to perform nonlinear conversion in the analog domain, for example, an analog nonlinear unit is set (e.g., a high-gain amplifier in a feedback configuration, a comparator with an adjustable reference voltage, a nonlinear IV characteristic of a diode, a breakdown behavior of a diode, a nonlinear CV characteristic of a variable capacitor, or a nonlinear IV characteristic of a variable resistor can be used to implement the analog nonlinear unit 310).
[0006] For another example, the Chinese invention patent application with publication number CN 109477938 A discloses a device configured to implement an artificial neural network, which linearly transforms an input optical signal through an optical interference unit, and simultaneously sets a nonlinear unit to nonlinearly transform the optical information output by the optical interference unit. The optical nonlinear unit includes a ring resonator array, and each ring resonator in the ring resonator array receives a corresponding second optical signal from the interference unit. Summary of the invention
[0007] The purpose of the present invention is to provide an optoelectronic hybrid computing system and a method for implementing a neural network algorithm, which can partially solve or alleviate the above-mentioned deficiencies in the prior art and realize optical nonlinear computing.
[0008] In order to solve the above-mentioned technical problems, the present invention specifically adopts the following technical solutions:
[0009] A first aspect of the present invention is to provide an optoelectronic hybrid computing system, comprising:
[0010] The controller is configured to receive a calculation request and generate a corresponding optical power control signal according to a calculation type in the calculation request; the calculation request includes: a digital input vector, a neural network weight and a calculation type; the calculation type includes: linear calculation, nonlinear calculation and hybrid calculation; the hybrid calculation includes linear calculation and nonlinear calculation;
[0011] a DAC module, coupled to the controller, configured to generate a plurality of modulation control signals based on the digital input vector, and when the calculation type is nonlinear calculation, generate a first weight control signal corresponding to a unit matrix based on the plurality of neural network weights; when the calculation type is linear calculation or hybrid calculation, generate a second weight control signal corresponding to a preset weight matrix based on the plurality of neural network weights;
[0012] a light source module, coupled to the controller, configured to provide a plurality of first light outputs according to the optical power control signal when the calculation type is a hybrid calculation; or to provide a plurality of second light outputs according to the optical power control signal when the calculation type is a linear calculation; or to provide a plurality of third light outputs according to the optical power control signal when the calculation type is a nonlinear calculation;
[0013] a modulation module, coupled to the light source module and the DAC module, configured to receive and modulate the plurality of first light outputs provided by the light source module according to the modulation control signal to generate a corresponding first light input vector, or to modulate the plurality of second light outputs provided by the light source module to generate a corresponding second light input vector; or to modulate the plurality of third light outputs provided by the light source module to generate a corresponding third light input vector;
[0014] an optical matrix multiplication module, coupled to the modulation module and the DAC module, configured to convert the plurality of first optical input vectors into first optical output vectors based on the second weight control signal, or convert the plurality of second optical input vectors into second optical output vectors based on the second weight control signal; or convert the plurality of third optical input vectors into third optical output vectors based on the first weight control signal;
[0015] an optical nonlinear calculation module, coupled to the optical matrix multiplication module and the ADC module, and configured to perform a nonlinear transformation on the first light output vector to obtain a first analog output vector; or perform a linear transformation on the second light output vector to obtain a second analog output vector; or perform a nonlinear transformation on the third light output vector to obtain a third analog output vector;
[0016] The ADC module is coupled to the optical nonlinear calculation module and is configured to convert the first analog output vector, the second analog output vector, or the third analog output vector into a corresponding digital output vector.
[0017] Preferably, the optical nonlinear calculation module includes a first working area and a third working area that are adjacent to each other, and the input corresponding to the segmentation point between the first working area and the third working area is set as the first preset vector threshold value P0.
[0018] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2].
[0019] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2].
[0020] Preferably, the optical power control signal makes the second optical output vector P12 satisfy: a third preset optical output vector threshold value P3 ≤ each value P in the second optical output vector P12 ij,12 ≤a fourth preset light output vector threshold P4, and the first preset vector threshold P0>the fourth preset light output vector threshold P4.
[0021] Preferably, the working curve feature of the optical nonlinear calculation module further includes a second working area, and the input corresponding to the segmentation point between the second working area and the first working area is set as the second preset vector threshold P0', and P0'<P0; accordingly,
[0022] The optical nonlinear calculation module is further configured to perform a nonlinear transformation on the first light output vector to obtain a fourth simulation vector, or perform a nonlinear transformation on the third light output vector to obtain a fifth simulation vector; or perform a nonlinear transformation on the second light output vector to obtain a sixth simulation vector.
[0023] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P0′∈[P1, P2].
[0024] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold P2, where P0′∈[P1,P2], and P2≤P0.
[0025] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P1≥P0'.
[0026] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P0′∈[P1, P2].
[0027] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13ij,13 ≤ a second preset light output vector threshold P2, where P0′∈[P1,P2], and P2≤P0.
[0028] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤each value P in the first optical output vector P13 ij,13 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P1≥P0'.
[0029] Preferably, the optical power control signal makes the second optical output vector P12 satisfy: a third preset optical output vector threshold value P3 ≤ each value P in the second optical output vector P12 ij,12 ≤ a fourth preset light output vector threshold value P4, and P0′≤P3<P4≤P0.
[0030] A second aspect of the present invention is to provide a method for implementing a neural network algorithm based on the above-mentioned optoelectronic hybrid computing system, which comprises the steps of:
[0031] A controller is used to receive a calculation request, and a corresponding optical power control signal is generated according to a calculation type in the calculation request; the calculation request includes: a digital input vector, a neural network weight and a calculation type; the calculation type includes: linear calculation, nonlinear calculation and hybrid calculation; the hybrid calculation includes nonlinear calculation and linear calculation;
[0032] A DAC module is used to generate a plurality of modulation control signals according to the digital input vector, and when the calculation type is nonlinear calculation, a first weight control signal corresponding to a unit matrix is generated based on the plurality of neural network weights; when the calculation type is linear calculation or hybrid calculation, a second weight control signal corresponding to a preset weight matrix is generated based on the plurality of neural network weights;
[0033] Using the light source module to provide a plurality of first light outputs for hybrid calculation according to the optical power control signal; or provide a plurality of second light outputs for linear calculation; or provide a plurality of third light outputs for nonlinear calculation;
[0034] Using a modulation module to modulate the plurality of first light outputs provided by the light source module according to the modulation control signal to generate a corresponding first light input vector, or to modulate the plurality of second light outputs provided by the light source module to generate a corresponding second light input vector; or to modulate the plurality of third light outputs provided by the light source module to generate a corresponding third light input vector;
[0035] Using an optical matrix multiplication module to convert the plurality of first light input vectors into first light output vectors based on the second weight control signal, or to convert the plurality of second light input vectors into second light output vectors based on the second weight control signal; or to convert the plurality of third light input vectors into third light output vectors based on the first weight control signal;
[0036] Using an optical nonlinear calculation module to perform a nonlinear transformation on the first light output vector to obtain a first analog output vector; or using an optical nonlinear calculation module to perform a nonlinear transformation on the third light output vector to obtain a third analog output vector; or using an optical nonlinear calculation module to directly transform the second light output vector into a second analog output vector;
[0037] An ADC module is used to convert the first analog output vector, the second analog output vector, or the third analog output vector into a corresponding digital output vector.
[0038] Preferably, the first preset vector threshold value P0 is made to correspond to the segmentation point between the first working area and the third working area of the optical nonlinear calculation module; accordingly,
[0039] The optical power control signal makes the first light output vector P11 satisfy: the first preset light output vector threshold P1 ≤ each value P in the first light output vector P11 ij,11 ≤ the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2]; or,
[0040] The optical power control signal makes the second light output vector P12 satisfy: the third preset light output vector threshold P3 ≤ each value P in the second light output vector P12 ij,12 ≤ a fourth preset light output vector threshold value P4, and the fourth preset light output vector threshold value P4 ≤ the first preset vector threshold value P0; or,
[0041] The optical power control signal makes the third light output vector P13 satisfy: the first preset light output vector threshold P1≤ each value P in the first light output vector P13 ij,13 ≤the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2].
[0042] Preferably, the optical nonlinear calculation module further includes a second working area, and the second preset vector threshold P0' corresponds to a segmentation point between the second working area and the first working area, and P0'<P0. Accordingly, the method further includes the steps of:
[0043] Using the optical nonlinear calculation module to perform nonlinear transformation on the first light output vector to obtain a fourth analog output vector;
[0044] Alternatively, the second light output vector is linearly transformed by the optical nonlinear calculation module to obtain a sixth analog output vector;
[0045] Alternatively, the optical nonlinear calculation module is used to perform nonlinear transformation on the third light output vector to obtain a fifth analog output vector.
[0046] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ the second preset light output vector threshold P2, and P0∈[P1,P2], P0'∈[P1,P2].
[0047] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold P2, where P0′∈[P1,P2], and P2≤P0.
[0048] Preferably, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P1≥P0'.
[0049] Preferably, the optical power control signal makes the second optical output vector P12 satisfy: a third preset optical output vector threshold value P3 ≤ each value P in the second optical output vector P12 ij,12 ≤ a fourth preset light output vector threshold P4, and P0′≤P3≤P4≤P0.
[0050] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤ the second preset light output vector threshold P2, and P0∈[P1,P2], P0'∈[P1,P2].
[0051] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13≤ a second preset light output vector threshold P2, where P0′∈[P1,P2], and P2≤P0.
[0052] Preferably, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤each value P in the first optical output vector P13 ij,13 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P1≥P0'.
[0053] Beneficial effects: The optical nonlinear computing module of the present invention has a linear working state and a nonlinear working state. In the linear working state, the first working area of the optical nonlinear computing module is used to perform a linear transformation on the optical output vector output by the optical matrix multiplication module. In the nonlinear working state, at least two different working areas of the optical nonlinear computing module (for example, the first working area and the third working area, or the first working area, the second working area and the third working area, or the first working area and the second working area) are used to perform a nonlinear transformation on the optical output vector output by the optical matrix multiplication module, and based on the distribution characteristics of the segmentation points between the different working areas, such as size and position, the optical power of the input system is reversely regulated, so that the optical output vector input to the optical nonlinear computing module corresponds to its first working area to realize the linear transformation between the optical output vector and the analog output vector, or the input optical output vector corresponds to its at least two working areas (for example, the first working area and the third working area, or the first working area, the second working area and the third working area, or the first working area and the second working area) to realize the nonlinear transformation between the optical input vector and the analog output vector. Compared with the prior art in which a nonlinear calculation module is separately provided to realize linear transformation or nonlinear transformation between analog input vectors, the present invention can realize optical nonlinear calculation without separately providing electronic circuit components. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, each element or part is not necessarily drawn according to the actual scale. Obviously, the drawings described below are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without paying creative labor.
[0055] Figure 1 A functional module diagram of an optoelectronic hybrid computing system of the present invention;
[0056] Figure 2 To reflect the conditions satisfied by the numerical range of the first light output vector P11 or the third light output vector P13 when the optical nonlinear module has one segmentation point and the calculation type is hybrid calculation or nonlinear calculation;
[0057] Figure 3 To reflect the condition satisfied by the numerical range of the second light output vector P12 when the optical nonlinear module has one segmentation point and the calculation type is linear calculation;
[0058] Figure 4 To reflect the conditions satisfied by the numerical range of the first light output vector P11 or the third light output vector P13 when the optical nonlinear module has two segmentation points and the calculation type is hybrid calculation or nonlinear calculation;
[0059] Figure 5 To reflect the conditions satisfied by the numerical range of the second light output vector P12 when the optical nonlinear module has two segmentation points and the calculation type is linear calculation;
[0060] Figure 6 The present invention is a flow chart of a method for realizing a neural network algorithm based on an optoelectronic hybrid computing system. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0062] Herein, suffixes such as "module", "component" or "unit" configured to represent elements are used only to facilitate the description of the present invention, and have no specific meanings by themselves. Therefore, "module", "component" or "unit" can be used mixedly.
[0063] In this document, the terms "upper", "lower", "inner", "outer", "front", "back", "one end", "the other end" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are configured only for descriptive purposes, and cannot be understood as indicating or implying relative importance.
[0064] In this document, unless otherwise clearly specified and limited, the terms "installed", "provided with", "connected", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0065] Herein "and / or" includes any and all combinations of one or more of the associated listed items.
[0066] Herein, "plurality" means two or more than two, ie, it includes two, three, four, five, etc.
[0067] In this article, "linear calculation" means that there is a linear relationship between the input and output of a module or a device. For example, the optical matrix multiplication module implements linear calculation between any preset weight matrix (non-unit matrix) and any multiplicand matrix. For another example, when the output result of the optical matrix multiplication module corresponds to (or covers) any linear working area of the optical nonlinear module, the optical nonlinear calculation module performs linear calculation on the output result of the optical matrix multiplication module.
[0068] In this article, "nonlinear calculation" means: there is a nonlinear relationship between the input and output of a module or a device. For example, when the output result calculated by the optical matrix multiplication module based on the unit matrix and any multiplicand matrix corresponds to (or covers) at least two working areas of the optical nonlinear module, the optical nonlinear calculation module performs nonlinear calculation on the output result of the optical matrix multiplication module. Among them, the at least two working areas can be at least two different linear working areas, or include at least one linear working area, or include at least one nonlinear working area. For example, nonlinear functions such as piecewise functions and S functions.
[0069] In this document, "hybrid computing" means using both the optical matrix multiplication module to perform linear computing tasks and the optical nonlinear module to perform nonlinear computing tasks. For example, the optical matrix multiplication computing module is first used to implement linear computing between any weight matrix (i.e., non-unit matrix) and any multiplicand matrix, and then the optical nonlinear computing module is used to perform nonlinear computing on the output results of the optical matrix multiplication module. When the system performs hybrid computing, the working principle of the optical nonlinear module can refer to the working principle of performing nonlinear computing.
[0070] In this article, "working curve" refers to a curve drawn based on the input and output of a module or a device. If the input and output are in a linear relationship or an approximately linear relationship, the working curve is a straight line or an approximately straight line; if the input and output are in a nonlinear relationship, the working curve includes at least one segmentation point, and the area on both sides of the segmentation point or between the segmentation points is the corresponding working area. For example, piecewise function and S function. Correspondingly, if there is a linear relationship between the input and output in any working area, the working area is called a linear working area; if there is a nonlinear relationship between the input and output in any working area, the working area is called a nonlinear working area.
[0071] Take the PD with one segment point in the working curve as an optical nonlinear calculation module to realize the piecewise function (i.e., nonlinear function) as an example, see Figure 2 , when the light output vector calculated by the optical matrix multiplication module based on the unit matrix and any multiplicand matrix is greater than the first preset vector threshold value P0 (i.e., the light output vector corresponding to the segment point in the working curve), the PD enters the saturation state. At this time, since the light output vector corresponds to the third working area (i.e., the nonlinear working area), no matter how the light output vector changes, the output of the module or the device (e.g., Figure 2 The vertical coordinate (-photocurrent) shown in the figure is a constant value, that is, a nonlinear relationship; when the light output vector of the optical matrix multiplication module is less than or equal to the first preset vector threshold value P0, the PD enters a non-saturated state. Since the light output vector corresponds to the first working area (that is, the linear working area), the output of the module or the device has a linear relationship with the light output vector of the optical matrix multiplication module with a slope of k.
[0072] The present invention reversely regulates the power of the light output of the light source module based on the critical point between different working areas (for example, the linear working area and the nonlinear working area) of the pre-designed optical nonlinear calculation module, so that the light output vector of the optical matrix multiplication module covers the different working areas of the optical nonlinear module (for example, covers or corresponds to the linear working area and the nonlinear working area at the same time), thereby realizing optical nonlinear calculation; or, the light output vector of the optical matrix multiplication module (partially or completely) covers any linear working area, thereby realizing linear calculation.
[0073] Example 1: See Figure 1 , is a functional module diagram of an optoelectronic hybrid computing system of the present invention. Specifically, the optoelectronic hybrid computing system includes:
[0074] The controller is configured to receive a calculation request and generate a corresponding optical power control signal according to a calculation type in the calculation request; wherein the calculation request includes: a digital input vector, a neural network weight and a calculation type; the calculation type includes: linear calculation, nonlinear calculation and hybrid calculation; the hybrid calculation includes nonlinear calculation and linear calculation;
[0075] A DAC module, coupled to the controller, configured to generate a plurality of modulation control signals based on the digital input vector, and to generate a plurality of weight control signals based on the plurality of neural network weights; preferably, when the calculation type is nonlinear calculation, a first weight control signal corresponding to a unit matrix is generated based on the plurality of neural network weights; when the calculation type is linear calculation or hybrid calculation, a second weight control signal corresponding to a preset weight matrix is generated based on the plurality of neural network weights;
[0076] A light source module, coupled to the controller, configured to provide a plurality of first light outputs according to the optical power control signal when the calculation type is a hybrid calculation; or to provide a plurality of second light outputs according to the optical power control signal when the calculation type is a linear calculation; or to provide a plurality of third light outputs according to the optical power control signal when the calculation type is a nonlinear calculation;
[0077] a modulation module, coupled to the light source module and the DAC module, configured to receive and modulate the plurality of first light outputs provided by the light source module according to the modulation control signal to generate a corresponding first light input vector, or to modulate the plurality of second light outputs provided by the light source module to generate a corresponding second light input vector; or to modulate the plurality of third light outputs provided by the light source module to generate a corresponding third light input vector;
[0078] an optical matrix multiplication module, coupled to the modulation module and the DAC module, configured to convert the plurality of first optical input vectors into first optical output vectors based on the second weight control signal, or convert the plurality of second optical input vectors into second optical output vectors based on the second weight control signal; or convert the plurality of third optical input vectors into third optical output vectors based on the first weight control signal;
[0079] an optical nonlinear calculation module, coupled to the optical matrix multiplication module and the ADC module, and configured to perform a nonlinear transformation on the first light output vector to obtain a first analog output vector, or perform a linear transformation on the second light output vector to obtain a second analog output vector; or perform a nonlinear transformation on the third light output vector to obtain a third analog output vector;
[0080] The ADC module is coupled to the optical nonlinear calculation module and is configured to convert the first analog output vector, the second analog output vector, or the third analog output vector into a corresponding digital output vector.
[0081] In some embodiments, the ADC module includes an ADC array; the DAC module includes a first DAC unit and a second DAC unit, and the first and second DAC units are both DAC arrays; wherein the first DAC unit is coupled to the above-mentioned controller and modulation module, and the second DAC unit is coupled to the controller and the optical matrix multiplication module.
[0082] See also Figure 2 The working curve characteristics of the optical nonlinear calculation module include a segmentation point, and a first working area (i.e., a linear working area) and a third working area (i.e., a nonlinear working area) located on both sides of the segmentation point, respectively, wherein the segmentation point is a common point of the two working areas, and the input corresponding to the segmentation point between the first working area and the third working area is set as the first preset vector threshold value P0. Preferably, the optical nonlinear calculation module adopts a photoelectric detection device; accordingly, the segmentation point depends on the design of the photoelectric detection device, and the specific distribution position of the segmentation point can be designed in advance according to the actual calculation requirements.
[0083] In this embodiment, once the optical nonlinear module is selected, the number of its working areas, the position of the segmentation point between two adjacent working areas, and the corresponding input size are already clear (for example, can be obtained from its device attribute information). Therefore, once the calculation type is determined, it is necessary to adjust the optical power of the light output of the light source module so that each value in the light output vector of the optical matrix multiplication module (i.e., as the input of the optical nonlinear module) corresponds to the working area on one side of the segmentation point, or corresponds to the working area on the other side of the segmentation point.
[0084] After the optical nonlinear calculation module is selected, its corresponding nonlinear function (for example, piecewise function or S function) can be obtained according to the working curve characteristics formed by its different working areas, and the maximum and minimum values of the optical power of the system, the minimum and maximum values of the weight, and the maximum and minimum values of the modulation signal are all known. Therefore, the maximum value Pmax and the minimum value Pmin of the output result of the matrix multiplication module can be calculated in advance, so that the size of the optical power control signal can be obtained according to the distribution position of the segmentation point and the maximum value Pmax and the minimum value Pmin (the specific calculation method is the conventional technical means in this field and will not be repeated here), so that the output result of the matrix multiplication module covers at least one working area of the optical nonlinear calculation module.
[0085] Specifically, if the calculation type is linear calculation, a corresponding optical power control signal is generated based on the segment point distribution position of the optical nonlinear module and the size of its corresponding input, so that the light source module generates a corresponding light output according to the optical power control signal, and the light output makes each value of the light output vector finally output by the optical matrix multiplication module correspond to the first working area, that is, the linear working area;
[0086] Similarly, if it is a hybrid calculation or nonlinear calculation, the controller generates a corresponding optical power control signal based on the segmentation point distribution position of the optical nonlinear module and the size of its corresponding input, so that the light source module generates a corresponding light output according to the optical power control signal, and the light output makes the light output vector finally output by the optical matrix multiplication module correspond to different working areas on both sides of the segmentation point, that is, some of the values correspond to the working area on one side of the segmentation point, and the other values correspond to the working area on the other side of the segmentation point.
[0087] For example, a photodiode (PD for short) is used as the optical nonlinear calculation module, and the corresponding piecewise function is determined according to the PD corresponding working curve (including the adjacent first working area and the third working area, and the first working area is a linear working area, and the third working area is a linear working area with a constant output value). Taking nonlinear calculation as an example, k is the slope of the first working area of PD, A is a constant value corresponding to the third working area (or a curve of gradual regional saturation); b is a constant; g(x)=X·I, wherein X is the optical input vector of the optical matrix multiplication module, and I is the unit matrix. Therefore, once the optical power of the optical output vector input to PD>P0, PD enters a nonlinear working state (that is, PD enters a saturation state), that is, no matter how the optical output vector input to it by the optical matrix multiplication module changes, the photocurrent output by PD is a constant (that is, there is a nonlinear relationship between the optical input vector and the PD output; and when the optical power of the optical output vector input to PD≤P0, PD enters a linear working state, that is, there is a linear relationship between the optical current output by PD and the optical input vector input to it by the optical matrix multiplication module.
[0088] Another example is the nonlinear function Take hybrid calculation as an example, where m(x)=X·W, X is the optical output vector of the input optical matrix multiplication module, and W is the preset weight matrix of the input optical matrix multiplication module; that is, the optical matrix multiplication module is first used to perform linear calculations, and then the optical nonlinear module is used to perform nonlinear calculations on the optical output vector calculated by the optical matrix multiplication module. Specifically, when the optical power of the optical output vector input to the PD>P0, the PD enters a saturated state, that is, no matter how the optical output vector input to it by the optical matrix multiplication module changes, the photocurrent output by the PD is a constant (or, it shows a trend of gradually tending to saturation); and when the optical power of the optical output vector input to the PD is ≤P0, the PD enters a non-saturated state, that is, the photocurrent output by the PD is linearly related to the optical input vector input to it by the optical matrix multiplication module.
[0089] For another example, taking the linear calculation based on the corresponding working curve of the PD to determine the corresponding linear function f(g(x))=kg(x)+b as an example, wherein k is the first working area of the PD, that is, the slope of the linear working area; b is a constant; g(x)=X·W, wherein X is the light input vector of the input light matrix multiplication module, and W is a preset weight matrix (that is, a non-unit matrix); once the optical power of the light output of the input PD is ≤P0, the PD performs a linear transformation on it, that is, the photocurrent output by the PD is linearly related to the light output vector input to it by the light matrix multiplication module.
[0090] In some embodiments, when the calculation type is hybrid calculation, the first light output vector P11 obtained by linear calculation using the light matrix multiplication module is actually an array, that is, multiple values. ij,11 ∈[P1, P2] (also simply referred to as: first light output vector P11∈[P1, P2]), wherein P1 and P2 are the first preset light output vector threshold and the second preset light output vector threshold, respectively.
[0091] See also Figure 2 , the first light output vector P11 satisfies: P0∈[P1,P2], that is, a part of the values in the first light output vector P11∈[P1,P0], and the other part∈(P0,P2]; accordingly, the nonlinear calculation specifically includes:
[0092] When P0<P ij,11 ≤P2, the value P ij,11 Corresponding to the third working area (i.e., nonlinear working area) of the optical nonlinear calculation module, that is, the output of the optical nonlinear calculation module is a constant value, at this time, the optical nonlinear calculation module sets the value P ij,11 Perform nonlinear transformations;
[0093] When P1≤P ij,11≤P0, when the value P ij,11 Corresponding to the first working area of the optical nonlinear calculation module, that is, the linear working area, at this time, the optical nonlinear calculation module converts the value P ij,11 Perform a linear transformation.
[0094] That is, when the first light output vector P11∈[P1, P2], and [P1, P2] covers the first working area and the third working area, the optical nonlinear calculation module actually performs nonlinear calculation on the first light output vector P11 to finally obtain the first simulated output vector.
[0095] Similarly, if nonlinear calculation is used, the third light output vector P13 calculated by the optical matrix multiplication module based on the unit matrix and any multiplicand matrix is actually an array, that is, multiple values. Let any value P in the third light output vector P13 be ij,11 ∈[P1, P2] (also referred to as: the third light output vector P13∈[P1, P2]), wherein P1 and P2 are respectively the first preset light output vector threshold and the second preset light output vector threshold; and the third light output vector P13 satisfies: P0∈[P1, P2]; accordingly, the nonlinear calculation specifically includes:
[0096] When P0<P ij,13 ≤P2, the value P ij,13 Corresponding to the third working area of the optical nonlinear calculation module, that is, the nonlinear working area, at this time, the optical nonlinear calculation module converts the value P ij,13 Perform nonlinear transformations;
[0097] When P1≤P ij,13 ≤P0, when the value P ij,13 Corresponding to the nonlinear working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,13 Perform a linear transformation.
[0098] That is, when the third light output vector P13∈[P1, P2], and [P1, P2] covers different working areas: the first working area and the third working area, the optical nonlinear calculation module performs nonlinear calculation on the third light output vector P13, and finally obtains the third simulated output vector.
[0099] In some embodiments, when the calculation type is linear calculation, the second output vector P12 obtained by the optical matrix multiplication module through linear calculation based on the preset weight matrix and any multiplicand matrix is actually an array, that is, multiple values. ij,12∈[P3, P4] (also simply referred to as: second light output vector P12∈[P3, P4]), wherein P3 and P4 are the third preset light output vector threshold and the fourth preset light output vector threshold, respectively.
[0100] See also Figure 3 , the second light output vector P13 satisfies: P3≤P ij,12 ≤P4, and P4<P0; accordingly, any value P in the second light output vector P13 ij,12 Corresponding to the first working area of the optical nonlinear calculation module, that is, the linear working area, at this time, the optical nonlinear calculation module converts the value P ij,12 Perform a linear transformation.
[0101] That is, when the second light output vector P12∈[P3, P4], and [P3, P4] corresponds to the linear working area, the optical nonlinear calculation module performs a linear transformation on the second light output vector P12 to finally obtain a second analog output vector.
[0102] In other embodiments, the working curve of the optical nonlinear module may also include multiple nonlinear working regions and / or linear working regions.
[0103] Embodiment 2: The present invention also provides another optoelectronic computing system, which includes the modules in the above-mentioned embodiment 1, and the working principles of the modules are the same. The difference is that the optical nonlinear module of this embodiment includes a second working area in addition to the first working area (which is a linear working area) and the third working area, and the second working area and the third working area are respectively located on both sides of the first working area, and the segmentation point between the first working area and the third working area corresponds to the first preset vector threshold value P0, and the segmentation point between the first working area and the second working area corresponds to the second preset vector threshold value P0', and P0'<P0, see Figure 4 and Figure 5 .
[0104] Preferably, the optical nonlinear calculation module uses a photoelectric detection device, such as PD. More preferably, the above two segmentation points depend on the design of the photoelectric detection device, and the specific distribution positions of the two segmentation points can be designed in advance according to actual calculation requirements.
[0105] In some embodiments, as described above, any value P in the first light output vector P11 output by the light matrix multiplication module is ij,11 ∈[P1, P2] (abbreviated as, the first light output vector P11∈[P1, P2], wherein P1 and P2 are respectively the first preset light output vector threshold and the second preset light output vector threshold.
[0106] See also Figure 4 and Figure 5 , if the calculation type is hybrid calculation, the first light output vector P11 obtained by using the optical matrix multiplication module to perform linear calculation of the preset weight matrix (non-unit matrix) and the multiplicand matrix satisfies: P0∈[P1,P2], and P0'∈[P1,P2], that is, a part of the values in the first light output vector P11∈[P1,P0'], another part∈(P0',P0], and the remaining part∈(P0,P2]; accordingly,
[0107] When P1<P ij,11 ≤P0', the value P ij,11 Corresponding to the second working area of the optical nonlinear calculation module, since the output corresponding to the second working area is a constant value, the optical nonlinear calculation module sets the value P ij,11 Perform nonlinear transformation to a constant value;
[0108] When P0<P ij,11 ≤P2, the value P ij,11 Corresponding to the third working area of the optical nonlinear calculation module, since the output corresponding to the third working area is a constant value, the optical nonlinear calculation module sets the value P ij,11 Perform nonlinear transformations;
[0109] When P0'<P ij,11 ≤P0, the value P ij,11 Corresponding to the first working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,11 Perform a linear transformation.
[0110] That is, when the first light output vector P11∈[P1, P2], and [P1, P2] covers the first working area, the second working area and the third working area, the optical nonlinear calculation module performs nonlinear processing on the first light output vector P11 and finally obtains the fourth simulated output vector.
[0111] In other embodiments, if the calculation type is a hybrid calculation, and the first light output vector P11 obtained by performing a linear calculation of a preset weight matrix and a multiplicand matrix using an optical matrix multiplication module satisfies: P0'∈[P1,P2], and P2<P0, then a part of the values in the first light output vector P11 ∈[P1,P0'], and another part ∈(P0',P2]; accordingly,
[0112] When P1<P ij,11 ≤P0', the value P ij,11 Corresponding to the second working area of the optical nonlinear calculation module, that is, the nonlinear working area, at this time, the optical nonlinear calculation module converts the value P ij,11 Perform nonlinear transformations;
[0113] When P0'<P ij,11 ≤P2, the value P ij,11 Corresponding to the first working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,11 Perform a linear transformation.
[0114] That is, when the first light output vector P11∈[P1, P2], and [P1, P2] covers the first working area and the second working area, the optical nonlinear calculation module performs nonlinear calculation on the first light output vector P11 to finally obtain the fourth simulated output vector.
[0115] In other embodiments, if the calculation type is a hybrid calculation, and the first light output vector P11 obtained by performing a linear calculation of a preset weight matrix and a multiplicand matrix using an optical matrix multiplication module satisfies: P0'∈[P1,P2], and P0'<P1<P0<P2, then a part of the values in the first light output vector P11 ∈[P1,P0], and another part ∈(P0,P2]; accordingly,
[0116] When P0<P ij,11 ≤P2, the value P ij,11 Corresponding to the third working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,11 Perform nonlinear transformations;
[0117] When P1<P ij,11 ≤P0, the value P ij,11 Corresponding to the first working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,11 Perform a linear transformation.
[0118] That is, when the first light output vector P11∈[P1, P2], and [P1, P2] covers the first working area and the third working area, the optical nonlinear calculation module performs nonlinear calculation on the first light output vector P11 to finally obtain the fourth simulated output vector.
[0119] Similarly, if the calculation type is nonlinear calculation, you can refer to the mixed calculation. Specifically, the third optical output vector P13 obtained by using the optical matrix multiplication module to perform linear calculations on the unit matrix and the multiplicand matrix satisfies: P13∈[P1,P2], and [P1,P2] covers the first working area, the second working area and the third working area. The optical nonlinear calculation module performs nonlinear calculations on the third light output vector P13, and finally obtains the fifth analog output vector.
[0120] For example, a photodiode (PD) is used as the optical nonlinear calculation module, and the corresponding piecewise function is determined according to the corresponding working curve of the PD. Take nonlinear calculation as an example, where k is the slope corresponding to the first working area of the PD, A1 and A2 are constant values corresponding to the second working area and the third working area, respectively. Therefore, when the optical output vector obtained by performing linear calculation of the unit matrix and the multiplicand matrix using the optical matrix multiplication module, that is, the optical power of the optical output vector input to the PD is <P0', or >P0, the PD enters a dark current state or a saturation state, that is, no matter how the optical input vector input to it by the optical matrix multiplication module changes, the photocurrent output by the PD is a constant (or, it shows a trend of gradually tending to dark current output or saturated output); and when the optical power of the optical output vector input to the PD is ≤P0 and ≥P0', the PD enters a non-saturated state, that is, the photocurrent output by the PD is linearly related to the optical output vector input to it by the optical matrix multiplication module.
[0121] Alternatively, the third optical output vector satisfies: P13∈[P1,P2], and [P1,P2] covers (partially or completely) the first working area and the third working area, and the optical nonlinear calculation module is in a nonlinear working state, so the third light output vector P13 is nonlinearly processed to finally obtain the fifth analog output vector.
[0122] Alternatively, when the third light output vector satisfies: P13∈[P1,P2], and [P1,P2] covers the first working area and the second working area, the optical nonlinear calculation module is in a nonlinear working state, and thus the third light output vector P13 is nonlinearly processed to finally obtain the fifth analog output vector.
[0123] See also Figure 5 , if the calculation type is linear calculation, and the optical matrix multiplication module is used to perform linear calculation of the preset weight matrix (i.e., non-unit matrix) and the multiplicand matrix to obtain the second optical output vector P12∈[P3,P4], let any value P in the second optical output vector P12 be ij,12 ∈[P3,P4] (in short, the second light output vector P12∈[P3,P4], and the second light output vector satisfies: P0'≤P3<P4≤P0, that is, all values in the second light output vector P12∈[P0',P0]; accordingly, the value P ij,11 Corresponding to the first working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module is in a linear working state, so the value P ij,11 Perform a linear transformation to obtain a second analog output vector.
[0124] Embodiment 3: Based on the above-mentioned optoelectronic hybrid computing system, the present invention also provides a method for implementing a neural network algorithm, see Figure 6 , the method specifically comprises the steps of:
[0125] S101 uses a controller to receive a calculation request, and generates a corresponding optical power control signal according to the calculation type in the calculation request, and executes steps S103 and S105.
[0126] In some embodiments, the above-mentioned calculation request includes: a digital input vector, a neural network weight and a calculation type; wherein the calculation type includes: linear calculation, nonlinear calculation and hybrid calculation; and the hybrid calculation includes nonlinear calculation and linear calculation.
[0127] S103 utilizes the DAC module to generate multiple modulation control signals according to the above digital input vector, and generates multiple weight control signals based on the above multiple neural network weights, and executes step S107.
[0128] In some embodiments, when the calculation type is nonlinear calculation, a first weight control signal corresponding to a unit matrix is generated based on multiple neural network weights; when the calculation type is linear calculation or mixed calculation, a second weight control signal corresponding to a preset weight matrix is generated based on multiple neural network weights.
[0129] S105: Using the light source module to provide multiple first light outputs configured for hybrid calculation according to the optical power control signal; or provide multiple second light outputs configured for linear calculation; or provide multiple third light outputs configured for nonlinear calculation, and executing step S107.
[0130] S107 utilizes the modulation module to modulate the multiple first light outputs provided by the light source module in step S105 according to the modulation control signal generated in step S103 to generate corresponding first light input vectors, or modulates the multiple second light outputs to generate corresponding second light input vectors; or modulates the multiple third light outputs to generate corresponding third light input vectors, and executes step S109.
[0131] S109 utilizes the optical matrix multiplication module to convert the multiple first optical input vectors in step S107 into first optical output vectors, or convert the multiple second optical input vectors into second optical output vectors, or convert the multiple third optical input vectors into third optical output vectors based on the weight control signal generated in step S103, and executes step S111.
[0132] In some embodiments, when the calculation type is hybrid calculation, the optical matrix multiplication module converts the plurality of first optical input vectors into first optical output vectors based on the second weight control signal, that is, the optical matrix multiplication module performs a linear calculation between any preset weight matrix and any multiplicand matrix;
[0133] When the calculation type is linear calculation, the optical matrix multiplication module converts the plurality of second optical input vectors into second optical output vectors based on the second weight control signal, that is, the optical matrix multiplication module performs a linear calculation between any preset weight matrix and any multiplicand matrix;
[0134] When the calculation type is nonlinear calculation, the optical matrix multiplication module converts multiple third optical input vectors into third optical output vectors based on the first weight control signal, that is, the optical matrix multiplication module performs calculations between the unit matrix and any multiplicand matrix.
[0135] In some embodiments, the first light output vector P11 and the third light output vector P13 satisfy: P1≤each value P in P11 ij,11 (or each value P in P13 ij,13 )≤P2, and the first preset vector threshold P0∈[P1,P2], wherein P1 and P2 are the first preset light output vector threshold and the second preset light output vector threshold, respectively. Wherein, P0 corresponds to the segmentation point between the first working area and the third working area of the optical nonlinear calculation module.
[0136] When P1≤P ij,11 ≤P0, or P1≤P ij,13 When ≤P0, P ij,11 or P ij,13 Corresponding to the first working area of the optical nonlinear calculation module; that is, the optical nonlinear calculation module sets the value P ij,11 or P ij,13 Perform linear transformation; when P0<P ij,11 ≤P2, or P0<P ij,13 When ≤P2, P ij,11 or P ij,13 Corresponding to the third working area of the optical nonlinear calculation module; that is, the optical nonlinear calculation module converts the value P ij,11 or P ij,13 Perform nonlinear transformation.
[0137] That is, when the first light output vector P11∈[P1, P2], and [P1, P2] covers the first working area and the third working area, the optical nonlinear calculation module performs nonlinear processing on the first light output vector P11, and finally obtains the first simulated output vector (ie, step S111).
[0138] Similarly, if nonlinear calculation is performed, the third light output vector P13 is actually an array, that is, a plurality of values. Let any value P in the third light output vector P13 be ij,11∈[P1,P2] (also referred to as: the third light output vector P13∈[P1,P2]), wherein P1 and P2 are the first preset light output vector threshold and the second preset light output vector threshold, respectively; and the third light output vector P13 satisfies: P0∈[P1,P2]; and
[0139] When P0<P ij,13 ≤P2, the value P ij,13 Corresponding to the third working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,13 Perform nonlinear transformations;
[0140] When P1≤P ij,13 ≤P0, when the value P ij,13 Corresponding to the first working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,13 Perform a linear transformation.
[0141] That is, when the third light output vector P13∈[P1, P2], and [P1, P2] covers the first working area and the third working area, the optical nonlinear calculation module performs nonlinear processing on the third light output vector P13 to finally obtain a third simulated output vector.
[0142] In some embodiments, when the calculation type is linear calculation, the second output vector P12 is actually an array, that is, a plurality of values. ij,12 ∈[P3, P4] (also simply referred to as: second light output vector P12∈[P3, P4]), wherein P3 and P4 are the third preset light output vector threshold and the fourth preset light output vector threshold, respectively.
[0143] See also Figure 3 , the second light output vector P13 must satisfy: P3≤P ij,12 ≤P4, and P4<P0; accordingly, any value P in the second light output vector P13 ij,12 Corresponding to the first working area of the optical nonlinear calculation module, at this time, the optical nonlinear calculation module converts the value P ij,12 Perform a linear transformation.
[0144] That is, when the second light output vector P12∈[P3, P4], and [P3, P4] corresponds to the linear working area, the optical nonlinear calculation module performs linear processing on the second light output vector P12 to finally obtain the second analog output vector.
[0145] S111 uses an optical nonlinear calculation module to perform a nonlinear transformation on the first light output vector in step S109 to obtain a first analog output vector; or uses an optical nonlinear calculation module to perform a nonlinear transformation on the third light output vector in step S109 to obtain a third analog output vector; or uses an optical nonlinear calculation module to directly convert the second light output vector into a second analog output vector, and executes step S113.
[0146] S113 uses an ADC module to convert the first analog output vector or the second analog output vector or the third analog output vector into a corresponding digital output vector.
[0147] Embodiment 4: Based on the above-mentioned optoelectronic hybrid computing system, the present invention further provides another optoelectronic hybrid computing method, which includes the steps in the above-mentioned embodiment 3, except that the optical nonlinear module in this embodiment includes: a first working area, a second working area and a third working area, and the second working area and the third working area are respectively located on both sides of the first working area. If the first preset vector threshold P0 corresponds to the segmentation point between the first working area and the third working area, and the second preset vector threshold P0' corresponds to the segmentation point between the second working area and the first working area (P0'<P0), then correspondingly:
[0148] In step S111, the first light output vector in step S109 is nonlinearly transformed by using an optical nonlinear calculation module to obtain a fourth analog output vector; or, the third light output vector in step S109 is nonlinearly transformed by using an optical nonlinear calculation module to obtain a fifth analog output vector; or, the second light output vector is directly converted into a sixth analog output vector by using an optical nonlinear calculation module; and the light output vector obtained by the optical matrix multiplication module in step S109 satisfies:
[0149] When the calculation type is mixed calculation, the first light output vector P11 calculated by the optical matrix multiplication module based on the preset weight matrix and any multiplicand matrix satisfies: the first preset light output vector threshold P1≤each value in the first light output vector P11≤the second preset light output vector threshold P2, and P0∈[P1,P2], P0'∈[P1,P2].
[0150] When the calculation type is linear calculation, the second light output vector P12 calculated by the optical matrix multiplication module based on the preset weight matrix and any multiplicand matrix satisfies: the third preset light output vector threshold P3≤each value in the second light output vector P12≤the fourth preset light output vector threshold P4, and P0'≤P3≤P4≤P0.
[0151] When the calculation type is nonlinear calculation, the third light output vector P13 calculated by the optical matrix multiplication module based on the unit matrix and any multiplicand matrix satisfies: the first preset light output vector threshold P1≤each value in the third light output vector P13≤the second preset light output vector threshold P2, and P0∈[P1,P2], P0'∈[P1,P2].
[0152] Of course, in other embodiments, when the calculation type is a mixed calculation, the first light output vector P11 satisfies: the first preset light output vector threshold P1≤each value in the first light output vector P11≤the second preset light output vector threshold P2, and P0'∈[P1,P2], P2≤P0; or, the first light output vector P11 satisfies: the first preset light output vector threshold P1≤each value in the first light output vector P11≤the second preset light output vector threshold P2, and P0∈[P1,P2], P0'≤P1.
[0153] Similarly, in other embodiments, when the calculation type is nonlinear calculation, the third light output vector P13 satisfies: each value in the first preset light output vector threshold P1≤P13 ≤ the second preset light output vector threshold P2, and P0'∈[P1,P2], P2≤P0; or, P13 satisfies: each value in the first preset light output vector threshold P1≤P13 ≤ the second preset light output vector threshold P2, and P0∈[P1,P2], P0'≤P1.
[0154] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0155] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a computer terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0156] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. An optoelectronic hybrid computing system, characterized in that: include: A controller is configured to receive a calculation request and generate a corresponding optical power control signal according to a calculation type in the calculation request; The calculation request includes: a digital input vector, a neural network weight and a calculation type; the calculation type includes: linear calculation, nonlinear calculation and hybrid calculation; the hybrid calculation includes linear calculation and nonlinear calculation; a DAC module, coupled to the controller, configured to generate a plurality of modulation control signals based on the digital input vector, and when the calculation type is nonlinear calculation, generate a first weight control signal corresponding to a unit matrix based on the plurality of neural network weights; when the calculation type is linear calculation or hybrid calculation, generate a second weight control signal corresponding to a preset weight matrix based on the plurality of neural network weights; a light source module, coupled to the controller, configured to provide a plurality of first light outputs according to the optical power control signal when the calculation type is a hybrid calculation; or to provide a plurality of second light outputs according to the optical power control signal when the calculation type is a linear calculation; or to provide a plurality of third light outputs according to the optical power control signal when the calculation type is a nonlinear calculation; a modulation module, coupled to the light source module and the DAC module, configured to receive and modulate the plurality of first light outputs provided by the light source module according to the modulation control signal to generate a corresponding first light input vector, or to modulate the plurality of second light outputs provided by the light source module to generate a corresponding second light input vector; or to modulate the plurality of third light outputs provided by the light source module to generate a corresponding third light input vector; an optical matrix multiplication module, coupled to the modulation module and the DAC module, configured to convert the plurality of first optical input vectors into first optical output vectors based on the second weight control signal, or convert the plurality of second optical input vectors into second optical output vectors based on the second weight control signal; or convert the plurality of third optical input vectors into third optical output vectors based on the first weight control signal; an optical nonlinear calculation module, coupled to the optical matrix multiplication module and the ADC module, and configured to perform a nonlinear transformation on the first light output vector to obtain a first analog output vector; or perform a linear transformation on the second light output vector to obtain a second analog output vector; or perform a nonlinear transformation on the third light output vector to obtain a third analog output vector; The ADC module is coupled to the optical nonlinear calculation module and is configured to convert the first analog output vector, the second analog output vector, or the third analog output vector into a corresponding digital output vector.
2. The optoelectronic hybrid computing system according to claim 1, characterized in that: The optical nonlinear calculation module includes a first working area and a third working area adjacent to each other, and the input corresponding to the segmentation point between the first working area and the third working area is set as the first preset vector threshold value P0; accordingly, The optical power control signal makes the first light output vector P11 satisfy: the first preset light output vector threshold P1 ≤ each value P in the first light output vector P11 ij,11 ≤ a second preset light output vector threshold value P2, and the first preset vector threshold value P0∈[P1,P2]; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2].
3. The optoelectronic hybrid computing system according to claim 2, characterized in that: The optical power control signal makes the second light output vector P12 satisfy: the third preset light output vector threshold P3 ≤ each value P in the second light output vector P12 ij,12 ≤a fourth preset light output vector threshold P4, and the first preset vector threshold P0>the fourth preset light output vector threshold P4.
4. The optoelectronic hybrid computing system according to claim 2, characterized in that: The working curve characteristics of the optical nonlinear calculation module also include a second working area, and the input corresponding to the segmentation point between the second working area and the first working area is set as the second preset vector threshold P0', and P0'<P0; accordingly, The optical nonlinear calculation module is further configured to perform a nonlinear transformation on the first light output vector to obtain a fourth simulation vector, or perform a nonlinear transformation on the third light output vector to obtain a fifth simulation vector; or perform a nonlinear transformation on the second light output vector to obtain a sixth simulation vector.
5. The optoelectronic hybrid computing system according to claim 4, characterized in that: The optical power control signal makes the first light output vector P11 satisfy: the first preset light output vector threshold P1 ≤ each value P in the first light output vector P11 ij,11 ≤ a second preset light output vector threshold value P2, where P0∈[P1,P2], and P0′∈[P1,P2]; Alternatively, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold value P2, where P0′∈[P1,P2], and P2≤P0; Alternatively, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold value P2, where P0∈[P1,P2], and P1≥P0'; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤ a second preset light output vector threshold value P2, where P0∈[P1,P2], and P0′∈[P1,P2]; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤ a second preset light output vector threshold value P2, where P0′∈[P1,P2], and P2≤P0; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the first optical output vector P13 ij,13 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P1≥P0'.
6. The optoelectronic hybrid computing system according to claim 5, characterized in that: The optical power control signal makes the second light output vector P12 satisfy: the third preset light output vector threshold P3 ≤ each value P in the second light output vector P12 ij,12 ≤ a fourth preset light output vector threshold value P4, and P0′≤P3<P4≤P0.
7. A method for implementing a neural network algorithm, characterized in that: include: Using a controller to receive a calculation request, and generating a corresponding optical power control signal according to a calculation type in the calculation request; The calculation request includes: a digital input vector, a neural network weight and a calculation type; the calculation type includes: linear calculation, nonlinear calculation and hybrid calculation; the hybrid calculation includes nonlinear calculation and linear calculation; A DAC module is used to generate a plurality of modulation control signals according to the digital input vector, and when the calculation type is nonlinear calculation, a first weight control signal corresponding to a unit matrix is generated based on the plurality of neural network weights; when the calculation type is linear calculation or hybrid calculation, a second weight control signal corresponding to a preset weight matrix is generated based on the plurality of neural network weights; Using the light source module to provide a plurality of first light outputs for hybrid calculation according to the optical power control signal; or provide a plurality of second light outputs for linear calculation; or provide a plurality of third light outputs for nonlinear calculation; Using a modulation module to modulate the plurality of first light outputs provided by the light source module according to the modulation control signal to generate a corresponding first light input vector, or to modulate the plurality of second light outputs provided by the light source module to generate a corresponding second light input vector; or to modulate the plurality of third light outputs provided by the light source module to generate a corresponding third light input vector; Using an optical matrix multiplication module to convert the plurality of first light input vectors into first light output vectors based on the second weight control signal, or to convert the plurality of second light input vectors into second light output vectors based on the second weight control signal; or to convert the plurality of third light input vectors into third light output vectors based on the first weight control signal; Using an optical nonlinear calculation module to perform a nonlinear transformation on the first light output vector to obtain a first analog output vector; or using an optical nonlinear calculation module to perform a nonlinear transformation on the third light output vector to obtain a third analog output vector; or using an optical nonlinear calculation module to directly transform the second light output vector into a second analog output vector; An ADC module is used to convert the first analog output vector, the second analog output vector, or the third analog output vector into a corresponding digital output vector.
8. A method for implementing a neural network algorithm according to claim 7, characterized in that: Let the first preset vector threshold value P0 correspond to the segmentation point between the first working area and the third working area of the optical nonlinear calculation module; accordingly, The optical power control signal makes the first light output vector P11 satisfy: the first preset light output vector threshold P1 ≤ each value P in the first light output vector P11 ij,11 ≤ the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2]; or, The optical power control signal makes the second light output vector P12 satisfy: the third preset light output vector threshold P3 ≤ each value P in the second light output vector P12 ij,12 ≤ a fourth preset light output vector threshold value P4, and the fourth preset light output vector threshold value P4 ≤ the first preset vector threshold value P0; or, The optical power control signal makes the third light output vector P13 satisfy: the first preset light output vector threshold P1≤ each value P in the first light output vector P13 ij,13 ≤the second preset light output vector threshold P2, and the first preset vector threshold P0∈[P1,P2].
9. A method for implementing a neural network algorithm according to claim 8, characterized in that: The optical nonlinear calculation module further includes a second working area, and a second preset vector threshold P0' corresponds to a segmentation point between the second working area and the first working area, and P0'<P0. Accordingly, the method further includes the steps of: Using the optical nonlinear calculation module to perform nonlinear transformation on the first light output vector to obtain a fourth analog output vector; Alternatively, the second light output vector is linearly transformed by the optical nonlinear calculation module to obtain a sixth analog output vector; Alternatively, the optical nonlinear calculation module is used to perform nonlinear transformation on the third light output vector to obtain a fifth analog output vector.
10. A method for implementing a neural network algorithm according to claim 9, characterized in that: The optical power control signal makes the first light output vector P11 satisfy: the first preset light output vector threshold P1 ≤ each value P in the first light output vector P11 ij,11 ≤ the second preset light output vector threshold value P2, and P0∈[P1,P2], P0'∈[P1,P2]; Alternatively, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold value P2, where P0′∈[P1,P2], and P2≤P0; Alternatively, the optical power control signal makes the first optical output vector P11 satisfy: the first preset optical output vector threshold P1 ≤ each value P in the first optical output vector P11 ij,11 ≤ a second preset light output vector threshold value P2, where P0∈[P1,P2], and P1≥P0'; Alternatively, the optical power control signal makes the second optical output vector P12 satisfy: the third preset optical output vector threshold value P3 ≤ each value P in the second optical output vector P12 ij,12 ≤ fourth preset light output vector threshold value P4, and P0'≤P3≤P4≤P0; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤ the second preset light output vector threshold value P2, and P0∈[P1,P2], P0'∈[P1,P2]; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the third optical output vector P13 ij,13 ≤ a second preset light output vector threshold value P2, where P0′∈[P1,P2], and P2≤P0; Alternatively, the optical power control signal makes the third optical output vector P13 satisfy: the first preset optical output vector threshold P1≤ each value P in the first optical output vector P13 ij,13 ≤ a second preset light output vector threshold P2, where P0∈[P1, P2], and P1≥P0'.
Citation Information
Patent Citations
Apparatus and methods for optical neural network
CN109477938A
Optoelectronic computing systems
CN112424796A