Optical computing devices, methods, apparatuses, and storage media
By decomposing the matrix into submatrices and weight vectors and configuring the phase difference in the optical computing array, the problems of high power consumption and information loss in existing optical processors are solved, and efficient optical computing is achieved.
Patent Information
- Application Number
- CN202511430077.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-30
AI Technical Summary
In existing technologies, optical processors based on MZI require singular value decomposition and element scaling of the real-valued matrix when performing real-valued matrix multiplication, resulting in high energy consumption and information loss.
By decomposing the target matrix into submatrices and weight vectors, configuring the phase difference of optical computing units in the optical computing array based on the submatrix element attributes, and configuring the phase in the optical computing array based on the target vector element attributes, the multiplication calculation of the target vector and the target matrix is realized.
This reduces the complexity of optical computing unit configuration, avoids information loss, and improves optical computing efficiency.
Smart Images

Figure CN120909395B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of optical computing technology, and in particular to an optical computing device, method, apparatus and storage medium. Background Technology
[0002] In related technologies, optical processors built around MZI as the core have the following problems when performing multiplication operations on real-valued matrices: (1) The real-valued matrix needs to be decomposed into singular values to obtain two unitary matrices and a diagonal matrix, and then a triangular or rectangular MZI array is constructed to represent the unitary matrix and the diagonal matrix respectively to characterize the real-valued matrix; (2) Each element of the real-valued matrix needs to be scaled to [0, 1]. The above problems will lead to high processor power consumption, and scaling the elements of the real-valued matrix will lead to information loss. Summary of the Invention
[0003] This application aims to at least partially address one of the technical problems in the related art.
[0004] In a first aspect, this application proposes an optical computing device, the device comprising: a processor, configured to acquire a target vector and a target matrix to be multiplied; the processor is further configured to decompose the target matrix to obtain at least one submatrix and a weight vector; wherein the submatrix is a Boolean matrix; the processor is further configured to determine, based on the element attributes of the matrix elements in the submatrix, a first target optical computing unit corresponding to each matrix element in a corresponding optical computing array; wherein each submatrix corresponds to an optical computing array, and each matrix element in the submatrix corresponds to an optical computing unit; the processor is further configured to determine, based on the element attributes of the vector elements in the target vector, a second target optical computing unit corresponding to each vector element in a respective optical computing array; a modulator, configured to modulate the phase difference of the first target optical computing unit, and to modulate the phase of the second target optical computing unit based on the element attributes of each vector element; a laser, configured to generate an optical signal; the optical computing array, configured to receive the optical signal and output a corresponding optical computing result; the processor is further configured to perform a weighted calculation on the optical computing result based on the weight vector to obtain a calculation result vector of the target vector and the target matrix.
[0005] In one implementation, the processor is specifically used for matrix elements in the submatrix: based on the element attributes of the non-zero elements in the submatrix, determining the first target optical computing unit corresponding to the non-zero element in the corresponding optical computing array; wherein, the element attributes include element position and / or element value; the modulator is specifically used for: configuring the phase difference of the first target optical computing unit to 0 or .
[0006] In one implementation, the processor is specifically configured to: for each vector element, determine the target phase corresponding to the vector element; for each vector element, determine the second target optical computing unit corresponding to the vector element in each optical computing array based on the element attributes of the vector element; wherein, the element attributes include element position and / or element value; the modulator is specifically configured to: for each vector element, perform phase modulation on the corresponding second target optical computing unit based on the element value of the vector element.
[0007] In one implementation, each of the optical computing arrays includes A groups of optical computing units, each group of optical computing units includes B parallel optical computing units, A is greater than or equal to the number of columns of the corresponding submatrix, B is greater than or equal to the number of rows of the corresponding submatrix, and each group of optical computing units corresponds to a column element in the submatrix.
[0008] In one implementation, the target matrix is a cyclic data matrix, and the processor can decompose the target matrix using the following formula to obtain at least one submatrix and a weight vector: in, The target matrix, , , For the elements in the weight vector, , For the submatrix, It is the identity matrix. .
[0009] In one implementation, the target matrix is a Toplitz matrix, and the processor can decompose the target matrix using the following formula to obtain at least one submatrix and a weight vector: in, The target matrix, , , , , For the elements in the weight vector, , , , , , For the submatrix, It is the identity matrix. .
[0010] In one implementation, the optical computing unit is a Mach-Zehnder interferometer.
[0011] In one implementation, the processor can be used to: obtain a target model parameter vector of a target model as the target vector; wherein the target model is a visual tracking model; obtain an initial image patch from the image to be identified; perform cyclic shifting on the pixels in the initial image patch to obtain at least one virtual image patch; generate a cyclic data matrix based on the initial image patch and the at least one virtual image patch, and use the cyclic data matrix as the target matrix.
[0012] In an optional implementation, the processor can also be used to: obtain target shift information corresponding to the maximum value in the calculated result vector; and determine the target image block in the image to be identified based on the target shift information and the position of the initial image block.
[0013] In one implementation, the target model is a visual tracking model based on the ridge regression algorithm.
[0014] Optionally, the gradient vector used to train the target model is calculated using the following formula:
[0015]
[0016] in, The loss function for the ridge regression algorithm is... For model parameters, This is a sample cyclic data matrix generated based on sample images. This is the vector corresponding to the label of the training sample.
[0017] In one implementation, during the iterative training process to obtain the target model, the required gradient vector is obtained through the following steps: As the target vector, As the target matrix, the optical computing device is used to perform optical computation to obtain the sample light computation result; the sample light computation result is substituted into the gradient vector calculation formula to obtain the gradient vector.
[0018] Secondly, this application proposes an optical computing method, applied to the optical computing device as described in the first aspect. The method includes: acquiring a target vector and a target matrix to be multiplied; decomposing the target matrix to obtain at least one submatrix and a weight vector; wherein the submatrix is a Boolean matrix; determining a first target optical computing unit corresponding to each matrix element in a corresponding optical computing array based on the element attributes of the matrix elements in the submatrix; wherein each submatrix corresponds to one optical computing array, and each matrix element in the submatrix corresponds to one optical computing unit; determining a second target optical computing unit corresponding to each vector element in each optical computing array based on the element attributes of the vector elements in the target vector; modulating the phase difference of the first target optical computing unit, and modulating the phase of the second target optical computing unit based on the element attributes of each vector element; generating an optical signal; inputting the optical signal into each optical computing array to obtain corresponding optical computing results; and performing a weighted calculation on the optical computing results based on the weight vector to obtain a calculation result vector of the target vector and the target matrix.
[0019] In one implementation, determining the first target optical computing unit corresponding to each matrix element in the corresponding optical computing array based on the element attributes of the matrix elements in the sub-matrix includes: determining the first target optical computing unit corresponding to the non-zero element in the corresponding optical computing array based on the element attributes of the non-zero elements in the sub-matrix; wherein, the element attributes include element position and / or element value; and modulating the phase difference of the first target optical computing unit includes: configuring the phase difference of the first target optical computing unit to 0 or .
[0020] In one implementation, determining the second target optical computing unit corresponding to each vector element in each optical computing array based on the element attributes of the vector elements in the target vector includes: for each vector element, determining the target phase corresponding to the vector element; for each vector element, determining the second target optical computing unit corresponding to the vector element in each optical computing array based on the element attributes of the vector element; wherein, the element attributes include element position and / or element value; the modulator is specifically used to: for each vector element, perform phase modulation on the corresponding second target optical computing unit based on the element value of the vector element.
[0021] In one implementation, each of the optical computing arrays includes A groups of optical computing units, each group of optical computing units includes B parallel optical computing units, A is greater than or equal to the number of columns of the corresponding submatrix, B is greater than or equal to the number of rows of the corresponding submatrix, and each group of optical computing units corresponds to a column element in the submatrix.
[0022] In one implementation, the target matrix is a cyclic data matrix, and the decomposition of the target matrix to obtain at least one submatrix and a weight vector is as follows: ;in, The target matrix, , , For the elements in the weight vector, , For the submatrix, , express indivual Submatrix multiplication, It is the identity matrix. .
[0023] In one implementation, the target matrix is a Toplitz matrix, and the decomposition of the target matrix to obtain at least one submatrix and the matrix weights corresponding to each submatrix can be represented as follows: ;in, The target matrix, , , , , For the elements in the weight vector, , , , , , For the submatrix, , express indivual Matrix multiplication, For matrix transpose, It is the identity matrix. .
[0024] In one implementation, the optical computing unit is a Mach-Zehnder interferometer.
[0025] In one implementation, obtaining the target vector and target matrix to be multiplied includes: obtaining the target model parameter vector of the target model as the target vector; wherein the target model is a visual tracking model; obtaining an initial image patch from the image to be recognized; performing cyclic shifting processing on the pixels in the initial image patch to obtain at least one virtual image patch; generating a cyclic data matrix based on the initial image patch and the at least one virtual image patch, and using the cyclic data matrix as the target matrix.
[0026] In an optional implementation, the method further includes: obtaining target shift information corresponding to the maximum value in the calculated result vector; and determining the target image block in the image to be identified based on the target shift information and the position of the initial image block.
[0027] In one implementation, the target model is a visual tracking model based on the ridge regression algorithm.
[0028] Optionally, the gradient vector used to train the target model is calculated using the following formula:
[0029]
[0030] in, The loss function for the ridge regression algorithm is... For model parameters, This is a sample cyclic data matrix generated based on sample images. Circular data matrix transpose, The vector corresponding to the labels of the training samples. To control overfitting, the regularization parameter is used. During iterative training to obtain the target model, the steps for acquiring the required gradient vector are as follows: [The model parameters are then used for...] , sample cyclic matrix As the target matrix, the steps of decomposing the target matrix to obtain at least one submatrix and a weight vector, and subsequent steps, are performed to obtain... The corresponding first light calculation result; based on the first light calculation result, obtain As the target vector, and As the target matrix, the steps of decomposing the target matrix to obtain at least one submatrix and a weight vector, and subsequent steps, are performed to obtain... The corresponding second light calculation result; substitute the second light calculation result into the gradient vector calculation formula to obtain the gradient vector.
[0031] Thirdly, this application proposes an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the optical computing method as described in the second aspect.
[0032] Fourthly, this application proposes a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the second aspect.
[0033] Fifthly, this application proposes a program product comprising at least one of a program and instructions, wherein when the program or instructions are executed by an electronic device, they implement the steps of the method described in the second aspect.
[0034] The optical computing apparatus, method, device, and storage medium provided in this application can decompose a target matrix to be multiplied into at least one submatrix and a weight vector. The phase difference of optical computing units in the corresponding optical computing array is configured based on each submatrix, and the phase of each optical computing unit in the optical computing array is configured based on the target vector to be multiplied. This allows the optical computing units to perform multiplication of the target vector and the target matrix. This reduces the complexity of configuring optical computing units and avoids information loss.
[0035] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0036] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0037] Figure 1 This is a schematic diagram of an MZI unit structure provided in an embodiment of this application;
[0038] Figure 2A This is a schematic diagram of an MZI array structure provided in an embodiment of this application;
[0039] Figure 2B This is a schematic diagram of an MZI array structure provided in an embodiment of this application;
[0040] Figure 3 This is a schematic flowchart of an optical computing method provided in an embodiment of this application;
[0041] Figure 4 This is a schematic diagram of the structure of an optical computing unit array provided in an embodiment of this application;
[0042] Figure 5 This is a schematic diagram of the structure of a parallel photonic processor provided in an embodiment of this application;
[0043] Figure 6 This is a flowchart illustrating another optical computing method provided in an embodiment of this application;
[0044] Figure 7 This is a flowchart illustrating another optical computing method provided in an embodiment of this application;
[0045] Figure 8This is a schematic diagram of a light computing scheme for visual tracking provided in an embodiment of this application;
[0046] Figure 9 This is a schematic diagram of the structure of an optical computing device provided in an embodiment of this application;
[0047] Figure 10 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0048] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0049] A Mach-Zehnder Interferometer (MZI) unit is an optical silicon-based device based on the principle of optical interference. It can precisely control the amplitude and phase of optical signals to perform complex mathematical operations. Specifically, MZIs can be used to perform matrix-vector multiplication. By combining multiple MZI units into an optical network, the input optical signal can be encoded as a vector, and the phase modulation of the MZI corresponds to the weight values of the matrix. When the optical signal passes through the MZI network, the matrix-vector multiplication operation is naturally completed through the interference effect of light, and the calculation result is presented in the form of an optical signal. Furthermore, due to the high speed and parallelism of light, this optical computing method is more efficient than traditional electronic computing when processing large-scale data.
[0050] Please see Figure 1 , Figure 1 This is a schematic diagram of an MZI unit structure provided in an embodiment of this application. For example... Figure 1 As shown, the MZI unit consists of two couplers and two phase shifters, where both the input and output couplers can be referred to as 2×2 couplers. The input coupler splits the light from a single source into two beams, each beam passing through two different phase shifting arms to generate a certain phase difference. These two beams are then combined into a single beam by a beam combiner, forming an interference signal. Based on the phase difference, constructive or destructive interference of the light amplitudes can be achieved. Therefore, it can be seen that the MZI unit is naturally suited to the operational logic of matrix-vector multiplication, enabling parallel computation of large-scale data through parallel light transmission and interference superposition.
[0051] Currently, MZI-based photonic processors can be built in the following two ways:
[0052] (1) For A unitary matrix of this size can be topologically concatenated using the above-mentioned combination of 2nd-order unitary matrices and recursion. Unitary matrices of any size can be implemented using triangular or rectangular MZI array topologies. Please refer to [link to relevant documentation]. Figure 2A , Figure 2A This is a schematic diagram of an MZI array structure provided in an embodiment of this application. Figure 2A As shown. Both methods require... One MZI. An arbitrary real-valued matrix. The singular value decomposition is in for unitary matrix, for A rectangular diagonal matrix, for unitary matrix The complex conjugate of . And this arbitrary real-valued matrix It can be decomposed into a having A unitary matrix network constructed from MZI, a set of... An attenuator array consisting of MZI units and another having The unitary matrix network constructed by MZI can be implemented by changing the transmission coefficient of each transmission unit through a tuned phase shifter and an adjustable attenuator. and This ultimately enables arbitrary matrix-vector multiplication. For an example, please refer to [link to example]. Figure 2B , Figure 2B This is a schematic diagram of another MZI array structure provided in an embodiment of this application. For example... Figure 2B As shown, a total of A real-valued matrix is implemented using MZI. .
[0053] (2) According to the second-order transfer unitary matrix of the MZI element, when only The port inputs an optical signal. At this point, it is possible to calculate from Input to The output optical power transfer function is
[0054]
[0055] For any real-valued matrix Mathematical methods (e.g., normalization) are needed to scale each element to... The range allows you to set the preprocessed matrix. Each element in the equation corresponds to an optical power transfer function of a silicon-based MZI modulator. ,Right now This allows for dynamic control of matrix elements by adjusting the phase difference. This method requires... cascaded representation matrix of MZI units .
[0056] The optical computing method and apparatus of this application are described below with reference to the accompanying drawings.
[0057] Figure 3 This is a schematic flowchart of an optical computing method provided in an embodiment of this application. Figure 3 As shown, the method may include, but is not limited to, the following steps:
[0058] S301: Obtain the target vector and target matrix to be multiplied.
[0059] In the embodiments of this application, the target vector can be a real-valued vector, and the target matrix can be a real-valued matrix.
[0060] S302: Decompose the target matrix to obtain at least one submatrix and a weight vector.
[0061] The submatrix is a Boolean matrix, meaning it contains only "0" and "1" elements.
[0062] For example, the target matrix is decomposed to obtain at least one submatrix and the weight corresponding to each submatrix. The elements in each submatrix include only "0" and "1", and the combination corresponding to each submatrix is used as the weight vector.
[0063] As an example, the above decomposition process can be represented as follows:
[0064]
[0065] in, For the target vector, For the target matrix, , For submatrix, , , These are elements in the weight vector.
[0066] In some embodiments, the target matrix is a cyclic shift matrix. The above decomposition of the target matrix to obtain at least one submatrix and a weight vector is as follows:
[0067]
[0068] in, For the target matrix, , , These are the elements in the weight vector. , For submatrix, It is the identity matrix. , express indivual Matrix multiplication, .
[0069] It should be noted that a cyclic shift matrix refers to a matrix in which each row (or each column) is obtained by cyclic shifting the previous row (or column). A cyclic shift operation refers to shifting the elements in the rows or columns of a matrix so that when an element is shifted to the boundary, it does not overflow, but re-enters from the opposite boundary.
[0070] It is understandable that if the target matrix is a cyclic shift matrix, then the decomposition of the target matrix yields... It is still a cyclic shift matrix, and it can achieve a single rightward shift. A loop operation at each position. And It exhibits a periodic pattern, that is, for any positive integer... ,matrix The power calculation satisfies ,in express Divide by The remainder, and As an example, with For example, it can be represented as follows.
[0071]
[0072]
[0073]
[0074]
[0075] In some embodiments, the target matrix is a Toplitz matrix. The target matrix is decomposed to obtain at least one submatrix and the matrix weights corresponding to each submatrix, as shown below:
[0076]
[0077] in, For the target matrix, , , , , These are the elements in the weight vector. , , , , , For submatrix, It is the identity matrix. , , express indivual Matrix multiplication, for The zero matrix, For matrix The transpose of the number of item.
[0078] S303: Based on the element attributes of the matrix elements in the submatrix, determine the first target optical computing unit corresponding to each matrix element in the corresponding optical computing array.
[0079] Each submatrix corresponds to a light computing array, and each matrix element in a submatrix corresponds to a light computing unit.
[0080] For example, please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an optical computing unit array provided in an embodiment of this application. Figure 4 As shown, taking a 4×4 submatrix as an example, a total of 16 MZIs are needed to form an optical computing array. Each MZI in the optical computing array corresponds to an element of the submatrix, that is, each matrix element in the submatrix has a corresponding first target optical computing unit in the optical computing array.
[0081] In the embodiments of this application, each optical computing array includes A groups of optical computing units, each group of optical computing units includes B parallel optical computing units, A is greater than or equal to the number of columns of the corresponding submatrix, B is greater than or equal to the number of rows of the corresponding submatrix, and each group of optical computing units corresponds to one column element in the submatrix. X and Y are positive integers.
[0082] For example, the size of the corresponding optical computing array can be determined according to the row and column dimensions of the matrix, so that the MZI unit in the i-th row and j-th column of the array directly corresponds to the element in the i-th row and j-th column of the matrix in terms of position; then, according to the numerical characteristics of the matrix element, the phase difference of the corresponding MZI unit is configured so that each MZI unit corresponds to a corresponding matrix element.
[0083] It should be noted that an optical computing processor can be pre-built, containing multiple parallel optical computing arrays. Each optical computing array includes A groups of optical computing units, and each group of optical computing units includes B parallel optical computing units. During optical computing, the appropriate number of optical computing units in the optical computing array can be activated according to actual needs, thereby achieving rapid configuration of the optical computing array. For example, the optical computing array can be pre-configured to contain 5 groups of MZI units, each group containing 5 MZI units. If the submatrix is a 4×4 matrix, then 4 groups of MZI units in the optical computing array can be activated, with 4 MZI units activated in each group, thereby quickly obtaining the required size of the optical computing array.
[0084] In the embodiments of this application, technical terms such as "optical computing array", "optical processor", and "photonic processor" can be used interchangeably.
[0085] S304: Based on the element attributes of the vector elements in the target vector, determine the second target optical computing unit corresponding to each vector element in each optical computing array.
[0086] For example, the processor can determine the second target light computing unit corresponding to each vector element based on the element attributes of the vector elements in the target vector.
[0087] For example, the size of the corresponding optical computing array can be determined according to the row and column dimensions of the matrix, so that the MZI unit in the j-th column of each row in the array directly corresponds to the j-th element of the target vector in terms of position; then, the phase difference of the corresponding MZI unit is configured according to the value of the vector element, so that each MZI unit corresponds to a corresponding matrix element.
[0088] S305: Modulate the phase difference of the first target light computing unit and modulate the phase of the second target light computing unit based on the element attributes of each vector element.
[0089] It should be noted that, in some embodiments, the phase difference of the first target optical computing unit can be modulated before the optical signal is input into the optical computing array, and the phase of the second target optical computing unit can be modulated based on the element attributes of each vector element after the optical signal is input into the optical computing array.
[0090] For example, for each optical computing array, the second optical computing unit corresponding to each vector element in the target vector in the optical computing array can also be determined, and the dynamic phase of the corresponding optical computing unit reference arm can be configured based on each vector element in the target vector.
[0091] S306: Generates optical signals.
[0092] For example, an optical signal is generated by a laser.
[0093] S307: Input the optical signal into the optical computing array to obtain the corresponding optical computing results.
[0094] For example, the optical signal is split into multiple identical optical signals by a beam splitter, and each of the split optical signals is input in parallel into a separate optical computing array to obtain the optical computing results output by each optical computing array.
[0095] S308: The calculation results of the light calculation are weighted based on the weight vector to obtain the calculation result vector of the target vector and the target matrix.
[0096] For example, the optical computing result of each optical computing unit is multiplied by the corresponding weight to obtain the corresponding calculated value, and the calculated values are integrated to obtain the calculated result vector of the target vector and the target matrix.
[0097] By implementing the embodiments of this application, the target matrix to be multiplied can be decomposed into at least one submatrix and a weight vector. The phase difference of the optical computing units in the corresponding optical computing array is configured based on each submatrix, and the phase of the optical computing units in each optical computing array is configured based on the target vector to be multiplied. Thus, the multiplication of the target vector and the target matrix is achieved through the optical computing units. This reduces the complexity of the optical computing unit configuration and avoids information loss.
[0098] In some other embodiments of this application, the phase of the optical computing unit in the corresponding optical computing array may be configured not based on the element attributes of the vector elements in the target vector, but based on the element attributes of the vector elements in the target vector to generate the corresponding optical signal, so as to input the optical signal into the optical computing array to obtain the corresponding optical computing result.
[0099] For example, based on each vector element in the target vector, an amplitude modulator linearly maps each vector element in the target vector to the amplitude of the signal arm optical field, thereby generating an optical signal with the corresponding amplitude. The optical signals corresponding to each vector element are integrated into one optical signal and then processed by beam splitting. The signals are then input into each configured optical computing array. The optical computing results of each optical computing array are obtained through the photodetectors of each optical computing array.
[0100] As an example, please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a parallel photonic processor provided in an embodiment of this application. Figure 5 As shown, the optical signal representing the vector elements in the target vector can be split into beams by a beam splitter. Two beams of optical signals carrying the same information are fed in parallel into the data submatrix. In the photonic subprocessor composed of MZI units, each beam of light is transmitted in parallel to the corresponding MZI unit in the MZI unit array according to the one-to-one correspondence between matrix elements and MZI units, and each MZI unit has a preset phase difference based on the characteristics of matrix elements. After the light signal enters each MZI unit, it interferes through the phase difference control of the two arms, and the elements complete the multiplication operation according to the ratio of the light intensity after interference. All MZI units perform synchronous parallel operation, and finally the light signals output by each unit are combined and pass through the photodetector to complete the corresponding matrix vector multiplication operation.
[0101] For example, for each vector element, a digital-to-analog converter converts the vector element value into a corresponding voltage signal. This voltage signal is then applied to an electro-optic modulator, utilizing the electro-optic effect to induce a phase change in the input coherent light that is linearly related to the parameters. This maps the vector element to a phase modulation quantity, thereby obtaining a sub-optical signal carrying this phase information. The sub-optical signals are then combined into an optical signal. The optical signal is then split into multiple beams to be input, each beam containing the corresponding sub-optical signal generated from each vector element. Each beam is then input in parallel into different optical computing arrays.
[0102] It should be noted that optical signals can be input through a waveguide array composed of multiple parallel and low-crosstalk silicon-based integrated optical waveguides. The waveguide array contains multiple parallel and isolated optical waveguides. The input end of each optical waveguide corresponds to the output end of the optical signal with different encoded vector element information. The output end is directly connected to the optical input port of the MZI unit corresponding to the vector element in the MZI unit array. Thus, by utilizing the constrained transmission characteristics of the silicon-based optical waveguide, each MZI unit can ultimately receive and process only the optical signal of the corresponding vector element.
[0103] In some embodiments, only the computing units corresponding to the non-zero elements in the submatrix can be configured, thereby improving the configuration efficiency of the optical computing units. As an example, please refer to... Figure 6 , Figure 6 This is a flowchart illustrating another optical computing method provided in an embodiment of this application, as shown below. Figure 6 As shown, the method may include, but is not limited to, the following steps:
[0104] S601: Obtain the target vector and target matrix to be multiplied.
[0105] In the embodiments of this application, step S601 can be implemented in any of the ways described in the embodiments of this application. The embodiments of this application do not limit this, nor will they be described in detail.
[0106] S602: Decompose the target matrix to obtain at least one submatrix and a weight vector.
[0107] In the embodiments of this application, step S602 can be implemented in any of the ways described in the embodiments of this application. The embodiments of this application do not limit this, nor will they be described in detail.
[0108] S603: Based on the element attributes of the non-zero elements in the submatrix, determine the first target optical computing unit corresponding to the non-zero elements in the corresponding optical computing array.
[0109] The aforementioned element attributes include element position and element value.
[0110] For example, in submatrix For example, if , , , If the element value is 1, then it can be like this: Figure 4 The corresponding MZI shown , , , It was identified as the first target light computing unit.
[0111] S604: Configure the phase difference of the first target light computing unit to 0 or .
[0112] It's important to note that there are two methods for adjusting the phase difference of MZI units: electro-optic adjustment and thermo-optic modulation. Electro-optic modulation involves adjusting the input voltage or device temperature via electrical signals to regulate the phase difference of the optical computing unit. Electro-optic modulation achieves phase modulation by changing the refractive index difference between the two arms through the electro-optic effect. Ideally, with precise waveguide size matching and material anisotropy compensation during design, the initial operating point can be preset, reducing dependence on additional DC bias voltage. However, excessive real-time adjustment not only increases insertion loss but also causes operating point instability due to voltage drift, thus reducing modulation linearity and extinction ratio. Thermo-optic modulation, on the other hand, generates an optical response (such as refractive index change, phase modulation, or light intensity change) by applying temperature changes. Thermo-optic effects have a slow response speed and suffer from thermal crosstalk. If the design requires frequent adjustment of the optical path difference by heating the electrodes to compensate for ambient temperature fluctuations, it significantly increases power consumption. Furthermore, the thermal relaxation process introduces modulation distortion. Therefore, for photonic processors, the fewer MZI units that need to be regulated, the better the processor performance. The optical computing method provided in this application only requires adjusting the MZI units corresponding to the non-zero elements in the submatrix, thereby improving the optical computing performance.
[0113] It is understood that, depending on the actual modulation method used, the modulator in this application can be a thermo-optic modulator or an electro-optic modulator.
[0114] It should be noted that, as explained above regarding the submatrix, all elements of the submatrix are already within the range of [0, 1]. Therefore, there is no need to use mathematical methods to scale the elements, thus avoiding information loss during the scaling process.
[0115] S605: For each vector element, determine the second target optical computing unit corresponding to the vector element in each optical computing array based on the element attributes of the vector element.
[0116] S606: For each vector element, perform phase modulation on the corresponding second target light computing unit based on the element value of the vector element.
[0117] S607: Generates optical signals.
[0118] S608: Input the optical signal into the optical computing array to obtain the corresponding optical computing results.
[0119] In the embodiments of this application, step S608 can be implemented in any of the ways described in the embodiments of this application. The embodiments of this application do not limit this, nor will they be described in detail.
[0120] S609: The calculation results of the light calculation are weighted based on the weight vector to obtain the calculation result vector of the target vector and the target matrix.
[0121] In the embodiments of this application, step S609 can be implemented in any of the embodiments of this application. The embodiments of this application do not limit this and will not be described in detail.
[0122] By implementing the embodiments of this application, the target computing unit corresponding to the non-zero element can be determined based on the element attributes of the matrix elements in the submatrix, thereby configuring the first target optical computing unit. This improves the configuration efficiency of the optical computing unit, and thus enhances the optical computing efficiency.
[0123] In some embodiments, visual tracking can be performed based on the optical computing method provided in this application. As an example, please refer to... Figure 7 , Figure 7 This is a flowchart illustrating another optical computing method provided in an embodiment of this application, as shown below. Figure 7 As shown, the method may include, but is not limited to, the following steps:
[0124] S701: Obtain the target model parameter vector as the target vector.
[0125] The target model is a visual tracking model.
[0126] In some embodiments, the target model described above can be a visual tracking model based on the ridge regression algorithm.
[0127] S702: Obtain an initial image patch from the image to be recognized.
[0128] For example, based on the historical location of the target to be tracked in the previous frame image or the initially labeled suspected target area, a local area image is extracted from the image to be identified as an initial image patch.
[0129] In the embodiments of this application, the image to be identified may be a frame of a series of images that are visually tracked using a detection and tracking method.
[0130] It's important to note that detection tracking is a method for visual tracking that utilizes a discriminative machine learning classifier to detect targets. In this method, each pair of temporally consecutive frames in the video undergoes two phases: training and detection. During training, a discriminative machine learning algorithm selects multiple image patches around the target from the training frames to train the classifier, enabling it to distinguish between the target and the background in the video. During detection, several candidate image patches are selected near the target location in the detection frames and added to the classifier. The corresponding responses are calculated, and the location with the largest response is the most likely location of the target.
[0131] S703: Perform cyclic shifting on the pixels in the initial image block to obtain at least one virtual image block.
[0132] For example, taking an initial image patch consisting of n elements as an example, the initial image patch can be represented as follows: Each pixel in the initial image block is cyclically shifted once to obtain a virtual image block, and at least one virtual image block is obtained by performing at least one cyclic shift.
[0133] S704: Generate a cyclic data matrix based on the initial image block and at least one virtual image block, and use the cyclic data matrix as the target matrix.
[0134] For example, taking the initial image block as an example of performing n-1 cyclic shifts to obtain n-1 virtual image blocks, the target matrix can be represented as follows.
[0135]
[0136] S705: Decompose the target matrix to obtain at least one submatrix and a weight vector.
[0137] For example, the above decomposition process can be represented as follows.
[0138]
[0139] in, The target matrix includes initial image patches and virtual image patches. For elements in the initial image patch, , For submatrix, , It is an identity matrix.
[0140] S706: Based on the element attributes of the matrix elements in the submatrix, determine the first target optical computing unit corresponding to each matrix element in the corresponding optical computing array.
[0141] S707: Based on the element attributes of the vector elements in the target vector, determine the second target optical computing unit corresponding to each vector element in each optical computing array.
[0142] S708: Modulate the phase difference of the first target light computing unit and modulate the phase of the second target light computing unit based on the element attributes of each vector element.
[0143] S709: Generates optical signals.
[0144] S710: Inputs optical signals into the optical computing array to obtain the corresponding optical computing results.
[0145] In the embodiments of this application, step S710 can be implemented in any of the embodiments of this application. The embodiments of this application do not limit this and will not be described in detail.
[0146] S711: The calculation results of the light calculation are weighted based on the weight vector to obtain the calculation result vector of the target vector and the target matrix.
[0147] S712: Obtain the target shift information corresponding to the maximum value in the calculation result vector.
[0148] For example, the shift information corresponding to the element with the largest value in the calculation result vector is obtained as the target shift information.
[0149] S713: Based on the target shift information and the position of the initial image block, determine the target image block in the image to be identified.
[0150] For example, the element with the largest value in the vector corresponding to the result of the multiplication operation is obtained, the number of times the corresponding virtual sample is shifted is determined, and then the coordinates of the initial image block in the image to be identified are combined to calculate the specific position of the target in the image to be identified, which is the visual tracking result.
[0151] It should be noted that each element of the calculated result vector corresponds to a virtual image patch, and the numerical value of the element represents the matching degree between the corresponding virtual image patch and the initial image patch. Therefore, based on the shift information (e.g., the number of shifted pixels and the shift direction) corresponding to the element with the largest value in the calculated result vector, the region where the target is most likely to exist in the image to be identified can be determined, thereby achieving visual tracking.
[0152] In some embodiments, the aforementioned target image can be a sample image used to train a visual tracking model, and the aforementioned target model can be an initial neural network model used for visual tracking. The gradient vector calculation formula for training the target model can be expressed as:
[0153]
[0154] in, The loss function for the ridge regression algorithm is... For model parameters, This is the second cyclic data matrix. This is the vector corresponding to the label of the training sample.
[0155] The formula for calculating the loss function can be expressed as:
[0156]
[0157] in, The loss function for the ridge regression algorithm is... For model parameters, The 2-norm of the model parameters, To control overfitting, a regularization parameter is used. During iterative training to obtain the target model, the steps for acquiring the required gradient vector are as follows: [The text abruptly ends here, likely due to an incomplete sentence or a formatting error.] As the target vector, As the target matrix, perform the steps of decomposing the target matrix to obtain at least one submatrix and a weight vector, and subsequent steps to obtain the sample light calculation result; substitute the sample light calculation result into the gradient vector calculation formula to obtain the gradient vector.
[0158] It should be noted that the HCMB15 algorithm takes a cyclic data matrix as input during the training phase. ,vector Regularization parameters Precision Step size factor The process of obtaining optimal model parameters using the gradient descent algorithm may include the following steps:
[0159] B1: Iteration step size Initial model parameters .
[0160] B2: Calculate all gradients according to the gradient vector calculation formula. Composition of gradient vector .
[0161] B3: If Then output .
[0162] B4: If Then according to the iteration rule Update model parameters .
[0163] B5: .
[0164] Repeat steps B2-B5 until step 3 is satisfied, and obtain the optimal model parameters.
[0165] As can be seen from the above steps, the core of obtaining the optimal model parameters using the gradient descent algorithm lies in calculating the gradient vector required for each iteration, which involves vector multiplication of the cyclic data matrix. This consumes significant processor resources when the training set is large. Therefore, during training, traditional computational methods can be used to calculate the gradient vector. As the new target vector, it will be used in each training process. As the target matrix, the corresponding optical computation results are obtained, and these results are substituted into the gradient vector calculation formula to obtain the gradient vector used for model parameter optimization. This process is repeated multiple times until the preset conditions shown in step A3 are met, thus enabling rapid training of the model and obtaining a target model that can be used for visual tracking.
[0166] It should be noted that, in order to achieve target tracking throughout the entire video, each frame of the video continuously undergoes a training-probe process. During this process, once a target is detected, the probe frame becomes a training frame. Therefore, the gradient vector can be obtained based on the training frame using the method described above, and the model parameters can be updated based on the gradient vector.
[0167] By implementing the embodiments of this application, a cyclic shifting process can be performed on the initial image block in the image to be identified to obtain at least one virtual image block. The cyclic shifting matrix obtained by combining the virtual image block and the initial image block is used as the target matrix, and the parameter vector of the neural network used for visual tracking is used as the target vector. Thus, the computation process of the neural network is realized based on the optical computing unit to achieve fast visual tracking.
[0168] Please see Figure 8 , Figure 8 This is a schematic diagram of a light computing scheme for visual tracking provided in an embodiment of this application. Figure 8As shown, firstly, the input data matrix and model parameter vector of the visual tracking model are obtained. The input data matrix is then split into multiple sub-matrices using its special structure, and each sub-matrix is assigned a corresponding optical computing array. Each MZI unit in the optical computing array has a preset phase difference based on the characteristics of the corresponding sub-matrix elements. Next, the vector to be computed is converted into an optical signal carrying vector element information through phase modulation. This signal is then split into multiple beams of the same source by a beam splitter and transmitted in parallel to each photonic subprocessor. Subsequently, the MZI units in each subprocessor synchronously perform element-wise weighted operations on the input vector optical signals. The resulting optical signals are then combined and superimposed within the subprocessor to obtain the product optical signal of the sub-matrix and the vector. Finally, the output optical signals of all subprocessors are converted into electrical signals by a photodetector and weighted summed according to the inverse rule of matrix splitting, ultimately yielding the complete result of the vector-to-original matrix multiplication operation.
[0169] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of an optical computing device provided in an embodiment of this application. Figure 9 As shown, the device 900 includes: a processor 901, used to acquire a target vector and a target matrix to be multiplied; the processor 901 is further used to decompose the target matrix to obtain at least one submatrix and a weight vector; wherein the submatrix is a Boolean matrix; the processor 901 is further used to determine the first target optical computing unit corresponding to each matrix element in the corresponding optical computing array based on the element attributes of the matrix elements in the submatrix; wherein each submatrix corresponds to one optical computing array, and each matrix element in the submatrix corresponds to one optical computing unit; the processor 901 is further used to determine the second target optical computing unit corresponding to each vector element in each optical computing array based on the element attributes of the vector elements in the target vector; a modulator 902, used to modulate the phase difference of the first target optical computing unit, and to modulate the phase of the second target optical computing unit based on the element attributes of each vector element; a laser 903, used to generate an optical signal; an optical computing array 904, used to receive the optical signal and output the corresponding optical computing result; the processor 901 is further used to perform weighted calculation on the optical computing result based on the weight vector to obtain the calculation result vector of the target vector and the target matrix.
[0170] In one implementation, the processor 901 is specifically used for matrix elements in the submatrix: based on the element attributes of the non-zero elements in the submatrix, determining the first target optical computing unit corresponding to the non-zero element in the corresponding optical computing array; wherein, the element attributes include element position and / or element value; the modulator 902 is specifically used for: configuring the phase difference of the first target optical computing unit to 0 or .
[0171] In one implementation, the processor 901 is specifically used to: determine the target phase corresponding to each vector element; determine the second target optical computing unit corresponding to each vector element in each optical computing array based on the element attributes of the vector element; wherein the element attributes include element position and / or element value; and the modulator 902 is specifically used to: perform phase modulation on the corresponding second target optical computing unit based on the element value of each vector element.
[0172] In one implementation, each optical computing array includes A groups of optical computing units, each group of optical computing units includes B parallel optical computing units, A is greater than or equal to the number of columns of the corresponding submatrix, B is greater than or equal to the number of rows of the corresponding submatrix, and each group of optical computing units corresponds to one column element in the submatrix.
[0173] In one implementation, the target matrix is a cyclic data matrix, and the processor 901 can decompose the target matrix using the following formula to obtain at least one submatrix and a weight vector: in, For the target matrix, , , These are the elements in the weight vector. , For submatrix, It is the identity matrix. .
[0174] In one implementation, the target matrix is a Toplitz matrix, and the processor can decompose the target matrix using the following formula to obtain at least one submatrix and a weight vector: in, For the target matrix, , , , , These are the elements in the weight vector. , , , , , For submatrix, It is the identity matrix. .
[0175] In one implementation, the optical computing unit is a Mach-Zehnder interferometer.
[0176] In one implementation, the processor 901 can be used to: obtain the target model parameter vector of the target model as the target vector; wherein the target model is a visual tracking model; obtain an initial image block from the image to be recognized; perform cyclic shifting on the pixels in the initial image block to obtain at least one virtual image block; generate a cyclic data matrix based on the initial image block and at least one virtual image block, and use the cyclic data matrix as the target matrix.
[0177] In an alternative implementation, the processor 901 can also be used to: obtain the target shift information corresponding to the maximum value in the calculated result vector; and determine the target image block in the image to be identified based on the target shift information and the position of the initial image block.
[0178] In one implementation, the target model is a visual tracking model built based on the ridge regression algorithm.
[0179] Optionally, the formula for calculating the gradient vector used to train the target model is:
[0180]
[0181] in, The loss function for the ridge regression algorithm is... For model parameters, This is a sample cyclic data matrix generated based on sample images. The processor can also be used to obtain the required gradient vectors during the iterative training process to acquire the target model by the following steps: As the target vector, As the target matrix, perform the steps of decomposing the target matrix to obtain at least one submatrix and a weight vector, and subsequent steps to obtain the sample light calculation result; substitute the sample light calculation result into the gradient vector calculation formula to obtain the gradient vector.
[0182] The apparatus of this application embodiment can decompose the target matrix to be multiplied into at least one submatrix and a weight vector. The phase difference of the optical computing units in the corresponding optical computing array is configured based on each submatrix, and the phase of each optical computing unit in the optical computing array is configured based on the target vector to be multiplied. This allows the optical computing units to perform the multiplication of the target vector and the target matrix. This reduces the complexity of the optical computing unit configuration and avoids information loss.
[0183] It should be noted that the foregoing explanation of the optical computing method embodiment also applies to the optical computing device of this embodiment, and will not be repeated here.
[0184] To implement the above embodiments, this application also proposes an electronic device. Please see [link to relevant documentation]. Figure 10 , Figure 10 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 10 As shown, the electronic device 1000 includes: a processor 1001 and a memory 1002 communicatively connected to the processor 1001; the memory 1002 stores computer execution instructions; the processor 1001 executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.
[0185] To implement the above embodiments, this application also proposes a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the methods provided in the foregoing embodiments.
[0186] To implement the above embodiments, this application also proposes a program product, including at least one of a program and instructions, wherein when the program and instructions are executed by an electronic device, they implement the steps of the method provided in the foregoing embodiments.
[0187] It should be noted that the acquisition, transmission, storage, use, and processing of data in this application comply with the relevant provisions of national laws and regulations and do not violate public order and good morals.
[0188] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0189] It is worth noting that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.
[0190] In the description of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.
[0191] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0192] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0193] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0194] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0195] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0196] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0197] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0198] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. An optical computing device, characterized in that, The device includes: A processor is used to acquire the target vector and the target matrix to be multiplied; wherein the target vector is a real-valued vector and the target matrix is a real-valued matrix; The processor is further configured to decompose the target matrix to obtain at least one submatrix and a weight vector; wherein the submatrix is a Boolean matrix; The processor is further configured to determine, based on the element attributes of the matrix elements in the submatrix, the first target optical computing unit corresponding to each matrix element in the corresponding optical computing array; wherein, each submatrix corresponds to an optical computing array, and each matrix element in the submatrix corresponds to an optical computing unit; The processor is further configured to determine, based on the element attributes of the vector elements in the target vector, the second target optical computing unit corresponding to each vector element in each optical computing array: A modulator is used to modulate the phase difference of the first target light computing unit and to modulate the phase of the second target light computing unit based on the element attributes of each of the vector elements. Lasers are used to generate optical signals; The optical computing array is used to receive the optical signal and output the corresponding optical computing results; The processor is further configured to perform weighted calculations on the optical calculation results based on the weight vector to obtain the calculation result vector of the target vector and the target matrix.
2. The apparatus according to claim 1, characterized in that, The processor is specifically used for matrix elements in the submatrix: Based on the element attributes of the non-zero elements in the submatrix, the first target optical computing unit corresponding to the non-zero element in the corresponding optical computing array is determined; wherein, the element attributes include element position and / or element value; The modulator is specifically used to: configure the phase difference of the first target light computing unit to 0 or .
3. The apparatus according to claim 1, characterized in that, The processor is specifically used to: for each vector element, determine the target phase corresponding to the vector element; For each vector element, a second target optical computing unit corresponding to the vector element in each optical computing array is determined based on the element attributes of the vector element; wherein, the element attributes include element position and / or element value; The modulator is specifically used to: for each vector element, perform phase modulation on the corresponding second target light computing unit based on the element value of the vector element.
4. The apparatus according to claim 1, characterized in that, The target matrix is a cyclic data matrix. The target matrix is decomposed to obtain at least one submatrix and a weight vector, as shown below: in, The target matrix, , , For the elements in the weight vector, , For the submatrix, It is the identity matrix. .
5. The apparatus according to claim 1, characterized in that, The target matrix is a Toplitz matrix. The decomposition of the target matrix to obtain at least one submatrix and the matrix weights corresponding to each submatrix can be represented as follows: in, The target matrix, , , , , For the elements in the weight vector, , , , , , For the submatrix, It is the identity matrix. .
6. The apparatus according to claim 1, characterized in that, The processor is specifically used for: The target model parameter vector of the target model is obtained as the target vector; wherein, the target model is a visual tracking model; Obtain initial image patches from the image to be identified; The pixels in the initial image block are cyclically shifted to obtain at least one virtual image block; A cyclic data matrix is generated based on the initial image block and the at least one virtual image block, and the cyclic data matrix is used as the target matrix.
7. The apparatus according to claim 6, characterized in that, The processor is also used for: Obtain the target shift information corresponding to the maximum value in the calculated result vector; Based on the target shift information and the position of the initial image block, the target image block in the image to be identified is determined.
8. The apparatus according to claim 6, characterized in that, The target model is a visual tracking model built based on the ridge regression algorithm. The gradient vector calculation formula used to train the target model is as follows: in, The loss function for the ridge regression algorithm is... For model parameters, This is a sample cyclic data matrix generated based on sample images. This is the vector corresponding to the label of the training sample.
9. The apparatus according to claim 8, characterized in that, The steps for obtaining the required gradient vector during iterative training to acquire the target model are as follows: Will As the target vector, As the target matrix, the optical computing device is used to perform optical computation to obtain the sample light computation result; The gradient vector is obtained by substituting the sample light calculation result into the gradient vector calculation formula.
10. A method for optical computing, characterized in that, The method is applied to the optical computing device as described in any one of claims 1 to 9, the method comprising: Obtain the target vector and target matrix to be multiplied; wherein the target vector is a real-valued vector and the target matrix is a real-valued matrix; The target matrix is decomposed to obtain at least one submatrix and a weight vector; wherein the submatrix is a Boolean matrix; Based on the element attributes of the matrix elements in the sub-matrix, the first target optical computing unit corresponding to each matrix element in the corresponding optical computing array is determined; wherein, each sub-matrix corresponds to an optical computing array, and each matrix element in the sub-matrix corresponds to an optical computing unit; Based on the element attributes of the vector elements in the target vector, the second target optical computing unit corresponding to each vector element in each optical computing array is determined: The phase difference of the first target light computing unit is modulated, and the phase of the second target light computing unit is modulated based on the element attributes of each vector element. Generate optical signals; Receive the optical signal and output the corresponding optical calculation results; The light calculation results are weighted based on the weight vector to obtain the calculation result vector of the target vector and the target matrix.
Citation Information
Patent Citations
Computing chip, system and data processing method
CN114520694A
Optical computing system, data processing method, product, device, and medium
CN120610601A