LLY-DML is part of the LILY project and is a Quantum Machine Learning model. It uses so-called L-Gates. These gates are Machine Learning gates that modify their state based on an input to map to a desired state of an input.
This method is used to train the data in a random order and interval towards the end of the optimization function. It ensures that training subsequent activation matrices does not overly disrupt the datasets already trained.
Process Details
Initialization:
Under the given optimizer's section in train.json, load:
The target_state for each activation matrix.
The last training matrix final_ombc for each activation matrix.
From data.json, retrieve the value iteration_crosstrain_b.
Initialize an internal attribute current_tp (Current Training Parameters) by loading final_ombc.
Cross-Training Loop (Loop A):
The number of iterations is set by iteration_crosstrain_a from data.json.
For Each Iteration:
Random Selection:
Randomly determine two values:
intern_iter: An internal iteration count.
selected_ap: A selected activation matrix from the available activation matrices in data.json.
Cross-Training Helper:
Call the crosshelper() method with:
The matrix and target_state from selected_ap loaded from train.json.
current_tp.
The optimizer.
The value iteration_crosstrain_b.
Completion Check:
At the end, verify whether each activation matrix (AP) has been trained at least once.
If not, repeat the loop until the value top_cross_iterations from data.json is exceeded.
If the maximum is exceeded without training all APs, log an error message indicating that not every AP was cross-trained.
Method: crosshelper
Process Details
Determine Iterations:
Check if iteration_crosstrain_a is greater than intern_iter.
If yes, set b_iterations to iteration_crosstrain_b.
If not, use intern_iter as b_iterations.
Training Loop (Loop B):
For b_iterations Iterations:
Circuit Creation:
Create a circuit with:
current_tp as the training matrix.
selected_ap as the activation matrix.
Measurement:
Measure the circuit.
Optimization:
Call start(optimizer, target_state).
Execute the optimize method.
Documentation and Logging
Rules for the Training Matrices
Saving Optimized Training Matrices:
Under the respective optimizer and optimization matrix in train.json, save:
Each optimized training matrix.
Cross-Training Summary:
At the end, save a summary in train.json under crosstrain_selection.
This shows the order in which cross-training occurred.
Random Numbers:
Write the randomly generated numbers (intern_iter, selected_ap) into train.json.
Logging Rules
Logging Optimizer Completion:
Log the completion of each optimizer.
Logging Activation Matrix Details:
Log each activation matrix with:
Their iteration counts.
The number of entries made in train.json.
Logging Random Values:
Log the randomly generated numbers used during cross-training.
Method:
crosstraining(Optimizer)
This method is used to train the data in a random order and interval towards the end of the optimization function. It ensures that training subsequent activation matrices does not overly disrupt the datasets already trained.
Process Details
Initialization:
train.json
, load:target_state
for each activation matrix.final_ombc
for each activation matrix.data.json
, retrieve the valueiteration_crosstrain_b
.current_tp
(Current Training Parameters) by loadingfinal_ombc
.Cross-Training Loop (Loop A):
The number of iterations is set by
iteration_crosstrain_a
fromdata.json
.intern_iter
: An internal iteration count.selected_ap
: A selected activation matrix from the available activation matrices indata.json
.crosshelper()
method with:target_state
fromselected_ap
loaded fromtrain.json
.current_tp
.iteration_crosstrain_b
.Completion Check:
AP
) has been trained at least once.top_cross_iterations
fromdata.json
is exceeded.Method:
crosshelper
Process Details
Determine Iterations:
iteration_crosstrain_a
is greater thanintern_iter
.b_iterations
toiteration_crosstrain_b
.intern_iter
asb_iterations
.Training Loop (Loop B):
b_iterations
Iterations:current_tp
as the training matrix.selected_ap
as the activation matrix.start(optimizer, target_state)
.optimize
method.Documentation and Logging
Rules for the Training Matrices
train.json
, save:train.json
undercrosstrain_selection
.intern_iter
,selected_ap
) intotrain.json
.Logging Rules
train.json
.