-
Notifications
You must be signed in to change notification settings - Fork 40
/
customObjects.py
40 lines (35 loc) · 1.12 KB
/
customObjects.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
from DeepJetCore.DJCLosses import *
from DeepJetCore.DJCLayers import *
import imp
try:
imp.find_module('Losses')
from Losses import *
except ImportError as e:
print ('No Losses module found, ignoring at your own risk. The following error occured:')
print(e)
print('//////////////////')
global_loss_list = {}
try:
imp.find_module('Layers')
from Layers import *
except ImportError as e:
print ('No Layers module found, ignoring at your own risk. The following error occured:')
print(e)
print('//////////////////')
global_layers_list = {}
try:
imp.find_module('Metrics')
from Metrics import *
except ImportError as e:
print ('No metrics module found, ignoring at your own risk. The following error occured:')
print(e)
print('//////////////////')
global_metrics_list = {}
def get_custom_objects():
custom_objs = {}
custom_objs.update(djc_global_loss_list)
custom_objs.update(djc_global_layers_list)
custom_objs.update(global_loss_list)
custom_objs.update(global_layers_list)
custom_objs.update(global_metrics_list)
return custom_objs