|
| | QNeuron (QInterfacePtr reg, const std::vector< bitLenInt > &inputIndcs, const bitLenInt &outputIndx) |
| | "QNeuron" is a "Quantum neuron" or "quantum perceptron" class that can learn and predict in superposition. More...
|
| |
| | QNeuron (const QNeuron &toCopy) |
| | Create a new QNeuron which is an exact duplicate of another, including its learned state. More...
|
| |
| QNeuron & | operator= (QNeuron &toCopy) |
| |
| void | SetSimulator (QInterfacePtr sim) |
| | Replace the simulator. More...
|
| |
| void | SetIndices (const std::vector< bitLenInt > &inputIndcs, const bitLenInt &outputIndx) |
| | Replace the input and output indices. More...
|
| |
| QInterfacePtr | GetSimulator () |
| | Retrieve the simulator. More...
|
| |
| bitLenInt | GetInputCount () |
| |
| bitCapIntOcl | GetInputPower () |
| |
| real1_f | Predict (const real1_s *angles, const bool &expected=true, const bool &resetInit=true, const QNeuronActivationFn &activationFn=Sigmoid, const real1_f &alpha=ONE_R1_F) |
| | Predict a binary classification. More...
|
| |
| real1_f | Unpredict (const real1_s *angles, const bool &expected=true, const QNeuronActivationFn &activationFn=Sigmoid, const real1_f &alpha=ONE_R1_F) |
| | "Uncompute" the Predict() method More...
|
| |
| real1_f | LearnCycle (real1_s *angles, const bool &expected=true, const QNeuronActivationFn &activationFn=Sigmoid, const real1_f &alpha=ONE_R1_F) |
| |
| void | Learn (real1_s *angles, const real1_f &eta, const bool &expected=true, const bool &resetInit=true, const QNeuronActivationFn &activationFn=Sigmoid, const real1_f &alpha=ONE_R1_F) |
| | Perform one learning iteration, training all parameters. More...
|
| |
| void | LearnPermutation (real1_s *angles, const real1_f &eta, const bool &expected=true, const bool &resetInit=true, const QNeuronActivationFn &activationFn=Sigmoid, const real1_f &alpha=ONE_R1_F) |
| | Perform one learning iteration, measuring the entire QInterface and training the resulting permutation. More...
|
| |
"QNeuron" is a "Quantum neuron" or "quantum perceptron" class that can learn and predict in superposition.
This is a simple "quantum neuron" or "quantum perceptron" class, for use of the Qrack library for machine learning. See https://arxiv.org/abs/quant-ph/0410066 (and https://arxiv.org/abs/1711.11240) for the basis of this class' theoretical concept.
An untrained QNeuron (with all 0 variational parameters) will forward all inputs to 1/sqrt(2) * (|0> + |1>). The variational parameters are Pauli Y-axis rotation angles divided by 2 * Pi (such that a learning parameter of 0.5 will train from a default output of 0.5/0.5 probability to either 1.0 or 0.0 on one training input).
Perform one learning iteration, training all parameters.
Inputs must be already loaded into "qReg" before calling this method. "expected" is the true binary output category, for training. "eta" is a volatility or "learning rate" parameter with a maximum value of 1.
In the feedback process of learning, default initial conditions forward untrained predictions to 1/sqrt(2) * (|0>
- |1>) for the output bit. If you want to initialize other conditions before "Learn()," set "resetInit" to false.
Perform one learning iteration, measuring the entire QInterface and training the resulting permutation.
Inputs must be already loaded into "qReg" before calling this method. "expected" is the true binary output category, for training. "eta" is a volatility or "learning rate" parameter with a maximum value of 1.
In the feedback process of learning, default initial conditions forward untrained predictions to 1/sqrt(2) * (|0>
- |1>) for the output bit. If you want to initialize other conditions before "LearnPermutation()," set "resetInit" to false.