-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.py
39 lines (31 loc) · 1.15 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import numpy as np
import itertools
import qiskit
import os
#----------------------- Quantum Circuit Settings -----------------------
NUM_QUBITS = 4
NUM_SHOTS = 3000
NUM_LAYERS = 1
SHIFT = np.pi/4
def create_QC_OUTPUTS():
measurements = list(itertools.product([0, 1], repeat=NUM_QUBITS))
return [''.join([str(bit) for bit in measurement]) for measurement in measurements]
QC_OUTPUTS = create_QC_OUTPUTS()
NUM_QC_OUTPUTS = len(QC_OUTPUTS)
SIMULATOR = qiskit.Aer.get_backend('qasm_simulator')
#----------------------- Dataset Settings -----------------------
training_root = os.path.join( 'datasets', 'VolcanicEruptionDetection', 'training')
validation_root = os.path.join( 'datasets', 'VolcanicEruptionDetection', 'validation')
CLASS_DICT = {
"eruption": 0,
"no_eruption": 1
}
#----------------------- Training Settings -----------------------
TRAINING = True
LOAD_CHECKPOINT = False
EPOCHS = 100
LEARNING_RATE = 0.0002
#MOMENTUM = 0.5
BATCH_SIZE = 16
CLASSES = len(CLASS_DICT)
MODEL_SAVE_PATH = os.path.join(os.getcwd(), 'saved_models', 'model-Q{}-L{}.pt'.format(NUM_QUBITS, NUM_LAYERS))