-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix QNN for input and weights ordering (#728)
* Fix QNN for input and weights ordering * Black * Lint * Update QCNN tutorial * Add reno * Fix draw style per #725 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e5af2e6
commit a89e696
Showing
7 changed files
with
132 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1.930057091422052, 0.2829424508139703, 0.35555636265939633, 0.1750006532903061, 0.3002103666790018, 0.6641911912373437, 1.3310981300850042, 0.5022717197547227, 0.44912874128880675, 0.40236963192983266, 0.3459537084665159, 0.9786311288435154, 0.48716712269991697, -0.007081389738930712, 0.21570815199311827, 0.07334182375267477, 0.6907887498355103, 0.21771166428570735, 1.087665977608006, 1.2571463700739218, 1.0866597360102666, 2.126145551821481, 0.8914518096731741, 1.5053260036617715, 0.44798876926441555, 0.9498701675467225, 0.15490304396579338, 0.1338674031994701, -0.6938374500039391, 0.029396385425104116, -0.09785818314088227, -0.31198441382224246, 0.20004568516690807, 1.848494069662786, -0.028371899054628447, -0.15229494459622284, 0.7653870524298326, 0.6881492316484289, 0.6759011152318357, 1.6028387103546868, 0.47711915171800057, -0.26162053028790294, -0.12898443497061718, 0.5281303751714184, 0.4957555866394333, 1.6095784010055925, 0.5685823964468215, 1.2812276175594062, 0.3032325725579015, 1.4291081956286258, 0.7081163438891277, 1.8291375321912147, -0.11047287562207528, 0.2751308409529747, 0.2834764252747557, 0.29668607404725605, 0.008300790063532154, 0.6707732056265118, 0.5325267632509095, 0.7240676576317691, 0.08123934531343553, -0.0038536767244725153, -0.1001165849018211] | ||
[1.68270961, 0.11605051, 0.34864916, 0.74675878, 1.87124355, 1.49219533, -0.38654013, 1.6794744, 1.46546974, 2.16547249, 1.05274095, 2.2565039, 0.31246977, -0.0977787, 0.26751274, -0.24319314, 0.28359516, 0.17431664, 0.86434056, 1.08183541, 1.64600062, 2.17350294, 0.17430376, 0.08381051, 0.30748524, 1.6671458, 0.23076889, 0.40720057, -0.38243368, -0.28842447, 0.08507067, 1.34472166, -0.08210173, 1.10931829, 0.15418569, 0.65755067, 3.09541972, 0.41647156, 1.12894435, 1.03898584, 0.64931532, -0.43442102, 0.24324246, 0.98370841, 0.57256531, 0.25832156, 0.42749823, 1.78949614, 0.27749909, 0.07237166, 0.05920573, 0.41896919, 0.66868785, 0.73035314, 0.00984019, 0.72243278, 1.10299638, 0.80821682, 0.39530007, 1.03814133, 0.41697893, 0.53016156, 1.13594375] |
64 changes: 32 additions & 32 deletions
64
docs/tutorials/11_quantum_convolutional_neural_networks.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
releasenotes/notes/fix_qnn_binding_order-74caef8a49ecffe5.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixes an issue for the Quantum Neural Networks where the binding order of the inputs | ||
and weights might end up being incorrect. Though the params for the inputs and weights | ||
are specified to the QNN, the code previously bound the inputs and weights in the order | ||
given by the circuit.parameters. This would end up being the right order for the Qiskit | ||
circuit library feature maps and ansatzes most often used, as the default parameter | ||
names led to the order being as expected. However for custom names etc. this was not | ||
always the case and then led to unexpected behavior. The sequences for the input and | ||
weights parameters, as supplied, are now always used as the binding order, for the inputs | ||
and weights respectively, such that the order of the parameters in the overall circuit | ||
no longer matters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters