-
Notifications
You must be signed in to change notification settings - Fork 1
/
lstm_settings.py
42 lines (31 loc) · 1.12 KB
/
lstm_settings.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
from collections import namedtuple
from tf import optimizers
TrainSettings = namedtuple('Encoded', 'ticks_per_second, window_size threshold_scale '
'composer network loss optimizer final_activation')
def get_model_id(settings, n_notes):
return f"{settings.composer}_" \
f"{settings.network}_" \
f"{settings.loss}_" \
f"{settings.optimizer._name}_" \
f"{settings.final_activation}_" \
f"n{n_notes}_" \
f"tps{settings.ticks_per_second}_" \
f"ws{settings.window_size}"
base_settings = TrainSettings(
ticks_per_second=8,
window_size=128,
threshold_scale=.7,
# composer=None,
composer='bach',
# network='small',
# network='medium',
network='big',
loss='categorical_crossentropy',
# loss='binary_crossentropy',
# loss='mse',
# optimizer=optimizers.SGD(learning_rate=0.01, momentum=0.7, nesterov=True),
optimizer=optimizers.Nadam(learning_rate=0.005),
# optimizer=optimizers.Adam(learning_rate=0.005),
# final_activation='softmax',
final_activation='sigmoid',
)