Optical computing system, data processing method, product, device, and medium
Through the input and output modules and optical computing modules in the optical computing system, the iterative calculation of optical signals, parameter matrices and their transposed matrices is used to solve the high complexity and low efficiency problems caused by electrical computing, and realize efficient feature matrix feature information extraction.
Patent Information
- Application Number
- CN202511067313.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-31
AI Technical Summary
The existing technology uses electronic computing to process data, which results in high processing complexity and low processing efficiency.
An optical computing system is used. By setting up two input and output modules and an optical computing module, the parameter matrix in the optical computing module is updated according to the feature matrix to be processed. In each iteration, the optical signal is input forward and reversely into the optical computing module, and calculations are performed with the parameter matrix and its transposed matrix until the key feature information of the feature matrix is determined at the end of the iteration.
The efficient calculation of parameter matrix and transposed matrix is realized, which reduces the processing complexity and improves the processing efficiency.
Smart Images

Figure CN120610601A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to optical computing systems, data processing methods, products, devices, and media. Background Art
[0002] Data dimensionality reduction is an important preprocessing method in data analysis and machine learning. Its purpose is to map high-dimensional data into a low-dimensional space while preserving the key information of the original data as much as possible. High-dimensional data can bring many problems, such as high computational complexity, high data storage and transmission costs, and susceptibility to overfitting. Data dimensionality reduction can improve computational efficiency, reduce storage requirements, eliminate noise and redundancy, and enhance model generalization.
[0003] However, the data dimensionality reduction process involves a large number of matrix operations. Related technologies use electronic computers to process large-scale matrix operations, which has high processing complexity and low processing efficiency. Summary of the Invention
[0004] The present application provides an optical computing system, a data processing method, a product, a device, and a medium to at least solve the problems of high processing complexity and low processing efficiency caused by processing data through electrical computing in related technologies.
[0005] The present application provides an optical computing system, comprising a first input-output module, a second input-output module, an optical computing module, and a processing module; The first input-output module and the second input-output module are configured to sequentially input an initial optical signal in each of the multiple iterations, and modulate the initial optical signal according to their respective latest obtained output vectors when inputting the initial optical signal; The optical computing module is configured to input the optical signal modulated by the first input / output module in a forward direction, perform calculations with the parameter matrix, and output the calculated optical signal to the second input / output module; and to input the optical signal modulated by the second input / output module in a reverse direction, perform calculations with the transposed matrix of the parameter matrix, and output the calculated optical signal to the first input / output module; the parameter matrix is adjusted according to the characteristic matrix to be processed; The first input-output module and the second input-output module are further configured to convert the calculated optical signals into electrical signals when the calculated optical signals are input to the modules, thereby obtaining respective output vectors; The processing module is used to determine the end of iteration when the change in the output vector obtained from two adjacent iterations is less than the target value or the number of iterations reaches the target number, and determine the key feature information of the feature matrix based on the output vector obtained from the last iteration.
[0006] The present application also provides a data processing method, which is applied to any of the above-mentioned optical computing systems, and the method includes: Get the feature matrix to be processed; Data processing is performed on the characteristic matrix; multiple iterations are performed during the data processing process, and in each iteration of the multiple iterations, the optical signal in the current iteration is modulated according to the output vector obtained in the previous iteration, the modulated optical signal is calculated with the parameter matrix and the transposed matrix of the parameter matrix in sequence, and the calculated optical signal is converted into an electrical signal to obtain the output vector of the current iteration; the parameter matrix is updated according to the characteristic matrix; when the change in the output vectors obtained from two adjacent iterations is less than a target value or the number of iterations reaches the target number, the iteration is determined to be complete, and key feature information of the characteristic matrix is determined based on the output vector obtained in the last iteration.
[0007] The present application also provides a computer program product, comprising: An acquisition module is used to obtain the feature matrix to be processed; A data processing module is configured to perform data processing on the characteristic matrix; perform multiple iterations during the data processing process, modulate the optical signal in the current iteration according to the output vector obtained in the previous iteration in each iteration, calculate the modulated optical signal with the parameter matrix and the transposed matrix of the parameter matrix in sequence, so as to convert the calculated optical signal into an electrical signal and obtain the output vector of the current iteration; update the parameter matrix according to the characteristic matrix; determine that the iteration is complete when the change in the output vectors obtained between two adjacent iterations is less than a target value or the number of iterations reaches the target number, and determine key feature information of the characteristic matrix based on the output vector obtained in the last iteration.
[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned data processing methods when executing the computer program.
[0009] The present application also provides a non-volatile computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data processing methods are implemented.
[0010] Through the present application, two input and output modules and an optical computing module are set up, and the parameter matrix in the optical computing module is updated according to the characteristic matrix to be processed. In each iteration, the optical signal modulated by the first input and output module is forward input to the optical computing module and calculated with the parameter matrix. The optical signal modulated by the second input and output module is reversely input to the optical computing module and calculated with the transposed matrix of the parameter matrix to obtain the output vector of the current iteration. At the end of the iteration, the key feature information of the characteristic matrix is determined based on the output vector obtained in the last iteration. Therefore, it can solve the problem of high processing complexity and low processing efficiency caused by processing data through electrical calculation in the related art, and achieve the technical effect of completing the efficient calculation of the parameter matrix and the transposed matrix through optical calculation, reducing processing complexity, and improving processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0012] Figure 1 A schematic diagram of the structure of an optical computing system provided in an embodiment of the present application; Figure 2 A schematic diagram of the basic structure of an MZI modulator in an optical computing system provided in an embodiment of the present application; Figure 3 A flowchart of a data processing method provided in an embodiment of the present application; Figure 4 A block diagram of a computer program product provided in an embodiment of the present application.
[0013] Reference numerals: Among them, the first input and output module 1; the second input and output module 2; the optical computing module 3; the processing module 4; the laser source 5; the first optical switch 6; the optical modulator 31; the phase modulator 11; the photodetector 12; the second optical switch 13; the first beam splitter 7; the second beam splitter 8; the input and output unit 20; the computer program product 10; the acquisition module 100; and the data processing module 200. DETAILED DESCRIPTION
[0014] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0015] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0016] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0017] An embodiment of the present application provides an optical computing system.
[0018] Specifically, Figure 1 The diagram is a structural diagram of an optical computing system provided according to an embodiment of the present application. Figure 1 The solid lines in the figure represent the optical path, and the dotted lines represent the electrical circuit.
[0019] like Figure 1 As shown, the optical computing system provided in the embodiment of the present application includes a first input / output module 1, a second input / output module 2, an optical computing module 3, and a processing module 4. The optical computing module 3 can be located between the first input / output module 1 and the second input / output module 2, so that the optical signal output by the first input / output module 1 can be input to the second input / output module 2 via the optical computing module 3, and the optical signal output by the second input / output module 2 can be input to the first input / output module 1 via the optical computing module 3. The processing module 4 can be electrically connected to the first input / output module 1 and the second input / output module 2, respectively, to obtain the output vectors of the first input / output module 1 and the second input / output module 2, respectively, and to control the modulation parameters in the first input / output module 1 and the second input / output module 2, respectively.
[0020] The first input / output module 1 and the second input / output module 2 are configured to sequentially input an initial optical signal in each of the multiple iterations and modulate the initial optical signal according to their respective newly obtained output vectors when inputting the initial optical signal. In the first iteration, the first input / output module 1 modulates the initial optical signal according to the random vector when inputting the initial optical signal.
[0021] The optical computing module 3 is used to forward input the optical signal modulated by the first input / output module 1, perform calculations with the parameter matrix, and output the calculated optical signal to the second input / output module 2; reverse input the optical signal modulated by the second input / output module 2, perform calculations with the transposed matrix of the parameter matrix, and output the calculated optical signal to the first input / output module 1; the parameter matrix is adjusted according to the characteristic matrix to be processed.
[0022] The first input / output module 1 and the second input / output module 2 are further configured to convert the calculated optical signals into electrical signals when they are input to the modules, thereby obtaining respective output vectors. The output vector obtained by the first input / output module 1 in the current iteration can be used as the output vector obtained in the current iteration.
[0023] The processing module 4 is used to terminate the iteration when it is determined that the change in the output vector obtained from two adjacent iterations is less than the target value or the number of iterations reaches the target number, and determine the key feature information of the feature matrix based on the output vector obtained from the last iteration.
[0024] During data processing, the first input / output module 1 and the second input / output module 2 alternately input the initial optical signal. Multiple iterations are performed during the data processing. In each of the multiple iterations, the first input / output module 1 first inputs the initial optical signal, and the second input / output module 2 later inputs the initial optical signal.
[0025] Before multiple iterations, according to the feature matrix to be processed A , the parameter matrix in the light calculation module 3 B Update and complete the preloading of light calculation parameters. Randomly initialize the input vector (that is, determine the random vector ).
[0026] In the first iteration, the processing module 4 performs the random vector Update the modulation parameters in the first input-output module 1 and the second input-output module 2. The first input-output module 1 inputs the initial optical signal and modulates the input initial optical signal according to the updated modulation parameters. The modulated optical signal represents the random vector , to achieve random vector The first input and output module 1 outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 forward inputs the modulated optical signal and compares the modulated optical signal with the parameter matrix B Perform multiplication and addition calculations, and output the calculated signal to the second input and output module 2. The second input and output module 2 converts the calculated optical signal into an electrical signal to obtain an output vector .
[0027] Processing module 4 obtains the output vector of the second input and output module 2 , and output vector of module 2 according to the second input Update the modulation parameters in the first input-output module 1 and the second input-output module 2. The second input-output module 2 inputs the initial optical signal and modulates the input initial optical signal according to the updated modulation parameters. The modulated optical signal represents the output vector , to achieve the output vector The second input and output module 2 outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 reversely inputs the modulated optical signal and compares the modulated optical signal with the parameter matrix B The transposed matrix of Perform multiplication and addition calculations, and output the calculated signal to the first input and output module 1. The first input and output module 1 converts the calculated optical signal into an electrical signal to obtain an output vector .
[0028] Processing module 4 obtains the output vector of the first input and output module 1 , the output vector obtained by the first input-output module 1 can be as the output vector of the first iteration.
[0029] In the k In the iterations, k >1, the processing module 4 is based on the output vector that the first input and output module 1 has recently obtained (that is, the first input and output module 1 has recently obtained the output vector k -1 output vector obtained in the iteration ) Update the modulation parameters in the first input-output module 1 and the second input-output module 2. The first input-output module 1 inputs the initial optical signal and modulates the input initial optical signal according to the updated modulation parameters. The modulated optical signal represents the modulation parameters of the first input-output module 1 in the first k -1 output vector obtained in the iteration The first input / output module 1 outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 forward inputs the modulated optical signal and compares the modulated optical signal with the parameter matrix B Perform multiplication and addition calculations, and output the calculated signal to the second input and output module 2. The second input and output module 2 converts the calculated optical signal into an electrical signal to obtain an output vector .
[0030] Processing module 4 obtains the latest output vector obtained by the second input and output module 2 , and output vector of module 2 according to the second input Update the modulation parameters in the second input-output module 2. The second input-output module 2 inputs the initial optical signal and modulates the input initial optical signal according to the updated modulation parameters. The modulated optical signal represents the output vector , to achieve the output vector The second input and output module 2 outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 reversely inputs the modulated optical signal and compares the modulated optical signal with the parameter matrix B The transposed matrix of Perform multiplication and addition calculations, and output the calculated optical signal to the first input and output module 1. The first input and output module 1 converts the calculated optical signal into an electrical signal to obtain an output vector .
[0031] Processing module 4 obtains the output vector of the first input and output module 1 , the output vector obtained by the first input-output module 1 can be As the first k The output vector of the iteration.
[0032] The processing module 4 can also perform normalization on the output vector of each iteration. For example, the output vector of the first iteration after normalization is , the normalized output vector of the kth iteration .in, Represents the magnitude of a vector.
[0033] Processing module 4 detects whether an iteration termination condition is satisfied. For example, the iteration termination condition includes whether the modulo difference between the output vector obtained in the current iteration and the output vector obtained in the previous iteration is less than a target value, or whether the number of iterations reaches a target value. The target value and the target number of iterations can be preset according to actual needs.
[0034] When the iteration end condition is met, the iteration is stopped, and the processing module 4 can determine the feature matrix according to the output vector obtained in the last iteration A key feature information.
[0035] For example, the processing module 4 obtains the first k The output vector of the iteration After that, it was detected Less than the target value, or the number of iterations detected k When the target number of iterations is reached, the iteration stops.
[0036] The key feature information of the feature matrix may include the maximum eigenvalue and the corresponding eigenvector, and the eigenvector includes a left eigenvector and a right eigenvector.
[0037] After normalizationk The output vector of the iteration That is the feature matrix A The right eigenvector corresponding to the largest eigenvalue (that is, the largest singular value in SVD) v (That is, the right singular vector in SVD). According to the right eigenvector corresponding to the maximum eigenvalue v and the feature matrix A , the characteristic matrix can be calculated A The maximum eigenvalue of . According to the right eigenvector corresponding to the maximum eigenvalue v , feature matrix A and the feature matrix A The maximum eigenvalue of , the characteristic matrix can be calculated A The left eigenvector corresponding to the largest eigenvalue of (i.e. the left singular vectors in SVD).
[0038] This embodiment provides two input / output modules and an optical computing module 3. The parameter matrix in the optical computing module 3 is updated according to the feature matrix to be processed. In each iteration, the optical signal modulated by the first input / output module 1 is forward input to the optical computing module 3 and calculated with the parameter matrix. The optical signal modulated by the second input / output module 2 is reversely input to the optical computing module 3 and calculated with the transposed matrix of the parameter matrix. By multiplexing the optical paths in forward and reverse directions, efficient calculation of the parameter matrix and the transposed matrix is completed.
[0039] In this embodiment, the optical matrix transposition requires a time complexity of O(n), while the related art uses an electronic calculation with a time complexity of O(mn). In this embodiment, the optical matrix transposition requires only O(n) data (the input and output dimensions of both input and output modules are n, so the data volume is O(n)). In the related art, electronic calculations require information transfer based on the size of the feature matrix, so the data volume required is O(mn).
[0040] Therefore, this embodiment can reduce time complexity and the amount of calculated data, thereby reducing the complexity of data processing and improving data processing efficiency.
[0041] It should be noted that this embodiment can be used to characterize the matrix A Perform multiple data processing, and each data processing can obtain the key feature information of the current data processing. Through multiple data processing, the feature matrix can be obtained A The number of data processing times can be set according to actual needs.
[0042] By the feature matrix APerform data dimensionality reduction, and retain the feature matrix of the data after dimensionality reduction A The key feature information in the dimensionality reduction data can be subsequently processed to improve computing efficiency, reduce storage requirements, eliminate noise and redundancy, and enhance model generalization capabilities.
[0043] For example, in image recognition, a 100×100 pixel grayscale image has 10,000 dimensions. Dimensionality reduction can yield lower-dimensional image data that retains the key features of the original grayscale image. Subsequent processing and recognition of the lower-dimensional image data can effectively improve image recognition efficiency.
[0044] In some embodiments, the optical computing system further includes a laser source 5 and a first optical switch 6. The first optical switch 6 can be located on the light-emitting side of the laser source 5. The first optical switch 6 can be an MZI switch, which has the same structure as an MZI modulator, except that it only functions as a switch. The first optical switch 6 can also be other types of optical switches, which are not specifically limited here.
[0045] The laser source 5 is used to generate an initial optical signal.
[0046] The first optical switch 6 is used to switch the transmission direction of the optical signal, so as to sequentially transmit the initial optical signal generated by the laser source 5 forward to the first input / output module 1 and reverse to the second input / output module 2 in each iteration.
[0047] The first optical switch 6 can alternately switch the transmission direction of the optical signal between forward and reverse directions. In each iteration, the first optical switch 6 first switches the transmission direction of the optical signal to the forward direction, causing the optical signal generated by the laser source 5 to be transmitted in the forward direction to the first input / output module 1. After the second input / output module 2 obtains the output vector, the first optical switch 6 switches the transmission direction of the optical signal to the reverse direction, causing the optical signal generated by the laser source 5 to be transmitted in the reverse direction to the second input / output module 2. Once the first input / output module 1 obtains the output vector, the iteration is complete.
[0048] The processing module 4 can also be electrically connected to the laser source 5 to control the laser source 5 to generate the initial optical signal. The processing module 4 can also be electrically connected to the first optical switch 6 to control the first optical switch 6 to switch the transmission direction of the optical signal.
[0049] In this embodiment, the transmission direction of the optical signal is switched by the first optical switch 6 to achieve alternating forward and reverse transmission of the optical signal. This eliminates the need to provide laser sources at the two input and output modules, thereby simplifying the system structure and reducing costs.
[0050] In some embodiments, the optical computing module 3 includes a cascade optical modulator. The cascade optical modulator includes a multi-stage optical modulator, and each stage optical modulator includes at least one optical modulator 31. Figure 1As shown, the row of optical modulators 31 disposed closest to the first input / output module 1 is a first-stage optical modulator, and the row of optical modulators 31 disposed closest to the second input / output module 2 is a last-stage optical modulator.
[0051] The optical computing module 3 is further configured to input the optical signal modulated by the first input / output module 1 into the first-stage optical modulator, perform calculations on the parameter matrix formed in the forward direction with the cascaded optical modulators, and output the calculated optical signal to the second input / output module 2 by the last-stage optical modulator; input the optical signal modulated by the second input / output module 2 into the last-stage optical modulator, perform calculations on the transposed matrix formed in the reverse direction with the cascaded optical modulators, and output the calculated optical signal to the first input / output module 1 by the first-stage optical modulator.
[0052] In each iteration, the optical signal modulated by the first input / output module 1 is transmitted from the first-stage optical modulator to the last-stage optical modulator, performing a multiplication-addition operation with the parameter matrix. Then, the optical signal modulated by the second input / output module 2 is transmitted from the last-stage optical modulator to the first-stage optical modulator, performing a multiplication-addition operation with the transposed matrix of the parameter matrix.
[0053] In this embodiment, by inputting the modulated optical signal into the optical calculation module 3 in the forward and reverse directions, efficient calculation of the parameter matrix and the transposed matrix can be achieved, thereby reducing the calculation complexity and improving the calculation efficiency.
[0054] In some embodiments, the optical modulator 31 is an MZI (Mach-Zehnder Interferometer) modulator.
[0055] The MZI modulator is a commonly used silicon photonic device and is also the natural minimum matrix core. The matrix network constructed by cascading it according to specific rules can perform arbitrary matrix multiplication. Figure 2 As shown in the figure, the basic structure of the MZI modulator consists of two couplers and two sets of interference arms. The interference arms are waveguides in which light propagates. One of the interference arms in each set is equipped with an adjustable phase shifter, which provides and Phase shift, the black rectangle is the coupler, and the white rectangle is the adjustable phase shifter. The MZI modulator has two inputs In1 and In2 and two outputs Out1 and Out2. The input-output relationship can be expressed as a unitary rotation matrix. ,Right now: ; .
[0056] By modulating the phase of the adjustable phase shifter and , you can change , realizing arbitrary unit unit rotation matrix. The phase modulation is realized by external electrical signals. Currently, there are two commonly used adjustable phase shifters: electro-optical phase shifters and thermo-optical phase shifters. That is, the phase is adjusted by adjusting the input voltage or the temperature of the device through the electrical signal. and The input optical signal is output from the two ports with the power distributed by the matrix, and the calculation result can be obtained by measurement.
[0057] According to the triangle decomposition algorithm, any n×n unitary matrix can theoretically be decomposed into n(n-1) / 2 unit unitary rotation matrices multiplied consecutively. For example, the decomposition of a 3×3 unitary matrix follows ,in , , Has the following form: , , .
[0058] here , each and The maximum unitary matrix that can be executed is determined by the number of inputs and outputs of the triangular network. A 3×3 unitary matrix requires 3 pairs of inputs and outputs.
[0059] It can be seen that the optical interferometry calculation based on the cascaded MZI modulator is highly adjustable and can realize any calculation process.
[0060] In each iteration of this embodiment, the first input-output module 1 forward inputs the modulated optical signal to the cascaded optical modulator as follows: .
[0061] in, represents the parameter matrix of the cascaded optical modulator, and the right-pointing arrow indicates input from the left (i.e., forward input, i.e., input from the first input-output module 1). is the beam splitter matrix in the optical modulator, is the phase shifter matrix in the optical modulator.
[0062] The second input-output module 2 inputs the modulated optical signal in reverse to the cascade optical modulator as follows: .
[0063] It can be seen from the two formulas that for the same set of cascade optical modulator parameter matrices, the matrix corresponding to the forward input optical signal and the matrix corresponding to the reverse input optical signal are just the transpose of each other. Without loss of generality, the matrix of the cascade optical modulator corresponding to the forward input can be set as , the matrix of the cascade optical modulator corresponding to the reverse input is .
[0064] In some embodiments, the processing module 4 is electrically connected to the cascade optical modulators, and is further configured to update parameters of the cascade optical modulators according to the characteristic matrix to adjust the parameter matrix.
[0065] The processing module 4 may be electrically connected to each optical modulator 31 in the cascade optical modulator to adjust parameters of each optical modulator 31 .
[0066] In the case where the optical modulator 31 is an MZI modulator, the processing module 4 generates the optical modulator 31 according to the characteristic matrix. A , the parameters of each optical modulator 31 can be determined and set, such as i Parameters of the optical modulator and .
[0067] For example, for the feature matrix A , which can be decomposed by SVD . For the three decomposed matrices Implement hardware and determine all parameters in the interference gating module (i.e., the number of each MZI modulator and ).
[0068] in, is a diagonal matrix: .
[0069] The parameters in can directly correspond to n-1 parameters of n-1 MZI modulators , where the MZI modulator on the i-th , , and the interferometer arms without parameters in these n-1 MZI modulators must be discarded.
[0070] is an orthogonal matrix, so it can be decomposed using a matrix block diagonalization scheme to obtain the remaining parameters in the corresponding gating module. U For example, the calculation process of block diagonalization is: .
[0071] in, is the element at row n and column j, is the element in row j and column n. The second equation is established by block diagonalization, where The matrix generated by the j-th MZI in the n-th column ( ).
[0072] The specific calculation method is: make .
[0073] According to the formula Can be obtained and , and then substitute into the second line Obtain and , and so on, to obtain all the parameters of this group of n-1 MZI modulators.
[0074] This completes the decomposition of the last row and achieves the block diagonalization of the last row and the first n-1 rows. Then the block diagonalization of the U(n-1) matrix is performed. The general form of the block diagonalization formula of U(k) is as follows: .
[0075] Until U(1) until. The same calculation method can be used.
[0076] In this embodiment, the processing module 4 accurately adjusts the parameters of the cascade optical modulator according to the characteristic matrix, thereby realizing dynamic control of the cascade optical modulator.
[0077] In some embodiments, the first input-output module 1 and the second input-output module 2 respectively include a phase modulator 11 , a photodetector 12 , and a second optical switch 13 .
[0078] The photodetector 12 is used to convert the input calculated optical signal into an electrical signal to obtain an output vector.
[0079] The phase modulator 11 is used to modulate the input initial optical signal according to the random vector or the latest output vector obtained by the photodetector 12 .
[0080] The second optical switch 13 is used to switch the transmission direction of the optical signal, transmitting the optical signal modulated by the phase modulator 11 to the optical calculation module 3 , or transmitting the calculated optical signal output by the optical calculation module 3 to the photodetector 12 .
[0081] In each iteration, an initial optical signal is first input into the first input / output module 1. The phase modulator 11 in the first input / output module 1 modulates the input initial optical signal according to a random vector (a random vector is used in the first iteration) or the most recently obtained output vector (i.e., the output vector obtained in the previous iteration). The second optical switch 13 in the first input / output module 1 switches the optical signal transmission direction from the phase modulator 11 in the first input / output module 1 to the optical computing module 3, transmitting the modulated signal from the phase modulator 11 in the first input / output module 1 to the optical computing module 3. When the optical computing module 3 completes the calculation, the second optical switch 13 in the second input / output module 2 switches the optical signal transmission direction from the optical computing module 3 to the photodetector 12 in the second input / output module 2, transmitting the calculated optical signal output by the optical computing module 3 to the photodetector 12 in the second input / output module 2. The photodetector 12 in the second input / output module 2 converts the calculated optical signal into an electrical signal, obtaining the output vector of the second input / output module 2.
[0082] The initial optical signal is then input into the second input / output module 2. The phase modulator 11 in the second input / output module 2 modulates the input initial optical signal based on the newly obtained output vector. The second optical switch 13 in the second input / output module 2 switches the optical signal transmission direction from the phase modulator 11 in the second input / output module 2 to the optical computation module 3, so that the signal modulated by the phase modulator 11 in the second input / output module 2 is transmitted to the optical computation module 3. When the optical computation module 3 completes the computation, the second optical switch 13 in the first input / output module 1 switches the optical signal transmission direction from the optical computation module 3 to the photodetector 12 in the first input / output module 1, so that the calculated optical signal output by the optical computation module 3 is transmitted to the photodetector 12 in the first input / output module 1. The photodetector 12 in the first input / output module 1 converts the calculated optical signal into an electrical signal, obtaining the output vector of the first input / output module 1, i.e., the output vector of the current iteration.
[0083] In this embodiment, phase modulators and photodetectors are provided in both input and output modules, and the second optical switch 13 is used to switch the two input and output modules between input and output, thereby realizing forward and reverse multiplexing of optical paths and having a simple structure.
[0084] The second optical switch 13 may be an MZI switch, which has the same structure as an MZI modulator, but is only used for switching. The second optical switch 13 may also be other types of optical switches, which are not specifically limited here.
[0085] In some embodiments, the processing module 4 is electrically connected to the phase modulator 11 and the photodetector 12 respectively, and is configured to obtain an output vector through the photodetector 12; and update the parameters of the phase modulator 11 according to the random vector or the latest obtained output vector.
[0086] The processing module 4 can obtain the random vector in the first iteration and update the parameters of each phase modulator 11 according to the random vector. The phase modulator 11 in the first input and output module 1 modulates the initial optical signal based on the updated parameters, and the modulated optical signal represents the random vector.
[0087] For example, according to the random vector , the parameters of each phase modulator 11 can be calculated. j Parameters of the phase modulator The calculation formula is as follows: .
[0088] in, is a random vector The largest element in is a random vector Middle j elements.
[0089] After the photodetector 12 in the first input / output module 1 obtains an output vector, the processing module 4 obtains the output vector of the first input / output module 1 through the photodetector 12 in the first input / output module 1 and updates the parameters of each phase modulator 11 based on the newly obtained output vector. The phase modulator 11 in the first input / output module 1 modulates the initial optical signal based on the updated parameters. The modulated optical signal represents the newly obtained output vector (i.e., the newly obtained output vector of the first input / output module 1).
[0090] After the photodetector 12 in the second input / output module 2 obtains the output vector, the processing module 4 obtains the output vector of the second input / output module 2 through the photodetector 12 in the second input / output module 2 and updates the parameters of each phase modulator 11 based on the output vector. The phase modulator 11 in the second input / output module 2 modulates the initial optical signal based on the updated parameters. The modulated optical signal represents the most recently obtained output vector (i.e., the most recently obtained output vector of the second input / output module 2).
[0091] The processing module 4 may also be electrically connected to the second optical switch 13 to control the second optical switch 13 to switch the transmission direction of the optical signal.
[0092] In this embodiment, the processing module 4 accurately adjusts the parameters of the phase modulator 11 in real time, thereby achieving dynamic control of the phase modulator 11 .
[0093] In some embodiments, the optical computing system further includes a first beam splitter 7 and a second beam splitter 8. The first input / output module 1 and the second input / output module 2 each include a plurality of input / output units 20, each including a phase modulator 11, a photodetector 12, and a second optical switch 13.
[0094] The first beam splitter 7 is used to split the forward-transmitting initial optical signal into multiple beams. The multiple initial optical signals are respectively transmitted to the phase modulators 11 in the multiple input and output units 20 of the first input and output module 1. The phase modulators 11 in the multiple input and output units 20 of the first input and output module 1 modulate the input initial optical signals and output the modulated optical signals to the optical computing module 3. The calculated optical signals output by the optical computing module 3 have multiple beams, which are respectively output to the photodetectors 12 in the multiple input and output units 20 of the second input and output module 2. The photodetectors 12 in the multiple input and output units 20 of the second input and output module 2 convert the calculated optical signals into electrical signals. The electrical signals converted by the photodetectors 12 in the multiple input and output units 20 of the second input and output module 2 constitute the output vectors of the second input and output module 2.
[0095] The second beam splitter 8 is used to split the reversely transmitted initial optical signal into multiple beams, and the multiple initial optical signals are respectively transmitted to the phase modulators 11 in the multiple input and output units 20 of the second input and output module 2. The phase modulators 11 in the multiple input and output units 20 of the second input and output module 2 modulate the initial optical signals input thereto and output the modulated optical signals to the optical computing module 3. The calculated optical signals output by the optical computing module 3 have multiple beams, which are respectively output to the photodetectors 12 in the multiple input and output units 20 of the first input and output module 1. The photodetectors 12 in the multiple input and output units 20 of the first input and output module 1 convert the calculated optical signals input thereto into electrical signals. The electrical signals converted by the photodetectors 12 in the multiple input and output units 20 of the first input and output module 1 constitute the output vectors of the first input and output module 1.
[0096] This embodiment splits the initial optical signal into multiple beams through the first beam splitter 7 and the second beam splitter 8, is applicable to characteristic matrices of various dimensions, and has a simple structure.
[0097] According to the optical computing system provided in the embodiments of the present application, optical path multiplexing is achieved through targeted design of optical computing waveguides and logic circuits. Efficient calculation of parameter matrices and transposed matrices is achieved through a forward and reverse dual calculation process, thereby improving the performance of optical computing in processing computational problems involving matrix transposition. Optical computing reduces the time complexity and the amount of data that needs to be transmitted, thereby reducing data processing complexity and improving data processing efficiency.
[0098] The present application also provides a data processing method that can be applied to the optical computing system in the above embodiment. The method is described in detail in conjunction with the execution flow of the data processing method.
[0099] Specifically, Figure 3 The present invention provides a flowchart of a data processing method according to an embodiment of the present application.
[0100] like Figure 3 As shown, the data processing method includes steps 110 to 120.
[0101] Step 110: Obtain the feature matrix to be processed.
[0102] For example, the data processing method can be applied to the identification of core nodes. In step 110, the adjacency matrix of multiple nodes is obtained and the adjacency matrix is used as the feature matrix. A Among them, multiple nodes can be a server cluster composed of multiple server nodes, and the core node can be a server that needs to communicate with multiple servers and / or multiple devices. The adjacency matrix can be constructed based on the connection status of multiple nodes in different time slices (such as hourly traffic records). A ij Can be represented as a node i In time slice j of traffic.
[0103] Step 120: Process the characteristic matrix. Perform multiple iterations during the data processing. In each of the multiple iterations, modulate the optical signal in the current iteration according to the output vector obtained in the previous iteration, calculate the modulated optical signal with the parameter matrix and the transposed matrix of the parameter matrix in sequence, convert the calculated optical signal into an electrical signal, and obtain the output vector of the current iteration. Update the parameter matrix according to the characteristic matrix. When the change in the output vectors obtained in two adjacent iterations is less than the target value, or the number of iterations reaches the target number, determine that the iteration is complete, and determine the key feature information of the characteristic matrix based on the output vector obtained in the last iteration.
[0104] Combine Figure 1 As shown, during the data processing process, the processing module 4 processes the feature matrix to be processed according to A , and the parameter matrix is updated. In each of the multiple iterations, the laser source 5 sequentially outputs the forward initial optical signal and the reverse initial optical signal through the first optical switch 6 .
[0105] In the first iteration, the processing module 4 generates a random vector Update the parameters of each phase modulator 11. The phase modulator of the first input / output module 1 inputs the forward initial optical signal, modulates the forward initial optical signal, and outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 inputs the modulated optical signal in the forward direction and compares the modulated optical signal with the parameter matrix B Perform multiplication and addition calculations, and output the calculated signal to the photodetector 12 of the second input and output module 2. The photodetector 12 of the second input and output module 2 converts the calculated optical signal into an electrical signal to obtain an output vector .
[0106] The processing module 4 obtains the output vector through the photoelectric detector 12 of the second input and output module 2 , and according to the output vector Update the parameters of each phase modulator 11. The phase modulator 11 of the second input / output module 2 inputs the reverse initial optical signal, modulates the reverse initial optical signal, and outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 inputs the modulated optical signal in reverse, and compares the modulated optical signal with the parameter matrix B The transposed matrix of Perform multiplication and addition calculations, and output the calculated signal to the photodetector 12 of the first input and output module 1. The photodetector 12 of the first input and output module 1 converts the calculated optical signal into an electrical signal to obtain an output vector The processing module 4 obtains the output vector through the photoelectric detector 12 of the first input and output module 1 , and the output vector as the output vector of the first iteration.
[0107] In the k In the iterations, k >1, the processing module 4 is based on the output vector that the first input and output module 1 has recently obtained (that is, the first input and output module 1 has recently obtained the output vector k -1 output vector obtained in the iteration ) Update the parameters of each phase modulator 11. The phase modulator 11 of the first input / output module 1 inputs the forward initial optical signal, modulates the forward initial optical signal, and outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 inputs the modulated optical signal in the forward direction and compares the modulated optical signal with the parameter matrix B Perform multiplication and addition calculations, and output the calculated signal to the photodetector 12 of the second input and output module 2. The photodetector 12 of the second input and output module 2 converts the calculated optical signal into an electrical signal to obtain an output vector .
[0108] The processing module 4 obtains the output vector through the photoelectric detector 12 of the second input and output module 2 , and according to the output vector Update the modulation parameters of each phase modulator 11. The phase modulator 11 of the second input / output module 2 inputs the reverse initial optical signal, modulates the reverse initial optical signal, and outputs the modulated optical signal to the optical calculation module 3. The optical calculation module 3 inputs the modulated optical signal in reverse, and compares the modulated optical signal with the parameter matrix B The transposed matrix of Perform multiplication and addition calculations, and output the calculated signal to the photodetector 12 of the first input and output module 1. The photodetector 12 of the first input and output module 1 converts the calculated optical signal into an electrical signal to obtain an output vector The processing module 4 obtains the output vector through the photoelectric detector 12 of the first input and output module 1 , and the output vector As the first k The output vector of the iteration.
[0109] At the end of the iteration, the feature matrix is determined based on the output vector obtained from the last iteration. A The key feature information retains the feature matrix A The key information in the feature matrix A Perform dimensionality reduction. Then the feature matrix A It processes the key feature information of the model, improves processing efficiency, reduces storage requirements, eliminates noise and redundancy, and enhances the generalization ability of the model.
[0110] This embodiment updates the parameter matrix based on the characteristic matrix to be processed. In each iteration, the modulated optical signal is calculated with the parameter matrix through the forward optical path, and then calculated with the transposed matrix of the parameter matrix through the reverse optical path. By multiplexing the optical paths in forward and reverse directions, efficient calculation of the parameter matrix and the transposed matrix is completed.
[0111] In this embodiment, the optical matrix transposition requires a time complexity of O(n), while the related art uses an electronic calculation with a time complexity of O(mn). In this embodiment, the optical matrix transposition requires only O(n) data (the input and output dimensions of both input and output modules are n, so the data volume is O(n)). In the related art, electronic calculations require information transfer based on the size of the feature matrix, so the data volume required is O(mn).
[0112] Therefore, this embodiment can effectively reduce time complexity and the amount of calculated data, thereby reducing the complexity of data processing and improving data processing efficiency.
[0113] In some embodiments, after obtaining the output vector of the current iteration, the data processing method further includes: Normalize the output vector obtained from the current iteration.
[0114] In the current iteration, after obtaining the output vector of the current iteration, the processing module 4 can directly perform subsequent processing on the output vector obtained in the current iteration (such as determining the end of the iteration, determining key feature information, etc.), or can perform normalization processing on the output vector obtained in the current iteration and then perform subsequent processing on the normalized output vector. k The output vector of the iteration .
[0115] This embodiment normalizes the output vector obtained in the current iteration before performing subsequent processing, which can reduce numerical errors and improve the accuracy of subsequent calculations. In some embodiments, the key feature information includes a maximum eigenvalue and a corresponding eigenvector, and the eigenvector includes a left eigenvector and a right eigenvector.
[0116] Based on the output vector obtained from the last iteration, the key feature information of the feature matrix is determined, including: The output vector obtained from the last iteration is used as the right eigenvector corresponding to the maximum eigenvalue; Calculate the maximum eigenvalue based on the right eigenvector and eigenmatrix corresponding to the maximum eigenvalue; Calculate the left eigenvector corresponding to the maximum eigenvalue based on the right eigenvector corresponding to the maximum eigenvalue, the eigenmatrix, and the maximum eigenvalue.
[0117] Singular Value Decomposition (SVD) is an effective method for data dimensionality reduction. The core idea of SVD is to decompose any m×n dimensional matrix A into the product of three specific matrices, namely .in, is an m×m orthogonal matrix, whose column vectors are called left singular vectors; It is an m×n diagonal matrix, the non-negative elements on its diagonal are called singular values, and they are arranged in descending order; is an n×n orthogonal matrix whose column vectors are called right singular vectors.
[0118] From a geometric point of view, SVD reveals the transformation characteristics of matrix A in high-dimensional space. When matrix A acts on a vector, it can be regarded as first Rotate, then pass Scale and then Rotation is performed. The magnitude of the singular values reflects the degree of "stretching" of the matrix in different directions, while the singular vectors indicate these directions. This decomposition method not only provides an intuitive way to understand the inherent structure of the matrix, but also provides a powerful tool for solving many practical problems.
[0119] In data processing and analysis, SVD is widely used in tasks such as data dimensionality reduction, noise removal, and pattern recognition. For example, in image processing, by retaining the first few singular values of a matrix and their corresponding singular vectors, an image can be effectively compressed and denoised while preserving its key features. In recommendation systems, SVD can uncover potential connections between users and items. By decomposing the user-item rating matrix, it can extract implicit features of both users and items, enabling more accurate personalized recommendations.
[0120] SVD also has extensive applications in fields such as signal processing, statistics, machine learning, and computer graphics. In signal processing, SVD can be used for signal denoising and feature extraction, helping to extract useful information from complex signals. In statistics, SVD is closely related to principal component analysis (PCA), providing an alternative perspective for data dimensionality reduction and analysis. In machine learning, SVD is used for tasks such as algorithm optimization, feature selection, and model compression, helping to improve model performance and efficiency. In computer graphics, SVD can be used for 3D model transformation, animation, and image synthesis, providing powerful support for graphics generation and processing.
[0121] As a powerful mathematical tool, singular value decomposition has shown a wide range of application value in practice and provides an effective way to solve various complex problems. The total computational complexity of SVD is usually arrive The computational complexity of SVD can be very high for large matrices, so in practical applications, some approximate algorithms or acceleration techniques are usually used to reduce the computational complexity.
[0122] In some embodiments, the maximum eigenvalue is calculated as: ; in, is the maximum eigenvalue, is the feature matrix, is the right eigenvector corresponding to the largest eigenvalue.
[0123] The calculation formula for the left eigenvector corresponding to the maximum eigenvalue is: ; in, is the left eigenvector corresponding to the largest eigenvalue.
[0124] After completing the kth iteration, the iteration is determined to be complete, and the output vector of the kth iteration after normalization is That is, the right eigenvector corresponding to the maximum eigenvalue of the characteristic matrix A (that is, the maximum singular value in SVD) (That is, the right singular vector in SVD). According to the right eigenvector corresponding to the maximum eigenvalue and the feature matrix A , the characteristic matrix can be calculated A The maximum eigenvalue of . According to the right eigenvector corresponding to the maximum eigenvalue , feature matrix A and the feature matrix A The maximum eigenvalue of , the characteristic matrix can be calculated A The left eigenvector corresponding to the largest eigenvalue of (i.e. the left singular vectors in SVD).
[0125] This embodiment extracts feature matrix based on SVD A The key feature information of the model is obtained and dimension reduction is achieved to reduce the computational complexity while retaining the key information, improve the generalization ability of the model, and have wide applicability.
[0126] After normalization, k The output vector of the iteration After that, it was detected If the result is less than the target value, the result is determined to have converged and the iteration is stopped, effectively ensuring the accuracy of the result.
[0127] Alternatively, the number of iterations detected k When the target number of iterations is reached, stop the iteration to avoid an infinite loop caused by the inability to converge the results.
[0128] At the end of the iteration, according to the normalized k The output vector of the iteration , determine the key feature information of the feature matrix.
[0129] For example, this data processing method can be applied to identifying core nodes. By processing the adjacency matrix, key characteristic information of the adjacency matrix can be obtained, namely the maximum eigenvalue of the adjacency matrix and the corresponding eigenvector. The maximum eigenvalue indicates optimal communication performance, and the eigenvector includes the weights of multiple nodes, which indicate the probability that the corresponding node has optimal communication performance. The node with the largest weight in the eigenvector is identified as the core node.
[0130] Through data processing methods, core nodes among multiple nodes are identified to protect them (such as deploying redundancy and priority monitoring), avoiding large-scale network paralysis caused by core node failures and reducing the risk of core nodes being attacked; more broadband resources are allocated to core nodes, load balancing is optimized, and overall efficiency is improved.
[0131] In some embodiments, performing data processing on the feature matrix includes: The characteristic matrix is subjected to multiple data processing, and multiple iterations are performed during each data processing. The parameter matrix in the current data processing is updated according to the characteristic matrix of the current data processing; after determining the key characteristic information of the characteristic matrix of the current data processing, the characteristic matrix of the current data processing is reduced in order to obtain the characteristic matrix of the next data processing.
[0132] By processing the feature matrix once, the most critical feature information of the feature matrix can be obtained. By processing the feature matrix twice, the less critical feature information of the feature matrix can be obtained. Thus, by processing the feature matrix multiple times, the most critical multiple feature information of the feature matrix can be obtained. The number of data processing times can be set according to actual needs.
[0133] For example, the data processing method can be applied to the identification of core nodes. Each data processing step can identify one core node. The number of data processing steps is determined based on the number of core nodes to be identified.
[0134] The feature matrix of each data processing needs to be updated. The feature matrix of the first data processing A 1 is the feature matrix obtained in step 110 A .
[0135] In the first data processing, according to the feature matrix of the first data processing A 1 Update the parameter matrix and determine the characteristic matrix of the first data processing through multiple iterations A 1's key feature information, that is, the feature matrix of the first data processing A The largest eigenvalue of 1 and the corresponding eigenvector .
[0136] Then, the feature matrix of the first data processing A 1 Perform order reduction processing to obtain the characteristic matrix of the second data processing A 2.
[0137] In the second data processing, according to the feature matrix of the second data processing A 2 Update the parameter matrix and determine the characteristic matrix of the second data processing through multiple iterationsA 2 key feature information, that is, the feature matrix of the second data processing A The largest eigenvalue of 2 and the corresponding eigenvector .
[0138] Then, the feature matrix of the second data processing A 2 Perform order reduction to obtain the characteristic matrix of the third data processing A 3.
[0139] By analogy, in k In the data processing, according to k The feature matrix of secondary data processing A k Update the parameter matrix and determine the k The feature matrix of secondary data processing A k The key feature information of k The feature matrix of secondary data processing A k The maximum eigenvalue of and the corresponding eigenvector .
[0140] Then, for the k The feature matrix of secondary data processing A k Perform order reduction processing to obtain k+ Feature matrix of 1 data processing A k+1 .
[0141] When the key feature information obtained reaches the specified number L, that is, the number of processing times reaches the specified number L, the processing ends. The L largest eigenvalues constitute the eigenvalue matrix (that is, the singular value matrix in SVD). ), the L left eigenvectors constitute the first L columns of the left characteristic matrix (i.e., the left singular vector matrix U in SVD), and the L right eigenvectors constitute the right characteristic matrix (i.e., the right singular vector matrix in SVD). )'s first L columns.
[0142] This embodiment sequentially extracts the most critical features in the feature matrix by reducing the order, thereby avoiding information redundancy and reducing computational complexity.
[0143] In some embodiments, performing order reduction processing on the feature matrix of the current data processing to obtain the feature matrix of the next data processing includes: Determine the feature contribution value of the current data processing based on the key feature information of the feature matrix of the current data processing; The feature matrix of the current data processing is subtracted from the feature contribution value of the current data processing to obtain the feature matrix of the next data processing.
[0144] In some embodiments, the calculation formula of the feature matrix of the k+1th data processing is: ; in, is the characteristic matrix of the k+1th data processing, is the characteristic matrix of the kth data processing, is the feature contribution value of the k-th data processing, is the maximum eigenvalue of the characteristic matrix of the kth data processing, is the right eigenvector corresponding to the maximum eigenvalue of the k-th data processing, It is the left eigenvector corresponding to the maximum eigenvalue of the k-th data processing, k ≥ 1.
[0145] In the k In the data processing, determine the k The feature matrix of secondary data processing A k The key feature information of k The feature matrix of secondary data processing A k The maximum eigenvalue of and the corresponding eigenvector Afterwards, according to k The feature matrix of secondary data processing A k The maximum eigenvalue of and the corresponding eigenvector , calculate the k Contribution value of data processing . k The feature matrix of secondary data processing A k minus the k Contribution value of data processing , you can get the first k+ Feature matrix of 1 data processing .
[0146] This embodiment reduces the order of the feature matrix of the current data processing by subtracting the feature contribution value of the current data processing, which can minimize information loss and improve the accuracy of key feature information extraction.
[0147] According to the data processing method provided in the embodiment of the present application, the parameter matrix in the optical computing module is updated according to the characteristic matrix to be processed. In each iteration, the modulated optical signal is input forward and calculated with the parameter matrix, and then reversely input and calculated with the transposed matrix of the parameter matrix, so as to complete the efficient calculation of the parameter matrix and the transposed matrix through optical computing. At the end of the iteration, the key feature information of the characteristic matrix is determined based on the output vector obtained from the last iteration, thereby reducing processing complexity and improving processing efficiency.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0149] An embodiment of the present application also provides a computer program product.
[0150] Figure 4 A block diagram of a computer program product provided according to an embodiment of the present application.
[0151] like Figure 4 As shown, the computer program product 10 includes: an acquisition module 100 and a data processing module 200 .
[0152] An acquisition module 100 is used to obtain a feature matrix to be processed; The data processing module 200 is used to perform data processing on the characteristic matrix; multiple iterations are performed during the data processing process. In each iteration of the multiple iterations, the optical signal in the current iteration is modulated according to the output vector obtained in the previous iteration, and the modulated optical signal is calculated in sequence with the parameter matrix and the transposed matrix of the parameter matrix to convert the calculated optical signal into an electrical signal to obtain the output vector of the current iteration; the parameter matrix is updated according to the characteristic matrix; when the change in the output vectors obtained from two adjacent iterations is less than the target value, or the number of iterations reaches the target number, the iteration is determined to be complete, and the key characteristic information of the characteristic matrix is determined based on the output vector obtained in the last iteration.
[0153] In some embodiments, the key feature information includes a maximum eigenvalue and a corresponding eigenvector, and the eigenvector includes a left eigenvector and a right eigenvector. The data processing module 200 includes a first determining unit, a first calculating unit, and a second calculating unit.
[0154] A first determining unit is configured to use an output vector obtained in the last iteration as a right eigenvector corresponding to the maximum eigenvalue; a first calculation unit, configured to calculate the maximum eigenvalue based on a right eigenvector corresponding to the maximum eigenvalue and the characteristic matrix; The second calculation unit is configured to calculate the left eigenvector corresponding to the maximum eigenvalue based on the right eigenvector corresponding to the maximum eigenvalue, the characteristic matrix, and the maximum eigenvalue.
[0155] In some embodiments, the maximum eigenvalue is calculated as follows: ; in, is the maximum eigenvalue, is the feature matrix, is the right eigenvector corresponding to the maximum eigenvalue; The calculation formula of the left eigenvector corresponding to the maximum eigenvalue is: ; in, is the left eigenvector corresponding to the maximum eigenvalue.
[0156] In some embodiments, the computer program product further comprises a normalization processing module.
[0157] The normalization processing module is used to normalize the output vector of the current iteration.
[0158] In some embodiments, the data processing module 200 is further configured to: The data processing is performed multiple times on the characteristic matrix, and the multiple iterations are performed during each data processing. The parameter matrix in the current data processing is updated according to the characteristic matrix of the current data processing; after determining the key characteristic information of the characteristic matrix of the current data processing, the characteristic matrix of the current data processing is reduced in order to obtain the characteristic matrix of the next data processing.
[0159] In some embodiments, the data processing module 200 includes a second determining unit and a third determining unit.
[0160] A second determining unit is used to determine a feature contribution value of the current data processing according to key feature information of the feature matrix of the current data processing; The third determining unit is configured to subtract the feature contribution value of the current data processing from the feature matrix of the current data processing to obtain the feature matrix of the next data processing.
[0161] In some embodiments, the calculation formula of the feature matrix of the k+1th data processing is: ; in, is the characteristic matrix of the k+1th data processing, is the characteristic matrix of the kth data processing, is the feature contribution value of the k-th data processing, is the maximum eigenvalue of the characteristic matrix of the kth data processing, is the right eigenvector corresponding to the maximum eigenvalue of the k-th data processing, It is the left eigenvector corresponding to the maximum eigenvalue of the k-th data processing, k ≥ 1.
[0162] For the description of the features in the embodiment corresponding to the computer program product 10, reference can be made to the relevant description of the embodiment corresponding to the data processing method, which will not be repeated here.
[0163] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above data processing method embodiments.
[0164] An embodiment of the present application further provides a non-volatile computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned data processing method embodiments when running.
[0165] In an exemplary embodiment, the non-volatile computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0166] An embodiment of the present application further provides another computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above data processing method embodiments are implemented.
[0167] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned data processing method embodiments are implemented.
[0168] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0169] The above is a detailed introduction to a data processing method, product, device and medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. An optical computing system, characterized in that It includes a first input and output module, a second input and output module, an optical computing module and a processing module; The first input-output module and the second input-output module are configured to sequentially input an initial optical signal in each of the multiple iterations, and modulate the initial optical signal according to their respective latest obtained output vectors when inputting the initial optical signal; The optical calculation module is used to forward input the optical signal modulated by the first input and output module, perform calculations with the parameter matrix, and output the calculated optical signal to the second input and output module; Reversely inputting the optical signal modulated by the second input / output module, performing calculations on the optical signal and the transposed matrix of the parameter matrix, and outputting the calculated optical signal to the first input / output module; the parameter matrix is adjusted according to the characteristic matrix to be processed; The first input-output module and the second input-output module are further configured to convert the calculated optical signals into electrical signals when the calculated optical signals are input to the modules, thereby obtaining respective output vectors; The processing module is used to determine the end of iteration when the change in the output vector obtained from two adjacent iterations is less than the target value or the number of iterations reaches the target number, and determine the key feature information of the feature matrix based on the output vector obtained from the last iteration.
2. The optical computing system according to claim 1, wherein: The optical computing system further includes a laser source and a first optical switch; The laser source is used to generate an initial optical signal; The first optical switch is used to switch the transmission direction of the optical signal, so that in each iteration, the initial optical signal generated by the laser source is transmitted forward to the first input / output module and reversely to the second input / output module.
3. The optical computing system according to claim 1, wherein: The optical computing module includes a cascaded optical modulator; The optical calculation module is further configured to input the optical signal modulated by the first input / output module into the first-stage optical modulator, perform calculations on the parameter matrix formed in the forward direction of the cascaded optical modulator, and output the calculated optical signal to the second input / output module via the last-stage optical modulator; The optical signal modulated by the second input-output module is input to the last-stage optical modulator, and is calculated using the transposed matrix formed inversely with the cascaded optical modulator. The calculated optical signal is output to the first input-output module by the first-stage optical modulator.
4. The optical computing system according to claim 3, wherein: The processing module is electrically connected to the cascade optical modulator, and is further configured to update parameters of the cascade optical modulator according to the characteristic matrix to adjust the parameter matrix.
5. The optical computing system according to claim 1, wherein: The first input-output module and the second input-output module respectively include a phase modulator, a photodetector and a second optical switch; The photoelectric detector is used to convert the input calculated optical signal into an electrical signal to obtain an output vector; The phase modulator is used to modulate the input initial optical signal according to the random vector or the latest output vector obtained by the photodetector; The second optical switch is used to switch the transmission direction of the optical signal, transmitting the optical signal modulated by the phase modulator to the optical calculation module, or transmitting the calculated optical signal output by the optical calculation module to the photodetector.
6. The optical computing system according to claim 5, wherein: The processing module is electrically connected to the phase modulator and the photodetector respectively, and is configured to obtain an output vector through the photodetector; and update the parameters of the phase modulator according to the random vector or the latest obtained output vector.
7. A data processing method, characterized in that: Applied to the optical computing system according to any one of claims 1 to 6, the method comprises: Get the feature matrix to be processed; Data processing is performed on the characteristic matrix; multiple iterations are performed during the data processing process, and in each iteration of the multiple iterations, the optical signal in the current iteration is modulated according to the output vector obtained in the previous iteration, the modulated optical signal is calculated with the parameter matrix and the transposed matrix of the parameter matrix in sequence, and the calculated optical signal is converted into an electrical signal to obtain the output vector of the current iteration; the parameter matrix is updated according to the characteristic matrix; when the change in the output vectors obtained from two adjacent iterations is less than a target value or the number of iterations reaches the target number, the iteration is determined to be complete, and key feature information of the characteristic matrix is determined based on the output vector obtained in the last iteration.
8. The data processing method according to claim 7, characterized in that: The key feature information includes a maximum eigenvalue and a corresponding eigenvector, and the eigenvector includes a left eigenvector and a right eigenvector; Determining key feature information of the feature matrix based on the output vector obtained in the last iteration includes: The output vector obtained from the last iteration is used as the right eigenvector corresponding to the maximum eigenvalue; Calculating the maximum eigenvalue according to the right eigenvector corresponding to the maximum eigenvalue and the characteristic matrix; The left eigenvector corresponding to the maximum eigenvalue is calculated according to the right eigenvector corresponding to the maximum eigenvalue, the characteristic matrix, and the maximum eigenvalue.
9. The data processing method according to claim 8, characterized in that: The calculation formula of the maximum eigenvalue is: ; in, is the maximum eigenvalue, is the feature matrix, is the right eigenvector corresponding to the maximum eigenvalue; The calculation formula for the left eigenvector corresponding to the maximum eigenvalue is: ; in, is the left eigenvector corresponding to the maximum eigenvalue.
10. The data processing method according to claim 7, characterized in that: The performing data processing on the feature matrix includes: The data processing is performed multiple times on the characteristic matrix, and the multiple iterations are performed during each data processing. The parameter matrix in the current data processing is updated according to the characteristic matrix of the current data processing; after determining the key characteristic information of the characteristic matrix of the current data processing, the characteristic matrix of the current data processing is reduced in order to obtain the characteristic matrix of the next data processing.
11. The data processing method according to claim 10, characterized in that: The step of reducing the order of the characteristic matrix of the current data processing to obtain the characteristic matrix of the next data processing includes: Determine the feature contribution value of the current data processing based on the key feature information of the feature matrix of the current data processing; The feature matrix of the current data processing is subtracted from the feature contribution value of the current data processing to obtain the feature matrix of the next data processing.
12. The data processing method according to claim 11, characterized in that: The key feature information includes a maximum eigenvalue and a corresponding eigenvector, and the eigenvector includes a left eigenvector and a right eigenvector; The calculation formula of the characteristic matrix of the k+1th data processing is: ; in, is the characteristic matrix of the k+1th data processing, is the characteristic matrix of the kth data processing, is the feature contribution value of the k-th data processing, is the maximum eigenvalue of the characteristic matrix of the kth data processing, is the right eigenvector corresponding to the maximum eigenvalue of the k-th data processing, It is the left eigenvector corresponding to the maximum eigenvalue of the k-th data processing, k ≥ 1.
13. A computer program product, characterized in that include: An acquisition module is used to obtain the feature matrix to be processed; A data processing module, used for performing data processing on the feature matrix; performing multiple iterations during the data processing, modulating, in each of the multiple iterations, an optical signal in a current iteration according to an output vector obtained in a previous iteration, performing calculations on the modulated optical signal in sequence with a parameter matrix and a transposed matrix of the parameter matrix, and converting the calculated optical signal into an electrical signal to obtain an output vector of the current iteration; The parameter matrix is updated according to the characteristic matrix; when the change in the output vector obtained from two adjacent iterations is less than the target value, or the number of iterations reaches the target number, the iteration is determined to be complete, and the key characteristic information of the characteristic matrix is determined based on the output vector obtained from the last iteration.
14. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the data processing method according to any one of claims 7 to 12 when executing the computer program.
15. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the data processing method according to any one of claims 7 to 12 when executed by a processor.
Citation Information
Patent Citations
Photonic processing systems and methods
CN112384748A
Data processing method and device based on Ising machine and Ising machine
CN113722667A
Computing chip, system and data processing method
CN114520694A
Matrix calculation method based on light scattering and optical neural network
CN114707629A
Photon calculation solver for solving linear equation set
CN115543012A
Cited By
Optical computing device and method, equipment and storage medium
CN120909395A
Optical computing devices, methods, apparatuses, and storage media
CN120909395B