Spaces:
Runtime error
Runtime error
ashutosh1919
commited on
Commit
•
a90ca10
1
Parent(s):
b883d39
Changed distibution plot
Browse files- gradio_app.py +3 -1
gradio_app.py
CHANGED
@@ -14,7 +14,9 @@ def run_perceptron(
|
|
14 |
):
|
15 |
p = Perceptron(num_qubits, weight_value, input_value)
|
16 |
counts = p.measure_circuit(num_iters)
|
17 |
-
|
|
|
|
|
18 |
freq_hist = plt.figure()
|
19 |
plt.bar(counts.keys(), counts.values(), width=0.5)
|
20 |
for i, v in enumerate(list(counts.values())):
|
|
|
14 |
):
|
15 |
p = Perceptron(num_qubits, weight_value, input_value)
|
16 |
counts = p.measure_circuit(num_iters)
|
17 |
+
counts.setdefault('0', 0)
|
18 |
+
counts.setdefault('1', 0)
|
19 |
+
prob_1 = counts['1'] / num_iters
|
20 |
freq_hist = plt.figure()
|
21 |
plt.bar(counts.keys(), counts.values(), width=0.5)
|
22 |
for i, v in enumerate(list(counts.values())):
|