-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathml_dicts.py
54 lines (49 loc) · 1.63 KB
/
ml_dicts.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
import tensorflow as tf
import tensorflow_addons as tfa
from backend.machine_learning.ml_gnns import create_schnet_with_dataset, smiles_to_schnet_input
from backend.machine_learning.ml_fnns import create_fnn_with_dataset, smiles_to_fnn_input
"""
map of available optimizer names to their keras equivalent
"""
optimizers = {
'Adam': tf.keras.optimizers.Adam,
'Adamax': tf.keras.optimizers.Adamax,
'Stochastic Gradient Descent': tf.keras.optimizers.SGD,
'Nadam': tf.keras.optimizers.Nadam,
'RMSprop': tf.keras.optimizers.RMSprop,
'Adadelta': tf.keras.optimizers.Adadelta,
'Adagrad': tf.keras.optimizers.Adagrad,
'Ftrl': tf.keras.optimizers.Ftrl,
}
"""
map of available loss function names to their keras equivalent
"""
losses = {
'Mean Absolute Error': tf.keras.losses.MeanAbsoluteError,
'Mean Squared Error': tf.keras.losses.MeanSquaredError,
'Binary Cross Entropy': tf.keras.losses.BinaryCrossentropy,
'Huber Loss': tf.keras.losses.Huber,
}
"""
map of available metric names to their keras equivalent
"""
metrics = {
'MeanAbsoluteError': tf.keras.metrics.MeanAbsoluteError,
'Accuracy': tf.keras.metrics.Accuracy,
'MeanAbsolutePercentageError': tf.keras.metrics.MeanAbsolutePercentageError,
'R2': tfa.metrics.RSquare,
}
"""
map of available model types to their respective creation functions
"""
creation_functions = {
'schnet': create_schnet_with_dataset,
'sequential': create_fnn_with_dataset,
}
"""
map of available model types to their respective molecule conversion functions
"""
molecule_conversion_functions = {
'schnet': smiles_to_schnet_input,
'sequential': smiles_to_fnn_input,
}