A class for Adam optimization according to https://towardsdatascience.com/how-to-implement-an-adam-optimizer-from-scratch-76e7b217f1cc.
More...
#include <Adam.h>
◆ Adam() [1/2]
Nullary constructor of the class.
- Returns
- An instance of the class
Definition at line 31 of file common/Adam.cpp.
◆ Adam() [2/2]
Adam::Adam |
( |
double |
beta1_in, |
|
|
double |
beta2_in, |
|
|
double |
epsilon_in, |
|
|
double |
eta_in |
|
) |
| |
Contructor of the class.
Constructor of the class.
- Parameters
-
Umtx_in | The unitary matrix to be decomposed |
qbit_num_in | The number of qubits spanning the unitary to be decomposed. |
initial_guess_in | Type to guess the initial values for the optimization. Possible values: ZEROS=0, RANDOM=1, CLOSE_TO_ZERO=2 |
- Returns
- An instance of the class
Constructor of the class.
- Parameters
-
??????????????????????????????? | |
??????????????????????????????? | |
??????????????????????????????? | |
- Returns
- An instance of the class
Definition at line 58 of file common/Adam.cpp.
◆ ~Adam()
◆ get_decreasing_test()
double Adam::get_decreasing_test |
( |
| ) |
|
◆ initialize_moment_and_variance()
void Adam::initialize_moment_and_variance |
( |
int |
parameter_num | ) |
|
◆ reset()
◆ update()
Call to set the number of gate blocks to be optimized in one shot.
- Parameters
-
optimization_block_in | The number of gate blocks to be optimized in one shot |
optimization_block_in | The number of gate blocks to be optimized in one shot |
- Returns
- 0 optimizer is in decreasing stage, 1 converged to local minumum
Definition at line 138 of file common/Adam.cpp.
◆ beta1
parameter beta1 of the Adam algorithm
Definition at line 50 of file Adam.h.
◆ beta1_t
beta1^t
Definition at line 64 of file Adam.h.
◆ beta2
parameter beta2 of the Adam algorithm
Definition at line 52 of file Adam.h.
◆ beta2_t
beta2^t
Definition at line 66 of file Adam.h.
◆ decreasing_idx
int Adam::decreasing_idx = 0 |
|
protected |
current index in the decreasing_vec array
Definition at line 78 of file Adam.h.
◆ decreasing_test
double Adam::decreasing_test |
|
protected |
decreasing_test
Definition at line 80 of file Adam.h.
◆ decreasing_vec
vector containing 1 if cost function decreased from previous value, and -1 if it increased
Definition at line 76 of file Adam.h.
◆ epsilon
◆ eta
◆ f0_idx
current index in the f0_vec array
Definition at line 73 of file Adam.h.
◆ f0_mean
Mean of the latest cost function values to test local minimum.
Definition at line 71 of file Adam.h.
◆ f0_prev
previous value of the cost function
Definition at line 82 of file Adam.h.
◆ f0_vec
vector stroing the lates values of cost function values to test local minimum
Definition at line 69 of file Adam.h.
◆ iter_t
iteration index
Definition at line 61 of file Adam.h.
◆ mom
momentum parameter of the Adam algorithm
Definition at line 57 of file Adam.h.
◆ num_threads
Store the number of OpenMP threads. (During the calculations OpenMP multithreading is turned off.)
Definition at line 48 of file Adam.h.
◆ var
variance parameter of the Adam algorithm
Definition at line 59 of file Adam.h.
The documentation for this class was generated from the following files: