-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
executable file
·98 lines (52 loc) · 1.64 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
##
from math import log2, ceil
## Misc Params ##
act_classical_rnn = False
reconstruct_qstate = True
## Neural Params ##
timestep_size = 13
hm_qbits = ceil(log2(timestep_size))
statevec_size = 2**hm_qbits
in_size = timestep_size # timestep_size+statevec_size
ansatz_mode = 0 # 0 for Mottonen, 1 for U3s
entangle_mode = -1 # -1 for off, 0 for weak, 1 for strong
circuit_layers = 1
out_size = (hm_qbits*3 if ansatz_mode == 1 else statevec_size-1) *circuit_layers if not act_classical_rnn else in_size
creation_info = [in_size, 'g', 32, 'f2' if not act_classical_rnn else 'f1', out_size]
init_xavier = True
forget_bias = 0
## Data Params ##
# pre-process
samples_folder = 'data'
data_path = 'data'
polyphony = False
combine_instrus = True
beat_resolution = 2 # 8 # 4
# post-process
hm_bars_grouped = 4 # 4 # 2
hm_bars_slide = hm_bars_grouped/2
dev_ratio = .2
shuffle_split = False
shuffle_epoch = True
## Training Params ##
hm_bars_teacher = hm_bars_grouped # hm_bars_grouped/2
fresh_model = True
fresh_meta = True
learning_rate = 1e-2 # 5e-2
hm_epochs = 100
batch_size = 50
loss_squared = False
gradient_clip = 0 # 0 for off
optimizer = 'custom'
train_parallel = False
train_combined = True
initialize_loss = True
model_save_path = 'model'
disp_batches = False
ckp_save_epochs = []
overwrite_model = False
## Generation Params ##
model_load_path = model_save_path
note_pick_mode = 3 # 0 for theoretical highest, 1 for experimental highest, 2 for experimental polyphonic, 3 for experimental monophonic
preferred_backend = None
##