Training of quantum neural network using meta optimization
By employing meta-optimization networks on classical hardware to train quantum neural networks, the method addresses scalability and hardware limitations of quantum computers, facilitating efficient performance of complex machine learning tasks.
Patent Information
- Application Number
- JP2024048132
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-03-25
- Publication Date
- 2024-10-15
AI Technical Summary
Quantum computers face limitations such as high gate noise, limited scaling to hundreds of qubits, and the unavailability of reliable error detection and mitigation algorithms, making them less competitive than classical computers for complex machine learning tasks, and gradient-based optimization methods are computationally costly and not scalable.
A method using meta-optimization networks on classical hardware to train quantum neural networks (QNNs) by preparing a variational quantum circuit (VQC) on a quantum computer, reading a state buffer for historical information, selecting parameters, and iteratively updating them to minimize a cost function, enabling training without gradient computations.
This approach allows for effective training of QNNs on quantum computers, overcoming scalability issues and hardware limitations, enabling efficient performance of complex machine learning tasks.
Smart Images

Figure 2024146831000001_ABST
Abstract
Description
[Technical field]
[0001] The embodiments described in this disclosure relate to training quantum neural networks using meta-optimization. [Background technology]
[0002] Advances in the fields of quantum computing and machine learning have led to the development of hybrid quantum-classical algorithms that enable the execution of machine learning tasks (e.g., pattern recognition) using quantum computing. As machine learning evolves, machine learning tasks are increasing in scale and complexity. The execution of such machine learning tasks may require an extension from the classical domain to the quantum domain. This extension may be facilitated by quantum computers, which may outperform classical computers (hosting classical deep learning models) in terms of computational efficiency, accuracy, or latency associated with executing machine learning tasks. Quantum computing may enable scaling beyond classical approaches, but limitations such as high gate noise, scaling limitations (hundreds of qubits), and unavailability of reliable error detection and mitigation algorithms may make quantum computers less competitive against their classical counterparts. To overcome such limitations, researchers have developed quantum-classical algorithms (e.g., variational quantum algorithms (VQA)) that can act as a bridge between quantum and classical algorithms. Hybrid quantum-classical algorithms can be used to execute larger scale complex machine learning tasks on quantum computers based on the optimization of quantum computers using classical computers.
[0003] The subject matter claimed in this disclosure is not limited to embodiments that solve any disadvantages or that operate only in environments such as those described above. Rather, this background is only provided to illustrate one example technology area where some embodiments described in this disclosure may be practiced. Summary of the Invention
[0004] According to an aspect of the invention, a method may include a set of operations. The set of operations includes receiving a dataset associated with a machine learning task and preparing an input quantum state based on the received dataset. The set of operations may further include preparing a Variational Quantum Circuit (VQC) on the quantum computer to function as a Quantum Neural Network (QNN) and performing the operations for a current time step of the sequence of time steps. The operations may include reading contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN. The operations may further include selecting values for the parameters of the QNN based on the contents of the state buffer and preparing inputs of an optimization network based on the selected values of the parameters of the QNN. The operations may further include calculating outputs by applying the optimization network to the prepared inputs, updating values of the parameters of the QNN based on the calculated outputs, and passing the updated values of the input quantum state and parameters to the QNN to obtain a current value of a cost function of the QNN from the quantum computer. The set of operations may further include updating a state buffer based on a current value of the cost function and the updated values of the parameters, and training the QNN on the machine learning task by repeating execution of the operations using the updated values of the parameters of the QNN until the current value of the cost function of the QNN falls below a cost threshold.
[0005] The object and advantages of the embodiments will be realized and achieved at least by the elements, features, and combinations particularly pointed out in the claims.
[0006] Both the foregoing general description and the following detailed description are provided by way of example and explanation, and are not limitations of the invention as claimed. [Brief description of the drawings]
[0007] Exemplary embodiments will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:
[0008] [Figure 1] FIG. 1 depicts an example environment associated with training a quantum neural network using meta-optimization.
[0009] [Diagram 2] FIG. 1 is a block diagram illustrating an example system for training quantum neural networks using meta-optimization.
[0010] [Diagram 3] FIG. 1 illustrates a flowchart of an exemplary method for training a quantum neural network using meta-optimization.
[0011] [Figure 4] FIG. 1 illustrates an exemplary scenario for generating updated values of parameters of a quantum neural network and minimizing a cost function of the quantum neural network.
[0012] [Diagram 5] FIG. 1 illustrates an execution pipeline for training a quantum neural network using meta-optimization.
[0013] All figures are in accordance with at least one embodiment described in this disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Some embodiments described in this disclosure relate to methods and systems for training a quantum neural network using meta-optimization. Here, quantum devices (e.g., variational quantum circuits (VQCs) can be prepared on quantum hardware (e.g., a quantum computer) to implement a quantum neural network (QNN). To train the QNN, a set of optimized parameters for the VQC can be determined. This determination can be based on running a meta-optimization algorithm on classical hardware. The meta-optimization algorithm can train a meta-optimization network implemented on classical hardware to determine a set of optimized parameters for the VQC such that a meta-loss function associated with the meta-optimization network is minimized. The determined set of optimized parameters can be used to determine the output of the QNN such that a cost function associated with the QNN is minimized. The cost function can be determined on the quantum computer using the VQC implementing the QNN.
[0015] Quantum computing can enable the execution of machine learning tasks using QNNs. A QNN can be trained using a training dataset, which can be encoded in a quantum state and implemented using a parameterized quantum circuit on quantum hardware. A hybrid quantum-classical algorithm (e.g., a variational quantum algorithm (VQA)) can realize the optimization of a parameterized quantum circuit (e.g., a variational quantum circuit (VQC)) based on the determination of an optimal set of parameters of the VQC to perform the machine learning task. Traditionally, a parameterized quantum circuit can be optimized using a gradient-based algorithm (e.g., gradient descent) that can be executed on classical hardware. A gradient-based algorithm can include the calculation of a gradient with respect to a previously calculated cost function associated with the QNN on the quantum hardware. The gradient can then be provided to the classical hardware as an input to determine a set of optimized parameters. Based on the optimized set of parameters, the parameterized quantum circuit can generate an output such that the current cost function associated with the QNN is minimized. However, the calculation of the gradient may not be scalable and may be affected by sampling noise of the quantum hardware.
[0016] Furthermore, the computational cost of the optimization problem associated with determining the optimal set of parameters using a gradient-based algorithm can be measured by O(N), where N is the number of parameters of the VQC. Thus, optimizing a parameterized quantum circuit (i.e., VQC) based on a gradient-based algorithm can be challenging due to the scaling of computational costs. The quadratic computational costs can make optimizing a parameterized quantum circuit infeasible on classical hardware. Furthermore, in the current QNN training regime, the QNN can act as a black box that generates the cost function of the optimizer (which can be hosted on classical hardware and configured to determine the optimized parameter set for the QNN). Execution of larger scale complex machine learning tasks can be infeasible on current generation quantum hardware (e.g., Noisy Intermediate Scale Quantum (NISQ) devices) due to quantum hardware constraints such as the presence of gate noise, scaling limitations (e.g., hundreds of qubits), and the unavailability of reliable error detection and mitigation algorithms.
[0017] According to one or more embodiments of the present disclosure, the technical field of quantum machine learning can be improved by preparing a quantum circuit capable of functioning as a QNN and optimizing the QNN using a meta-optimization network based on a neural network. The present disclosure provides an electronic device including a method and a processor for training a QNN to perform a machine learning task. In operation, the electronic device can receive a dataset (e.g., a training dataset) associated with the machine learning task. The dataset can be encoded into an input quantum state to process the dataset using a quantum computer. The input quantum state can be prepared based on application of the encoding circuit on the received dataset. The electronic device can then prepare a variational quantum circuit (VQC) on the quantum computer to function as the QNN. The QNN can generate an output quantum state based on the VQC and a set of parameters associated with the input quantum state. The generated output quantum state can then be mapped to a classical output. The classical output and a set of labels corresponding to the received dataset can be used to determine a cost function value associated with the QNN. The QNN can be trained based on minimizing the cost function value. The cost function value can be minimized based on determining an optimized value of a set of parameters associated with the VQC.
[0018] After preparation of the VQC, the contents of the state buffer can be read. The state buffer can include previously determined values of the set of parameters associated with the VQC, previously determined cost function values associated with the QNN, and previous hidden states associated with the meta-optimization network. Based on the read contents, values of the parameters associated with the VQC can be selected to determine updated values of the parameters. The selected values can be used for preparation of inputs for the meta-optimization algorithm. The meta-optimization algorithm can be run on the meta-optimization network to calculate an output. The output can be calculated based on application of the meta-optimization network to the prepared inputs using an optimal set of meta-parameters. The optimal set of meta-parameters can be determined based on minimizing a meta-loss function of the meta-optimization network. Based on the output of the meta-optimization algorithm, an updated value of the set of parameters can be calculated. The updated value of the set of parameters can be used to obtain a current value of the cost function. The current value of the cost function can be less than the previously determined value of the cost function. The electronic device can further train the QNN based on iterative determination of the set of parameters and the cost function (determined using the quantum computer) until the current value of the cost function is minimized to a value less than a cost threshold. The smallest possible value of the cost function can be obtained if the determined values of the set of parameters are the optimized values of the set of parameters.
[0019] Embodiments of the present disclosure will now be described with reference to the accompanying drawings.
[0020] 1 is a diagram depicting an example environment associated with training a quantum neural network using meta-optimization, according to at least one embodiment described in this disclosure. Referring to FIG. 1, a computing environment 100 is shown. The computing environment 100 includes a system 102, a user device 104, and a display device 106. The system 102, the user device 104, and the display device 106 may be communicatively coupled to each other via a communication network 108. The system 102 may include a quantum computer 110 and an electronic device 112. As further shown, a quantum neural network (QNN) 114 may be implemented on the quantum computer 110, and an optimization network 116 may be implemented on the electronic device 112.
[0021] The system 102 may be part of an on-premise computing environment or a cloud computing environment. The system 102 may include suitable logic, circuitry, and interfaces that may be configured to perform operations associated with training the QNN 114 to perform a machine learning task. The QNN 114 may be trained using a hybrid quantum-classical algorithm that may enable optimization of the VQC functioning as the QNN 114 using an optimization network 116. The optimization of the VQC (i.e., the QNN 114) may correspond to determining a set of optimized parameter sets associated with the VQC based on optimal meta-parameters of the optimization network 116. The system 102 may be configured to determine the optimal meta-parameters by minimizing a meta-loss function associated with the optimization network 116 such that a cost function associated with the QNN 114 is minimized. The cost function may be minimized based on the determination of the set of optimized parameters associated with the VQC. More specifically, the cost function may be minimized based on the iterative execution of a set of operations corresponding to a series of time steps. At each time step, a set of operations may be executed to determine a set of parameters, and a cost function associated with the QNN 114 may be determined. At the end of a series of time steps (i.e., after a predefined number of iterations of execution of the set of operations), the system 102 can determine a set of optimized parameters that can correspond to a minimum of a cost function associated with the QNN 114.
[0022] The user device 104 may include suitable logic, circuitry, and interfaces that may be configured to render a user interface (UI) with options for configuring and submitting a dataset (i.e., input data points and labels corresponding to the input data points) that may be associated with training the QNN 114. The UI may further render cost function values associated with the QNN 114 and parameters of the QNN 114 that may be determined at each time step. The user device 104 may communicate with the system 102 via a network interface. Examples of user device 104 include, but are not limited to, a mobile device, a desktop computer, a laptop, a virtual machine, a computer workstation, or a server such as a cloud server.
[0023] The display device 106 may include appropriate logic, circuitry, and interfaces that may be configured to display inputs provided by the user device 104 and outputs generated by the system 102. In certain embodiments, the display device 106 may allow a user to provide user inputs via the display device 106. The display device 106 may be implemented by a number of known technologies, such as, but not limited to, liquid crystal display (LCD) displays, light emitting diode (LED) displays, plasma displays, or organic LED (OLED) display technologies, or other display devices. According to an embodiment, the display device 106 may refer to a display screen of a head mounted device (HMD), a smart glasses device, a see-through display, a projection-based display, an electrochromic display, or a transparent display.
[0024] The communication network 108 may include a communication medium through which the system 102, the user device 104, and the display device 106 can communicate with each other. The communication network 108 may be one of a wired connection or a wireless connection. Examples of the communication network 108 include, but are not limited to, the Internet, a cloud network, a cellular or wireless mobile network (such as Long-Term Evolution and 5G New Radio), a Wireless Fidelity (Wi-Fi) network, a personal area network (PAN), a local area network (LAN), or a metropolitan area network (MAN). Various devices in the computing environment 100 may be configured to connect to the communication network 108 according to various wired and wireless communication protocols. Examples of such wired and wireless communication protocols may include, but are not limited to, Transmission Control Protocol and Internet Protocol (TCP / IP), User Datagram Protocol (UDP), Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), ZigBee, EDGE, IEEE802.11, light fidelity (Li-Fi), 802.16, IEEE802.11s, IEEE802.11g, multi-hop communication, wireless access points (AP), device-to-device communication, cellular communication protocols, and Bluetooth (BT) communication protocols.
[0025] Quantum computer 110 may be a gate-based quantum computer that can be configured to receive an input and transform the input according to a unitary operation, which can be defined as a sequence of quantum logic gate operations and measurements. The operation can be represented by a VQC, which can be prepared on quantum computer 110 to function as QNN 114.
[0026] In one or more embodiments of the present disclosure, the quantum computer 110 may be implemented as a generalized quantum computing device that may be hosted on a cloud optimization system. The cloud optimization system may be implemented as one of a private cloud, a public cloud, or a hybrid cloud. In such an implementation, the generalized quantum computing device may use a dedicated optimization solving software application or simulation software at the application layer to receive a set of optimized parameters associated with the QNN 114 from the optimization network 116 and implement a hybrid quantum-classical algorithm to optimize the VQC (which functions as the QNN 114) based on the set of optimized parameters.
[0027] A general-purpose quantum computing device may be different from a digital bit-based computing device, such as a digital device based on transistor-based digital circuits. A general-purpose quantum computing device may include one or more quantum logic gates that use quantum bits (hereafter referred to as qubits) to perform calculations for different information processing applications. In general, a quantum bit can represent a "0", a "1", or a superposition of both "0" and "1". In most cases, a carefully controlled cryogenic environment may be required for a general-purpose quantum computing device to function properly. A general-purpose quantum computing device may use certain properties found in quantum mechanical systems, such as quantum fluctuations, quantum superposition of eigenstates, quantum tunneling, and quantum entanglement. These properties may help a generalized quantum computing device to perform calculations to solve certain mathematical problems to demonstrate quantum advantages. Typically, these problems may be difficult to compute with classical computing devices (e.g., classical computers using transistor-based circuits). Examples of general-purpose quantum computing devices include, but are not limited to, silicon-based nuclear spin quantum computers, trapped ion quantum computers, cavity quantum-electrodynamics (QED) computers, quantum computers based on nuclear spins, quantum computers based on electron spins in quantum dots, superconducting quantum computers using superconducting loops and Josephson junctions, and nuclear magnetic resonance quantum computers.
[0028] In some other embodiments, quantum computer 110 may be a special purpose quantum computer that is designed and hardware / software optimized to perform quantum machine learning tasks. Like general purpose quantum computing devices, special purpose quantum computers may use qubits and may require a carefully controlled cryogenic environment to function properly.
[0029] In some other embodiments, quantum computer 110 may be a digital quantum computing processor. More specifically, quantum computer 110 may be implemented as quantum simulation software executable on a digital computer with a semiconductor-based processor. The quantum simulation software may be designed to model the functionality of quantum computer 110 on digital circuits. The digital computer may operate at room temperature and not require a cryogenic environment to function.
[0030] In some other embodiments, quantum computer 110 may include a processor for executing software instructions, such as subroutines of a VQC functioning as QNN 114. Examples of processor implementations include, but are not limited to, a reduced instruction set computing (RISC) processor, an application specific integrated circuit (ASIC) processor, a complex instruction set computing (CISC) processor, a graphics processing unit (GPU), a coprocessor, and / or combinations thereof.
[0031] The electronic device 112 may include appropriate logic, circuitry, and interfaces that may be configured to execute program instructions associated with the optimization network 116. The electronic device 112 may be a classical computer (i.e., a transistor-based computer with semiconductor-based digital circuitry) that operates in tandem or in conjunction with the quantum computer 110 to train the QNN 114 to perform machine learning tasks.
[0032] The QNN 114 (i.e., VQC) can correspond to a computation routine (i.e., instruction set) that combines coherent quantum operations on quantum data, such as qubits, with real-time classical computation. The VQC can include an ordered set of quantum logic gates, measurements, and resets that can all be coordinated with real-time classical computation and can use data collected from the classical computation. According to one embodiment, the VQC can be a parameterized quantum circuit that includes a set of quantum logic gates for operators (e.g., phase and mixing operators) and a set of qubits (e.g., logical qubits representing physical qubits) on which the operators and quantum logic gates can be configured to operate. The quantum logic gates can include, for example, one or more Hadamard gates, Rx and Rz gates (i.e., Rotation Operators), and CNOT gates. The ansatz can vary depending on the dataset that can be used to train the QNN 114.
[0033] The optimization network 116 can be a software program, routine, or subroutine that, when executed by the electronic device 112, can calculate values of parameters of the VQC (functioning as the QNN 114) based on values of a cost function associated with the QNN 114. The optimization network 116 can be similar to an optimizer used in machine learning. The optimization network 116 can define a hypersurface (i.e., a cost landscape), and the task of the optimizer can be to navigate the landscape and find a global maximum (or minimum) on the hypersurface. Examples of optimization networks include, but are not limited to, a long short-term memory (LSTM) network, which is associated with meta-parameters and configured to maintain a hidden state of the LSTM network. Using an LSTM network as the optimization network 116 can enable optimization of the VQC in the quantum computer 110 without using gradient-based algorithms.
[0034] In operation, the system 102 may receive a dataset associated with a machine learning task. According to an embodiment, the received dataset may be used to train the QNN 114 to perform a machine learning task (such as classification, clustering, reinforcement machine learning, discriminative machine learning, etc.) and may include a set of data points and a set of labels corresponding to the set of data points. By way of example and not limitation, the set of data points may belong to an Iris dataset, a Gaussian 2D dataset, and a Spiral 2D dataset. The QNN 114 may need to be trained to predict the labels of each data point of the dataset and unknown data points of a new dataset different from the received dataset.
[0035] The system 102 may prepare an input quantum state based on a received data set. According to one embodiment, an encoding circuit may be applied to the received data set to prepare the input quantum state. The encoding circuit may encode each component of each data point of a set of data points (i.e., the received data set) into a quantum state. For example, if each data point includes "D" components (i.e., each data point is a "D" dimensional data vector), the encoding circuit may encode the corresponding data point into an input quantum state that includes "log(D)" qubits.
[0036] The system 102 may further prepare a VQC on the quantum computer 110, which may function as the QNN 114. The VQC may be a parameterized quantum circuit that functions as the QNN 114. The preparation of the VQC may be based on forming a configuration of a predetermined number of unitary gates. Thus, the VQC that functions as the QNN 114 may be expressed as a product of a predetermined number of parameterized unitary matrices. The unitary gates of the VQC may be parameterized using real-valued parameters (i.e., parameters of the QNN 114). The prepared VQC may function as a trained QNN (e.g., the QNN 114) and may be configured to perform a machine learning task based on determining optimal real values of the parameters and parameterizing the unitary gates with the determined optimal real values. The prepared VQC may generate a quantum output based on the optimal values of the parameters and the input quantum state. The quantum output may be scaled, and a cost function for the QNN 114 may be determined based on the set of labels and the scaled quantum output. If the cost function is minimized to a global minimum, the training of the QNN 114 may be determined to be complete.
[0037] The system 102 may perform an operation for a current time step in the series of time steps. According to an embodiment, the system 102 may minimize a meta loss function associated with the optimization network 116 such that the cost function is minimized over the series of time steps (e.g., a finite time window). The operation may be performed a predetermined number of times over the series of time steps and may include reading the contents of the state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN 114. The state buffer may be empty if the operation is performed for the first time. The state buffer may contain past information based on a determination that the state buffer contains past values of the parameters of the QNN 114, past values of the cost function of the QNN 114, and past values of the hidden state of the optimization network 116. The past value parameters, cost function, and hidden state of the QNN 114 may be determined at a time step (in the series of time steps) prior to the current time step. The state buffer may contain past information based on the inclusion of a difference in the cost function corresponding to a difference in values of the cost function determined at successive time steps prior to the current time step in the series of time steps.
[0038] The operations may further include selecting values for the parameters of the QNN 114 based on the contents. If the state buffer is empty, the selected values may include initial values for the parameters of the QNN 114 and initial values for the hidden states of the optimization network 116. Furthermore, the cost function difference may be selected to be "1". If the state buffer is not empty, the selected values may include values for the parameters of the QNN 114 determined at a time step prior to the current time step, a cost function difference value determined based on cost function values obtained at two consecutive time steps prior to the current time step, and a hidden state value of the optimization network 116 determined at a time step prior to the current time step. The selected values for the parameters may be values that result in a minimum value of the cost function of the QNN 114.
[0039] The operations may further include preparing an input to the optimization network 116 based on selected values of the parameters of the QNN 114. According to one embodiment, the input may be prepared based on a concatenation of the selected values of the parameters of the QNN 114 and the selected value of the cost function difference, a nonlinear function that may normalize the concatenation, and a parameter that may control the strength of the normalization applied by the nonlinear function. The nonlinear function may be applied to the concatenation to generate a normalized output (i.e., a normalized concatenation). A ratio of the result of the normalized output to the parameter may then be determined for preparation of the input. The prepared input may be provided to the optimization network 116 to determine updated parameters of the QNN 114. The input provided to the optimization network 116 may further include selected values of hidden states of the optimization network 116 (e.g., hidden states of an LSTM network).
[0040] The operations may further include calculating an output by applying the optimization network 116 to the prepared input. The output may further be calculated based on selected values of hidden states of the optimization network 116. The operations may further include updating values of parameters of the QNN 114 based on the calculated output. According to an embodiment, the values of the parameters of the QNN 114 may be updated based on values of the parameters of the QNN 114 that may be determined in a previous time step of the series of time steps, the hyper-parameters, and results that may be obtained based on application of a nonlinear activation function to the calculated output. The system 102 may further control the strength of the update (of the values of the parameters of the QNN 114) based on the hyper-parameters. The optimization network 116 may further generate updated values of hidden states of the optimization network 116.
[0041] The operations may further include passing the input quantum state and the updated values of the parameters to the QNN 114 to obtain from the quantum computer 110 a current value of the cost function of the QNN 114. The VQC unitary gate (acting as the QNN 114) may be parameterized using the updated values of the parameters of the QNN 114. The QNN 114 may generate a quantum output based on the updated values of the parameters and application of the QNN 114 to the input quantum state. The system 102 may scale the generated quantum output and determine a current value of the cost function based on the set of labels and the scaled quantum output.
[0042] The system 102 may update the state buffer based on the current value of the cost function and the updated value of the parameter. The updating may correspond to including the current value of the cost function and the updated value of the parameter in the state buffer. The state buffer may be further updated based on the updated value of the hidden state of the optimization network 116 and a cost function difference corresponding to the difference between the value of the cost function determined at the current time step and the value of the cost function determined at a previous time step in the series of time steps. Thus, the updating may further correspond to including the updated value of the hidden state and the cost function difference in the state buffer.
[0043] The system 102 may train the QNN 114 for the machine learning task by repeatedly executing the operations using updated values until the current value of the cost function of the QNN 114 is below the cost threshold. If the cost function is minimized after repeatedly executing the operations over a series of time steps, the current value of the cost function of the QNN 114 may be below the cost threshold. The minimization may be such that the current value of the cost function is below a set global minimum. At this stage, the training phase of the QNN 114 may be identified as having completed.
[0044] Modifications, additions, or omissions may be made to Figure 1 without departing from the scope of this disclosure. For example, network environment 100 may include more or fewer elements than shown and described in this disclosure.
[0045] FIG. 2 is a block diagram illustrating an example system for training a quantum neural network using meta-optimization, according to at least one embodiment described in this disclosure. FIG. 2 is described in conjunction with the elements of FIG. 1. Referring to FIG. 2, a block diagram 200 of a system 102 is shown. The system 102 may include a quantum computer 110 and an electronic device 112. As shown, for example, the quantum computer 110 may be a gate-based quantum computer including a QNN 114 (i.e., a VQC), a quantum compiler 202a, and a quantum processor 202b. Similarly, the electronic device 112 may be a transistor-based computer (i.e., a classical computer) including a processor 204a, a memory 204b, a persistent data storage device 204c, and an optimization network 116. In certain embodiments, the optimization network 116 may be stored in the memory 204b. The quantum processor 202b and the processor 204a may be referred to as one or more processors of the system 102.
[0046] Typically, a compiler is a computer program configured to translate computer code between two languages, a source language and a target language. Because quantum algorithms require error-free quantum bits and logic gates, the quantum compiler 202a may be configured to translate quantum gate operations used in quantum to machine-level operations to reduce quantum information loss due to decoherence. A compiler for a gate-based quantum computer may perform quantum gate synthesis at both the physical layer and the logical layer. The quantum compiler 202a may operate on a set of instructions (e.g., QNN 114 or VQC) to ensure that such instructions are executable on the quantum computer 110. Such instructions may utilize a quantum instruction set to convert high-level algorithms into physical instructions executable on the quantum processor 202b.
[0047] Quantum processor 202b (also referred to as quantum processing unit (QPU)) may represent a physical device (e.g., a chip) that may include a set of interconnected quantum bits. Quantum processor 202b may typically include a housing environment (e.g., a cooling mechanism to achieve cryogenic temperatures), a control system for quantum processor 202b, etc.
[0048] Although not shown, the quantum computer 110 may have a layered architecture including layers such as a physical layer, a virtual layer, an error correction layer, a logical layer, and an application layer. The physical layer may include hardware including, but not limited to, physical qubits and control operations. The virtual layer may incorporate error cancellation and may serve to collect and shape the quantum dynamics of the qubits into virtual qubits and quantum gates. The error correction layer may incorporate quantum error correction logic for fault-tolerant quantum computing. The logical layer may support universal quantum computing by functioning as a hardware-independent layer. The application layer may be a hardware-independent layer that relies on logical qubits. The application layer may receive quantum algorithms as a sequence of high-level operations including the QNN 114.
[0049] The processor 204a may include suitable logic, circuitry, and / or interfaces that may be configured to execute program instructions associated with different operations performed by the system 102. The processor 204a may include any suitable special purpose or general purpose computer, computing entity, or processing device including various computer hardware or software modules, and may be configured to execute instructions stored on any applicable computer readable storage medium. For example, the processor 204a may include a microprocessor, a microcontroller, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or any other digital or analog circuitry configured to interpret and / or execute program instructions and / or process data. Although shown as a single processor in FIG. 2, the processor 204a may include any number of processors that are individually or collectively configured to execute or direct the execution of any number of operations of the system 102 as described in this disclosure.
[0050] In some embodiments, the processor 204a may be configured to interpret and / or execute program instructions and / or process data stored in the memory 204b and / or the persistent data storage 204c. In some embodiments, the processor 204a may fetch program instructions from the persistent data storage 204c and load the program instructions into the memory 204b. After the program instructions are loaded into the memory 204b, the processor 204a may execute the program instructions. Some examples of the processor 204a may be a GPU, a CPU, a RISC processor, an ASIC processor, a CISC processor, a co-processor, and / or a combination thereof.
[0051] The memory 204b may include suitable logic, circuitry, and / or interfaces that may be configured to store program instructions executable by the processor 204a. In certain embodiments, the memory 204b may be configured to store a dataset associated with a machine learning task, parameters associated with the QNN 114 (i.e., VQC), and values of a cost function associated with the QNN 114 (i.e., VQC). The memory 204b may include a computer-readable storage medium that carries or has stored computer-executable instructions or data structures. Such computer-readable storage media may include any commercially available medium that can be accessed by a general-purpose or special-purpose computer, such as the processor 204a.
[0052] By way of example, and not limitation, such computer-readable storage media may include tangible or non-transitory computer-readable media including random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), compact disk read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory devices (e.g., solid-state memory devices), or any other storage medium that can be used to carry or store specific program code in the form of computer-executable instructions or data structures and that can be accessed by a general-purpose or special-purpose computer. Combinations of the above may also be included within the scope of computer-readable storage media. Computer-executable instructions may include, for example, instructions and data configured to cause the processor 204a to perform a particular operation or group of operations associated with the system 102.
[0053] The permanent data storage 204c may include appropriate logic, circuitry, and / or interfaces that may be configured to store program instructions executable by the processor 204a, an operating system, and / or application-specific information such as logs and application-specific databases. The permanent data storage 204c may be configured to store information such as a set of equations related to the optimization of parameters of the QNN 114 (i.e., VQC) and meta-parameters related to the optimization network 116. The permanent data storage 204c may include computer-readable storage media that carry or have stored computer-executable instructions or data structures. Such computer-readable storage media may include any commercially available media that can be accessed by a general-purpose or special-purpose computer, such as the processor 204a.
[0054] By way of example, and not limitation, such computer-readable storage media may include tangible or non-transitory computer-readable storage media including Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices (e.g., Hard-Disk Drives (HDD)), flash memory devices (e.g., Solid State Drives (SDD), Secure Digital (SD) cards, other solid-state memory devices), or any other storage medium that may be used to carry or store specific program code in the form of computer-executable instructions or data structures and that can be accessed by a general-purpose or special-purpose computer. Combinations of the above may also be included within the scope of computer-readable storage media. Computer-executable instructions may include, for example, instructions and data configured to cause the processor 204a to perform a particular operation or group of operations associated with the system 102.
[0055] Modifications, additions, or omissions may be made to system 102 without departing from the scope of the disclosure. For example, in some embodiments system 102 may include any number of other components that may not be illustrated or described.
[0056] FIG. 3 illustrates a flowchart of an example method for training a quantum neural network using meta-optimization, in accordance with at least one embodiment described herein. FIG. 3A is described in conjunction with elements of FIG. 1 and FIG. 2. Referring to FIG. 3, a flowchart 300 is shown. The method illustrated in the flowchart 300 may begin at 302 and may be performed by any suitable system, apparatus, or device, such as the example system 102 of FIG. 1 or the processor 204a of FIG. 2. Although illustrated by separate blocks, steps and operations associated with one or more of the blocks of the flowchart 300 may be divided into additional blocks, combined into fewer blocks, or eliminated, depending on the implementation.
[0057] At 302, a dataset associated with a machine learning task may be received. In one embodiment, the processor 204a may be configured to receive a dataset associated with a machine learning task. The dataset may be a training dataset (such as an iris dataset, a Gaussian 2D dataset, a spiral 2D dataset, etc.) that can be used to train a QNN (e.g., QNN 114) to perform a machine learning task (such as classification, clustering, reinforcement machine learning, discriminative machine learning, etc.). For example, a dataset "D" may include "m" samples and may be represented as follows:
number
[0058] At 304, an input quantum state may be prepared based on the received data set. In one embodiment, the processor 204 may be configured to prepare the input quantum state based on the received data set. The preparation may be based on application of an encoding circuit to the received data set. The application may enable processing of the received data set by the quantum computer 110. The prepared input state may be:
number
number
[0059] At 306, a VQC may be prepared on the quantum computer 110 to function as the QNN 114. In one embodiment, the processor 204a may be configured to prepare a VQC on the quantum computer 110 to function as the QNN 114. The preparation of the VQC may be based on forming a configuration of unitary gates. The VQC may be a product of "n" parameterized unitary matrices. Each unitary matrix may represent a unitary gate, and the product may represent a configuration of unitary gates. The parameterized unitary matrix may be expressed as:
number
number
number
number
number
number
[0060] According to one embodiment, the processor 204a initializes the parameters of the QNN 114 to “θ t " and based on the input quantum state and the initialized parameters, the following can be determined:
number
number
number
[0061] The cost function of the QNN 114 may be updated (i.e., minimized from an initial cost function value) by updating the parameters of the QNN 114. The processor 204a may obtain a minimum value of the cost function based on the optimized values of the parameters. The cost function of the QNN 114 may be obtained at any time step based on the following equation (1):
number
[0062] In step 308, an operation can be performed for a current time step in the sequence of time steps. In one embodiment, the processor 204a can be configured to perform an operation for a current time step in the sequence of time steps. The operation can be performed at each time step in the sequence to update parameters of the QNN 114 (using the optimization network 116) and to minimize a cost function of the QNN 114 (using equation (1)).
[0063] In step 308A, the contents of the state buffer may be read. In one embodiment, the processor 204a may be configured to read the contents of the state buffer to determine whether the state buffer is empty or includes past information regarding the parameters of the QNN 114. The processor 204a may instantiate the state buffer based on the initialization of the parameters of the QNN 114. The state buffer may be a two-sided queue that may be empty when the parameters of the QNN 114 are initialized with initial values, i.e., when the current time step is the first time step of the series of time steps. The state buffer may include past information regarding the parameters of the QNN 114, which may be based on the execution of operations in a time step preceding the current time step. The past information included in the state buffer may correspond to one or more past values of the parameters of the QNN 114, which may be determined in one or more time steps of the series of time steps preceding the current time step. The past information may further correspond to past values of the hidden states of the optimization network 116, which may be determined in one or more time steps preceding the current time step. The state buffer may further include one or more past values of the cost function, which may be determined at one or more time steps in the series of time steps preceding the current time step. The state buffer may further include cost function difference values relating to past cost function values, which may be determined at two consecutive time steps in the series of time steps preceding the current time step.
[0064] At 308B, a value for the parameter of the QNN 114 may be selected based on the retrieved contents. In one embodiment, the processor 204a may be configured to select a value for the parameter of the QNN 114. An initial value used to initialize the parameter of the QNN 114 may be selected as the value of the parameter based on a determination that the state buffer is empty. On the other hand, if it is determined that the state buffer contains past information for the parameter of the QNN 114, the selection of the value for the parameter of the QNN 114 may be performed by sampling past values of the parameter of the QNN 114 contained in the state buffer. The sampling may be performed using a sampling function that returns past values of the parameter determined in a time step prior to the current time step. The past value of the parameter returned by the sampling function may be selected as the value of the parameter. The returned past value may be a value of the parameter for which a corresponding past value of a cost function of the QNN 114 may be the lowest. The corresponding past value of the cost function may be the lowest among past values of the cost function that may be determined in other preceding time steps.
[0065] The sampling function may further return past values of the hidden states of the optimization network 116, which may be determined at a time step preceding the current time step, and a cost function difference, which may be determined based on past cost function values obtained at two consecutive time steps preceding the current time step. The past values of the hidden states and the cost function difference may be returned based on a determination that the state buffer contains past information.
[0066] In step 308C, an input for the optimization network 116 may be prepared. In one embodiment, the processor 204a may be configured to prepare the input for the optimization network 116 based on selected values of the parameters of the QNN 114. The input for the optimization network 116 may further be prepared based on a cost function difference that may be returned by a sampling function. The cost function difference may be initialized to "1" if the state buffer is empty or if the current time step is the first time step in the sequence of time steps. If the state buffer contains past information, the processor 204a may retrieve past values of the cost function obtained at two consecutive time steps immediately preceding the current time step in the sequence of time steps. Then, a difference between the past values of the cost function may be calculated. The calculated difference may correspond to the cost function difference returned by the sampling function.
[0067] The processor 204a may further construct an input vector by concatenating the calculated differences between past values of the cost function and the selected values of the parameters of the QNN 114. An input of the optimization network 116 may be prepared based on the application of exponential scaling to the input vector and a normalization factor. The application of exponential scaling may result in the generation of a normalized vector. The exponential scaling may normalize the input vector such that each component of the input vector is in the range of [0, 1]. The normalization factor may control the strength of normalization achieved by the exponential scaling. For example, the normalization factor may be 50. The prepared input to the optimization network 116 may be the ratio of the normalized vector to the normalization factor.
[0068] According to one embodiment, the optimization network 116 may be a Long-Short Term Memory (LSTM) network. The LSTM network may be associated with meta-parameters and configured to maintain a hidden state of the LSTM network. The input to the optimization network 116 may further include a hidden state of the LSTM network. The hidden state of the LSTM network may correspond to an initialization value of the hidden state of the optimization network 116 when the state buffer is empty or when the current time step is the first time step in the sequence of time steps. On the other hand, the hidden state of the LSTM network may correspond to a past value of the hidden state of the optimization network 116. The sampling function may return a past value of the hidden state of the optimization network 116 based on a determination that the state buffer contains past information.
[0069] At 308D, an output of the optimization network 116 may be calculated. In one embodiment, the processor 204a may be configured to calculate the output of the optimization network 116 based on application of the optimization network 116 to the prepared input. The output may be further calculated based on a hidden state of the LSTM network. The calculated output may be used to determine updated parameters of the QNN 114 at the current time step. The optimization network 116 or the LSTM network may further calculate a current value of a hidden state of the LSTM network (i.e., the optimization network 116).
[0070] At 308E, values of the parameters of the QNN 114 may be updated. In one embodiment, the processor 204a may be configured to update values of the parameters of the QNN 114 based on the calculated output. An initial value of the parameter may be updated if the current time step is the first time step. Otherwise, a past value of the parameter (determined at a time step prior to the current time step) may be updated.
[0071] To update the initial or past values of the parameters of the QNN 114, the calculated outputs of the optimization network 116 may be transformed by applying a nonlinear activation function to the calculated outputs. For example, the nonlinear activation may be a hyperbolic tangent function ("tanh()"). The processor 204a may then multiply the transformed outputs by a value of a learning rate parameter to generate an update value for the current time step. The learning rate parameter may control the strength of the update of the parameters of the QNN 114. The processor 204a may further add the generated update value to a selected value of the parameters of the QNN 114 at the current time step (i.e., the initial value of the parameters or a past value of the parameters determined at a time step prior to the current time step) to determine an updated value of the parameters of the QNN 114. By way of example and not limitation, the values of the parameters of the QNN 114 may be updated based on Equation (2) given as follows:
number
[0072] At 308F, the input quantum state and the updated values of the parameters of the QNN 114 may be passed to the QNN 114 to obtain a current value of the cost function of the QNN 114. In one embodiment, the processor 204a may be configured to pass the input quantum state and the updated values of the parameters to the QNN 114 to obtain a current value of the cost function of the QNN 114 from the quantum computer 110. Specifically, the processor 204a may calculate the following based on the input quantum state and the updated values of the parameters of the QNN 114:
number
number
[0073] In step 310, the state buffer may be updated. In one embodiment, the processor 204a may be configured to update the state buffer based on the current value of the cost function and the updated values of the parameters. To update the state buffer, the processor 204a updates the current value of the cost function for the current time step, “C(θ t+1 )” is the past value (or initialized value) of the cost function for the time step preceding the current time step in the sequence of time steps (e.g., C(θ t )) of the cost function. The past values of the cost function may reside in the memory 204b of the electronic device 112. The processor 204a may retrieve the past values (or initialized values) of the cost function from the memory 204b for comparison. The state buffer may store the current value of the cost function and updated values of the parameters (θ t+1 ) can be updated to include the current value of the cost function C(θ t+1 ) is the past value (or initialized value) of the cost function (C(θ t If it is determined that the cost function is smaller than the current value C(θ), then the current value of the cost function and the updated values of the parameters may be included in a state buffer. Additionally, the state buffer may be updated at the current time step (or each time step in a series of time steps) to include the current values of the hidden states of the optimization network 116 and the cost function difference values. The cost function difference values may be updated at the current value of the cost function C(θ t+1 ) and the past value (or initialization value) of the cost function (C(θ t )) can be accommodated.
[0074] At 312, the QNN 114 may be trained for the machine learning task. In one embodiment, the processor 204 may be configured to train the QNN 114 for the machine learning task by repeating the execution of the operations (i.e., 308A-308F) using updated values of the parameters of the QNN 114 until it is determined that the current value of the cost function is less than the cost threshold (or a global minimum). The training of the QNN 114 may continue for a period of time "T". Thus, the period of time "T" may elapse during the execution of the operations for a series of time steps. Based on the execution of the operations at each time step, the parameters of the QNN 114 may be updated to minimize the value of the cost function of the QNN 114. By repeating the operations over the period of time, the cost function may be minimized such that the current value of the cost function is less than the cost threshold. The QNN 114 may be considered to be trained (or the VQC parameters optimized) to perform the machine learning task if the value of the cost function (after a particular time step) is less than the cost threshold.
[0075] Flowchart 300 has been illustrated as individual operations, such as 302, 304, 306, 308, 308A, 308B, 308C, 308D, 308E, 308F, 310, and 312. However, in particular embodiments, such individual operations may be further divided into additional operations, combined into fewer operations, or eliminated, depending on the implementation, without departing from the essence of the disclosed embodiments.
[0076] FIG. 4 illustrates an example scenario for generating updated values of parameters of a quantum neural network and minimizing a cost function of the quantum neural network, according to at least one embodiment described in this disclosure. FIG. 4 is described in conjunction with elements of FIG. 1, FIG. 2, and FIG. 3. With reference to FIG. 4, an example scenario 400 is illustrated. In the example scenario 400, a block diagram 402 of a meta-learning approach for training a QNN 114 and an LSTM network 404 is illustrated. The LSTM network 404 may be an example implementation of the optimization network 116 of FIG. 1. The diagram 402 may include a quantum processing unit (QPU) 406, which may be an example implementation of the quantum processor 202b of FIG. 2. In operation, the QPU 406 may execute the VQC (i.e., the QNN 114). This may be a parameterized quantum circuit that may include a set of quantum gates in a particular arrangement. The set of quantum gates may represent a set of operations that may be performed on a set of qubits of a quantum computer (such as the quantum computer 110).
[0077] Further shown in diagram 402 are a first gate 408, a second gate 410, a third gate 412, and a fourth gate 414, each of which is shown with a different symbol in Figure 4 to indicate a different operation. The first gate 408 represents a delta calculation operation, the second gate 410 represents a concatenation operation, the third gate 412 is an update gate which represents an operation to update the values of the parameters of the QNN 114, and the fourth gate 414 is a conditional true gate which represents an operation to compare the current value of the cost function to a past value of the cost function.
[0078] Further shown is a state buffer 416 that includes past information regarding the parameters of the QNN, past values of the cost function, past values of the hidden state of the LSTM network 404, and a cost function difference value. The cost function difference value may be calculated based on the difference between a current value of the cost function obtained for the current time step and a past value of the cost function obtained for a time step prior to the current time step. The state buffer 416 may be updated if it is determined that the current value of the cost function is less than the past value of the cost function. On the other hand, the state buffer 416 should not be updated if it is determined that the current value of the cost function is greater than the past value of the cost function. This is because the parameters of the QNN 114 (which may be determined based on the output of the LSTM network 404) may not be optimal if the current value of the cost function is greater than the past value of the cost function. Thus, the parameters of the QNN 114 may not be included in the state buffer 416.
[0079] According to one embodiment, at time step "t" (i.e., the current time step), the processor 204a may be configured to initialize parameters of the QNN 114 using initial values. The QNN 114 may include a set of parameters that may be initialized using a set of initial values. The set of parameters may be expressed as follows:
number
number
[0080] The input to the LSTM network 404 is t-1 , ΔC(θ), and a normalization factor. t-1 and ΔC(θ). The application of the LSTM network 404 to the prepared input and the hidden state of the LSTM network 404 (i.e., h t-1) and an initial value of Ω. Further, based on such application, updated values of the hidden states may be generated. The output is Ω t u and the updated value of the hidden state is h t The set of parameters may then be expressed as θ t-1 , Ω t u , σ, and α. The updated values of the set of parameters at time step "t" can be expressed using the following equation:
number
[0081] The updated values of the set of parameters (i.e., θ t ) and the input quantum state (prepared based on the set of data points) may be passed as input to the QNN 114 (i.e., the QPU 406). Based on such input, a current value of the cost function may be obtained. The current value of the cost function is C(θ t ), and the first gate 408 is used to calculate C(θ t-1 ) may then be compared using a fourth gate 414 to C(θ t ) is C(θ t-1 ) is determined. t ) is C(θ t-1 ), update the state buffer 416. This update is t ), h t , θ t , and ΔC(θ) (i.e., C(θ t ) is C(θ t-1 θ) in the state buffer 416. t The parameters of QNN114 are (θ t-1 From θ t The update to the cost function (C(θ t-1 ) to C(θ t ) to minimize θ t The parameters of θ t-1It is optimal compared with the parameters of
[0082] According to an embodiment, at time step “t+1”, C(θ t ) is the past value of the cost function, and θ t represents the past value of the parameter set (or the past information of the parameter set of the QNN 114), and h t are the past values of the hidden state of the LSTM network 404. The QPU 406 reads the contents of the state buffer 416 and extracts θ t and ΔC(θ). Then, θ t , ΔC(θ) (i.e., C(θ t ) and C(θ t-1 Based on the comparison result of h ) and the normalization factor, the input of the LSTM network 404 can be prepared. t ) and past values of Ω. Further, based on such application, updated values of the hidden states may be generated. The output is Ω t+1 u and the updated value of the hidden state is h t+1 The set of parameters may then be expressed as θ t , Ω t+1 u , σ, and α. The updated values of the set of parameters at time step “t+1” can be expressed as:
number
[0083] It should be noted that scenario 400 in FIG. 4 is for illustrative purposes and should not be construed as limiting the scope of the disclosure.
[0084] FIG. 5 illustrates an execution pipeline for training a quantum neural network using meta-optimization, according to at least one embodiment described in this disclosure. FIG. 5 is described in conjunction with elements of FIG. 1, FIG. 2, FIG. 3, and FIG. 4. With reference to FIG. 5, an execution pipeline 500 is shown. The exemplary execution pipeline 500 may include a set of operations (e.g., operations 502-518) that may be performed by one or more components of FIG. 1, such as the system 102. The set of operations may be performed by the processor 204a of the system 102.
[0085] At 502, parameters of a QNN (e.g., QNN 114) may be initialized. In at least one embodiment, the processor 204a may be configured to initialize the parameters of the QNN 114. The QNN 114 may be implemented by a VQC. The VQC may be a parameterized quantum circuit including a predetermined number of unitary gates. The VQC may be expressed as a product of a predetermined number of parameterized unitary matrices corresponding to the predetermined number of unitary gates. Each parameterized unitary matrix may be a function of the parameters of the QNN 114. Thus, the VQC (i.e., QNN 114) may be parameterized based on the parameters of the QNN 114. The QNN 114 may be trained to perform a machine learning task based on optimizing the parameters of the QNN 114. For parameter optimization, the processor 204a may initialize the parameters of the QNN 114 at a first time step of a series of time steps and use the optimization network 116 to update the values of the parameters based on the past values of the parameters in subsequent time steps. Based on the initialization of the parameters, the efficiency of training of the QNN 114 can be improved and the delay associated with training the QNN 114 can be reduced. Furthermore, the minimum value of the cost function that can be achieved based on the optimization of the parameters can depend on the initialization of the parameters of the QNN 114.
[0086] At 504, meta-parameters and hidden states of the optimization network 116 may be initialized. In at least one embodiment, the processor 204a may be configured to initialize the meta-parameters of the optimization network 116 and the hidden states of the optimization network 116. The meta-parameters may be initialized with meta-parameter values prior to execution of the operations (i.e., 308A-308F). The optimization network 116 may be an LSTM network that may be associated with meta-parameters (i.e., meta-parameters of the optimization network 116) and may be configured to maintain hidden states of the LSTM network (i.e., hidden states of the optimization network 116). The meta-parameters may be initialized using initial values, and the hidden states may be initialized using a normal distribution. Such initialization may enable the LSTM network and hidden states to be trainable such that a meta-loss function of the LSTM network converges to an efficient minimum.
[0087] The LSTM network can calculate outputs indicative of updated parameters of the QNN 114 based on the input meta-features and adjustments of the meta-parameters of the LSTM network from the initial values. At a first time step in the series of time steps, the input meta-features can be initial values of the parameters of the QNN 114 and an initial cost function difference value (i.e., "1"). At subsequent time steps, the input meta-features can be determined based on past values of the parameters of the QNN 114 and cost function difference values associated with past values of the cost function of the QNN 114. The meta-parameters of the LSTM network can be adjusted (from the initial values) during training of the LSTM network. The processor 204a can train the LSTM network based on the meta-loss function during the series of time steps. For a training dataset (e.g., a dataset associated with a machine learning task (see 302)) and a prepared VQC that serves as the QNN 114, the meta-loss function can be minimized to generate a trained LSTM network during the series of time steps. Minimizing the meta-loss function can enable determination of optimal meta-parameters. Based on the optimal meta-parameters, the parameters of the QNN 114 can be updated (i.e., the QNN 114 is trained to perform a machine learning task) such that the cost function of the QNN 114 is minimized. Thus, the LSTM network can output parameters for the parameterization of the VQC (which functions as the QNN 114).
[0088] At 506, a state buffer may be instantiated. In at least one embodiment, the processor 204a may be configured to instantiate the state buffer based on an initialization of parameters of the QNN 114. When the parameters of the QNN 114 are initialized with initial values, the state buffer may be empty. At each time step, the state buffer may be updated based on the determination of updated values of the parameters of the QNN 114 and the values of the cost function of the QNN 114 determined for the corresponding time step. The update may correspond to including the updated values of the parameters and the value of the cost function. Thus, over the course of a time step in the series of time steps, the state buffer may be updated to include past information corresponding to past values of the parameters of the QNN 114 and past values of the cost function. Over the course of time steps, the state buffer may be further updated to include past values of the hidden state of the LSTM network and cost function difference values associated with past values of the cost function obtained in two consecutive time steps prior to the current time step.
[0089] At 508, it may be determined whether execution of the operations (i.e., 308A-308F) for the series of time steps is complete. In at least one embodiment, the processor 204a may be configured to determine whether execution of the operations is complete.
[0090] At 510, a meta loss function may be evaluated. In at least one embodiment, the processor 204a may be configured to evaluate the meta loss function based on a determination that the execution of the operations (i.e., 308A-308F) for the series of time steps is completed. The meta loss function may be evaluated for the optimization network 116 (i.e., the LSTM network) after the series of time steps is completed (i.e., after the execution of operations 308A-308F for each time step in the series of time steps) based on a value of the cost function obtained for each time step in the series of time steps. The meta loss function may be further evaluated based on a weight value associated with each value of the cost function obtained at each time step. By way of example and not limitation, the meta loss function may be evaluated using equation (4) given as follows:
number
number
[0091] The sequence of time steps may include "T" time steps. The processor 204a may update the meta parameter value based on the evaluation value of the meta loss function. The meta parameter value may be updated if the evaluation value of the meta loss function is not minimized to the expected value. Based on the updated meta parameter value, the operations (i.e., 308A-308F) may be performed again for the sequence of time steps. Meanwhile, the training phase of the QNN 114 may be determined to be complete if the evaluation value of the meta loss function is minimized to the expected value.
[0092] At 512, an operation (i.e., 308A-308F) may be performed for a current time step in the series of time steps. In at least one embodiment, the processor 204 may be configured to perform the operation (i.e., 308A-308F) for the current time step. The execution may be based on a determination that execution of the operation (i.e., 308A-308F) for the series of time steps is not complete.
[0093] At 514, it may be determined whether the current value of the cost function is less than a past value of the cost function. In at least one embodiment, the processor 204 may be configured to determine whether a current value of the cost function obtained based on the execution of the operations (i.e., 308A-308F) for the current time step is less than a past value of the cost function obtained at a time step preceding the current time step in the series of time steps. The processor 204a may determine (508) whether the execution of the operations (i.e., 308A-308F) for the series of time steps is completed if the current value of the cost function is greater than the past value of the cost function.
[0094] In step 516, the state buffer may be updated. In at least one embodiment, the processor 204 may be configured to update the state buffer based on a determination that the current value of the cost function is less than the past value of the cost function. The updating may correspond to including the current value of the cost function as a past value of the cost function in the state buffer. The updating may further correspond to including a current value of the hidden state of the LSTM network and an updated value of the parameter of the QNN 114 in the state buffer. The updated value of the parameter may be determined based on the execution of operation 308E for the current time step and stored as past information regarding the parameter of the QNN 114.
[0095] Based on the updates to the state buffer, input metafeatures to be provided to the LSTM network may be determined. The input metafeatures may be determined if the current time step is not the last time step in the series of time steps. The determined input metafeatures may be used to prepare inputs to the LSTM network for a time step following the current time step (i.e., performing operation 308C).
[0096] At 518, the QNN 114 may be trained. In at least one embodiment, the processor 204 may be configured to train the QNN 114 based on updates to the state buffer. The training of the QNN 114 may be based on a current value of the cost function, past values of the cost function obtained at a time step prior to the current time step, and past values of the parameters stored in the state buffer. If the current time step is the last time step in the series of time steps, a meta loss function may be evaluated (510). The processor 204a may determine whether the current time step is the last time step based on determining whether execution of the operations (i.e., 308A-308F) for the series of time steps is completed (508).
[0097] Various embodiments of the present disclosure may provide one or more non-transitory computer-readable storage media configured to store instructions that, in response to being executed, cause an electronic device (such as electronic device 112) to perform a set of operations. The set of operations may include receiving a dataset associated with a machine learning task. The set of operations may further include preparing an input quantum state based on the received dataset. The set of operations may further include preparing a VQC on a quantum computer (e.g., quantum computer 110) to function as a QNN (such as QNN 114). The set of operations may further include performing an operation for a current time step in the set of time steps. The operations may include reading the contents of the state buffer to determine whether the state buffer is empty or contains past information about the parameters of the QNN 114, selecting values for the parameters of the QNN 114 based on the contents, preparing inputs for an optimization network (such as optimization network 116) based on the selected values of the parameters of the QNN 114, computing outputs by applying the optimization network 116 to the inputs, updating values of the parameters of the QNN 114 based on the outputs, and passing the updated values of the input quantum state and parameters to the QNN 114 to obtain a current value of a cost function of the QNN 114 from the quantum computer 110. The set of operations may further include updating the state buffer based on the current value of the cost function and the updated values of the parameters. The set of operations may further include training the QNN 114 for the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold.
[0098] As used in this disclosure, the term "module" or "component" may refer to a specific hardware implementation configured to perform the operations of the module or component, and / or a software object or software routine that may be stored and / or executed by general-purpose hardware (e.g., computer-readable medium, processing unit, etc.) of a computing system. In some embodiments, different components, modules, engines, and services than those described in this disclosure may be implemented as objects or processes (e.g., separate threads) executing on a computing system. Although some of the systems and methods described in this disclosure have been generally described as being implemented in software (stored on and / or executed by general-purpose hardware), dedicated hardware implementations or combinations of software and dedicated hardware implementations are also possible and contemplated. In this description, a "computing entity" may be any computing system described above in this disclosure, or any module or combination of modules executing on a computing system.
[0099] Terms used in this disclosure, and particularly in the appended claims (e.g., the body of the appended claims), are generally intended as "broad" terms (e.g., the term "including" should be interpreted as "including, but not limited to," the term "having" should be interpreted as "having, but not limited to," etc.).
[0100] Moreover, where the recitation of a particular number of introduced claims is intended, such intent is expressly set forth in the claim, and in the absence of such recitation, no such intent exists. For example, as an aid to understanding, the following appended claims may include the use of the introductory phrases "at least one" and "one or more" to introduce the recitation of claims. However, the use of such phrases should not be construed to mean that the introduction of a claim recitation by the indefinite article "a" or "an" limits any particular claim that includes such an introduced recitation of claims to an embodiment that includes only one such recitation, even when the same claim includes the introductory phrase "one or more" or "at least one" and the indefinite article "a" or "an" (e.g., which should be interpreted to mean "a" and / or "an at least one" or "one or more"). In other words, the same applies to the use of definite articles used to introduce a recitation of claims.
[0101] Moreover, where the recitation of a particular number of incorporated claims is explicitly recited, one of ordinary skill in the art will understand that such recitation should be interpreted to mean at least the number recited (e.g., a recitation of "two enumerations" without other qualification means at least two enumerations, or an enumeration of two or more). Furthermore, in instances where a recitation similar to "at least one of A, B, and C, etc." or "one or more of A, B, and C, etc." is used, such configurations are typically intended to include A alone, B alone, C alone, A and B together, A and C together, B and C together, or A, B, and C together, etc.
[0102] Furthermore, any disjunctive word or phrase expressing two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibility of including one of the terms, either one of the terms, or both terms. For example, the phrase "A or B" should be understood to include the possibilities of "A" or "B" or "A and B."
[0103] All examples and conditional language described in this disclosure are intended for instructional purposes to assist the reader in understanding the disclosure and the concepts that the disclosure contributes to further developing the art, and should not be construed as being limited to such specifically recited examples and conditions. Although the embodiments of the present disclosure have been described in detail, various modifications, substitutions, and alternatives may be made thereto without departing from the spirit and scope of the present disclosure.
[0104] In addition to the above-described embodiment, the following supplementary notes are further disclosed. (Appendix 1) 1. A method executable by a processor of an electronic device, comprising: receiving a dataset associated with a machine learning task; preparing an input quantum state based on the received data set; preparing a variational quantum circuit (VQC) on a quantum computer to function as a quantum neural network (QNN); For the current time step in the sequence of time steps: reading the contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN; selecting values for the parameters of the QNN based on the content; preparing inputs for an optimization network based on the selected values of the parameters of the QNN; applying the optimization network to the inputs to compute outputs; updating the values of the parameters of the QNN based on the output; passing the input quantum state and the updated values of the parameters to the QNN to obtain a current value of a cost function of the QNN from the quantum computer; performing operations including: updating the state buffer based on the current value of the cost function and the updated values of the parameters; training the QNN on the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold; The method includes: (Appendix 2) prior to performing the operation, initializing the parameters of the QNN with initial values; instantiating the state buffer based on the initialization of the parameters; Further comprising: The method of claim 1 , wherein the state buffer is a two-sided queue that is empty when parameters of the QNN are initialized with the initial values. (Appendix 3) selecting values for the parameters of the QNN by sampling past values of the parameters of the QNN contained in the state buffer; The method of claim 1 , wherein the sampling is based on a determination that the state buffer contains the past information regarding the parameters of the QNN. (Appendix 4) retrieving past values of the cost function obtained for two consecutive time steps preceding the current time step in the series of time steps; calculating the difference between the past values; constructing an input vector by concatenating the difference and the selected values of the parameters; preparing the inputs for the optimization network based on application of exponential scaling to the input vectors and a normalization factor; The method of claim 1, further comprising: (Appendix 5) 2. The method of claim 1, wherein the optimization network is a long short-term memory (LSTM) network, the LSTM network being associated with a meta-parameter and configured to maintain a hidden state of the LSTM network. (Appendix 6) 6. The method of claim 5, wherein the inputs of the optimization network further include the hidden states of the LSTM network. (Appendix 7) The values of the parameters of the QNN are as follows: Transforming the output of the optimization network by applying a nonlinear activation function to the output; multiplying the transformed output by a value of a learning rate parameter to generate an update to the current time step; adding the updated values to the selected values of the parameters of the QNN at the current time step; The method of claim 1 , wherein the update is performed by (Appendix 8) the state buffer further includes past values of the cost function for one or more time steps preceding the current time step; The method of claim 1 , wherein the past information corresponds to past values of the parameters of the QNN for one or more time steps preceding the current time step. (Appendix 9) comparing a current value of the cost function for the current time step with a past value of the cost function for a time step preceding the current time step in the series of time steps; the past values are contained in a memory of the electronic device; The method of claim 1 , wherein the state buffer is updated to include a current value of the cost function and the updated values of the parameters based on the comparison. (Appendix 10) prior to execution of said operations, initializing meta-parameters of said optimization network with meta-parameter values; evaluating a meta loss function of the optimization network after completion of the series of time steps based on values of the cost function obtained for each time step of the series of time steps; updating the meta parameter values based on the meta loss function; The method of claim 1 further comprising: (Appendix 11) 2. The method of claim 1, wherein the VQC is a parameterized quantum circuit that includes a set of quantum gates in a particular arrangement, the set of quantum gates representing a set of operations to be performed on a set of qubits of the quantum computer. (Appendix 12) A non-transitory computer-readable storage medium configured to store instructions that, in response to being executed, cause an electronic device to perform an operation, the operation including: receiving a dataset associated with a machine learning task; preparing an input quantum state based on the data set; preparing a variational quantum circuit (VQC) on a quantum computer to function as a quantum neural network (QNN); For the current time step in the sequence of time steps: reading the contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN; selecting values for the parameters of the QNN based on the content; preparing inputs for an optimization network based on the selected values of the parameters of the QNN; applying the optimization network to the inputs to compute outputs; updating the values of the parameters of the QNN based on the output; passing the input quantum state and the updated values of the parameters to the QNN to obtain a current value of a cost function of the QNN from the quantum computer; performing operations including: updating the state buffer based on the current value of the cost function and the updated values of the parameters; training the QNN on the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold; A non-transitory computer readable storage medium comprising: (Appendix 13) The operation includes: prior to performing the operation, initializing the parameters of the QNN with initial values; instantiating the state buffer based on the initialization of the parameters; Further comprising: 13. The non-transitory computer-readable storage medium of claim 12, wherein the state buffer is a two-sided queue that is empty when parameters of the QNN are initialized with the initial values. (Appendix 14) selecting values for the parameters of the QNN by sampling past values of the parameters of the QNN contained in the state buffer; 13. The non-transitory computer-readable storage medium of claim 12, wherein the sampling is based on a determination that the state buffer contains the past information regarding the parameters of the QNN. (Appendix 15) The operation includes: retrieving past values of the cost function obtained for two consecutive time steps preceding the current time step in the series of time steps; calculating the difference between the past values; constructing an input vector by concatenating the difference and the selected values of the parameters; preparing the inputs for the optimization network based on application of exponential scaling to the input vectors and a normalization factor; 13. The non-transitory computer-readable storage medium of claim 12, further comprising: (Appendix 16) 13. The non-transitory computer-readable storage medium of claim 12, wherein the optimization network is a long short-term memory (LSTM) network, the LSTM network being associated with a meta-parameter and configured to maintain a hidden state of the LSTM network. (Appendix 17) The values of the parameters of the QNN are as follows: transforming the output of the optimization network by applying a nonlinear activation function to the output; multiplying the transformed output by a value of a learning rate parameter to generate an update to the current time step; adding the updated values to the selected values of the parameters of the QNN at the current time step; 13. The non-transitory computer-readable storage medium of claim 12, wherein the non-transitory computer-readable storage medium is updated by (Appendix 18) The operation includes: comparing a current value of the cost function for the current time step with a past value of the cost function for a time step preceding the current time step in the series of time steps; the past values are contained in a memory of the electronic device; 13. The non-transitory computer-readable storage medium of claim 12, wherein the state buffer is updated to include a current value of the cost function and the updated values of the parameters based on the comparison. (Appendix 19) The operation includes: prior to execution of said operations, initializing meta-parameters of said optimization network with meta-parameter values; evaluating a meta loss function of the optimization network after completion of the series of time steps based on values of the cost function obtained for each time step of the series of time steps; updating the meta parameter values based on the meta loss function; 13. The non-transitory computer-readable storage medium of claim 12, comprising: (Appendix 20) 1. An electronic device comprising: A memory configured to store instructions; a processor, coupled to the memory, configured to execute the instructions to perform operations; The process includes: receiving a dataset associated with a machine learning task; preparing an input quantum state based on the received data set; preparing a variational quantum circuit (VQC) on a quantum computer to function as a quantum neural network (QNN); For the current time step in the sequence of time steps: reading the contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN; selecting values for the parameters of the QNN based on the content; preparing inputs for an optimization network based on the selected values of the parameters of the QNN; applying the optimization network to the inputs to compute outputs; updating the values of the parameters of the QNN based on the output; passing the input quantum state and the updated values of the parameters to the QNN to obtain a current value of a cost function of the QNN from the quantum computer; performing operations including: updating the state buffer based on the current value of the cost function and the updated values of the parameters; training the QNN on the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold; 23. An electronic device comprising: [Explanation of symbols]
[0105] 102 System 104 User device 106 Display device 108 Communication Network 110 Quantum Computer 112 Electronic equipment 116 Optimized Network
Claims
1. 1. A method executable by a processor of an electronic device, comprising: receiving a dataset associated with a machine learning task; preparing an input quantum state based on the received data set; preparing a variational quantum circuit (VQC) on a quantum computer to function as a quantum neural network (QNN); For the current time step in the sequence of time steps: reading the contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN; selecting values for the parameters of the QNN based on the content; preparing inputs for an optimization network based on the selected values of the parameters of the QNN; applying the optimization network to the inputs to compute outputs; updating the values of the parameters of the QNN based on the output; passing the input quantum state and the updated values of the parameters to the QNN to obtain from the quantum computer a current value of a cost function of the QNN; performing operations including: updating the state buffer based on the current value of the cost function and the updated values of the parameters; training the QNN on the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold; The method includes:
2. prior to performing the operation, initializing the parameters of the QNN with initial values; instantiating the state buffer based on the initialization of the parameters; Further comprising: The method of claim 1 , wherein the state buffer is a two-sided queue that is empty when parameters of the QNN are initialized with the initial values.
3. selecting values for the parameters of the QNN by sampling past values of the parameters of the QNN contained in the state buffer; The method of claim 1 , wherein the sampling is based on a determination that the state buffer contains the past information regarding the parameters of the QNN.
4. retrieving past values of the cost function obtained for two consecutive time steps preceding the current time step in the series of time steps; calculating the difference between the past values; constructing an input vector by concatenating the difference and the selected values of the parameters; preparing the inputs for the optimization network based on application of exponential scaling to the input vectors and a normalization factor; The method of claim 1 further comprising:
5. 2. The method of claim 1, wherein the optimization network is a long short-term memory (LSTM) network, the LSTM network being associated with a meta-parameter and configured to maintain a hidden state of the LSTM network.
6. The method of claim 5 , wherein the inputs of the optimization network further include the hidden states of the LSTM network.
7. The values of the parameters of the QNN are as follows: transforming the output of the optimization network by applying a nonlinear activation function to the output; multiplying the transformed output by a value of a learning rate parameter to generate an update to the current time step; adding the updated values to the selected values of the parameters of the QNN at the current time step; The method of claim 1 , wherein the update is performed by:
8. the state buffer further includes past values of the cost function for one or more time steps preceding the current time step; The method of claim 1 , wherein the past information corresponds to past values of the parameters of the QNN for one or more time steps preceding the current time step.
9. comparing a current value of the cost function for the current time step with a past value of the cost function for a time step preceding the current time step in the series of time steps; the past values are contained in a memory of the electronic device; The method of claim 1 , wherein the state buffer is updated to include a current value of the cost function and the updated values of the parameters based on the comparison.
10. prior to execution of said operations, initializing meta-parameters of said optimization network with meta-parameter values; evaluating a meta loss function of the optimization network after completion of the series of time steps based on values of the cost function obtained for each time step of the series of time steps; updating the meta parameter values based on the meta loss function; The method of claim 1 further comprising:
11. 2. The method of claim 1, wherein the VQC is a parameterized quantum circuit that includes a set of quantum gates in a particular arrangement, the set of quantum gates representing a set of operations to be performed on a set of qubits of the quantum computer.
12. A non-transitory computer-readable storage medium configured to store instructions that, in response to being executed, cause an electronic device to perform an operation, the operation including: receiving a dataset associated with a machine learning task; preparing an input quantum state based on the data set; preparing a variational quantum circuit (VQC) on a quantum computer to function as a quantum neural network (QNN); For the current time step in the sequence of time steps: reading the contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN; selecting values for the parameters of the QNN based on the content; preparing inputs for an optimization network based on the selected values of the parameters of the QNN; applying the optimization network to the inputs to compute outputs; updating the values of the parameters of the QNN based on the output; passing the input quantum state and the updated values of the parameters to the QNN to obtain from the quantum computer a current value of a cost function of the QNN; performing operations including: updating the state buffer based on the current value of the cost function and the updated values of the parameters; training the QNN on the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold; A non-transitory computer readable storage medium comprising:
13. The operation includes: prior to performing the operation, initializing the parameters of the QNN with initial values; instantiating the state buffer based on the initialization of the parameters; Further comprising:
13. The non-transitory computer-readable storage medium of claim 12, wherein the state buffer is a two-sided queue that is empty when parameters of the QNN are initialized with the initial values.
14. selecting values for the parameters of the QNN by sampling past values of the parameters of the QNN contained in the state buffer; The non-transitory computer-readable storage medium of claim 12 , wherein the sampling is based on a determination that the state buffer contains the past information regarding the parameters of the QNN.
15. The operation includes: retrieving past values of the cost function obtained for two consecutive time steps preceding the current time step in the series of time steps; calculating the difference between the past values; constructing an input vector by concatenating the difference and the selected values of the parameters; preparing the inputs for the optimization network based on application of exponential scaling to the input vectors and a normalization factor; 13. The non-transitory computer-readable storage medium of claim 12, further comprising:
16. 13. The non-transitory computer-readable storage medium of claim 12, wherein the optimization network is a long short-term memory (LSTM) network, the LSTM network being associated with a meta-parameter and configured to maintain a hidden state of the LSTM network.
17. The values of the parameters of the QNN are as follows: transforming the output of the optimization network by applying a nonlinear activation function to the output; multiplying the transformed output by a value of a learning rate parameter to generate an update to the current time step; adding the updated values to the selected values of the parameters of the QNN at the current time step; The non-transitory computer-readable storage medium of claim 12 , wherein the non-transitory computer-readable storage medium is updated by
18. The operation includes: comparing a current value of the cost function for the current time step with a past value of the cost function for a time step preceding the current time step in the series of time steps; the past values are contained in a memory of the electronic device; 13. The non-transitory computer-readable storage medium of claim 12, wherein the state buffer is updated to include a current value of the cost function and the updated value of the parameter based on the comparison.
19. The operation includes: prior to execution of said operations, initializing meta-parameters of said optimization network with meta-parameter values; evaluating a meta loss function of the optimization network after completion of the series of time steps based on values of the cost function obtained for each time step of the series of time steps; updating the meta parameter values based on the meta loss function; 13. The non-transitory computer-readable storage medium of claim 12, comprising:
20. 1. An electronic device comprising: A memory configured to store instructions; a processor, coupled to the memory, configured to execute the instructions to perform operations; The process includes: receiving a dataset associated with a machine learning task; preparing an input quantum state based on the received data set; preparing a variational quantum circuit (VQC) on a quantum computer to function as a quantum neural network (QNN); For the current time step in the sequence of time steps: reading the contents of a state buffer to determine whether the state buffer is empty or contains past information regarding parameters of the QNN; selecting values for the parameters of the QNN based on the content; preparing inputs for an optimization network based on the selected values of the parameters of the QNN; applying the optimization network to the inputs to compute outputs; updating the values of the parameters of the QNN based on the output; passing the input quantum state and the updated values of the parameters to the QNN to obtain from the quantum computer a current value of a cost function of the QNN; performing operations including: updating the state buffer based on the current value of the cost function and the updated values of the parameters; training the QNN on the machine learning task by repeating the execution of the operations using the updated values of the parameters until the current value of the cost function falls below a cost threshold; 23. An electronic device comprising:
Citation Information
Cited By
Information processing program, information processing method, and information processing device
EP4822610A1
Information processing program, information processing method, and information processing apparatus
JP2026170112A
