-
Notifications
You must be signed in to change notification settings - Fork 1
/
ex_house_mc.py
91 lines (74 loc) · 2.83 KB
/
ex_house_mc.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
from api import API
from disaggregate import ADAE, DAE, Seq2Point, Seq2Seq, WindowGRU, RNN
import warnings
warnings.filterwarnings("ignore")
path = 'D:/workspace/nilm/data/redd_data.h5'
# path = 'D:/workspace/nilm/code/databank/redd_data.h5'
debug = False
test = False
if(debug):
method = {
'DAE': DAE({'save-model-path': 'DAE', 'pretrained-model-path': None, 'n_epochs': 1, 'batch_size': 256}),
'RNN': RNN({'save-model-path': 'RNN', 'pretrained-model-path': None, 'n_epochs': 1, 'batch_size': 256}),
'Seq2Point': Seq2Point({'save-model-path': 'Seq2Point', 'pretrained-model-path': None, 'n_epochs': 1, 'batch_size': 256}),
'Seq2Seq': Seq2Seq({'save-model-path': 'Seq2Seq', 'pretrained-model-path': None, 'n_epochs': 1, 'batch_size': 256}),
'GRU': WindowGRU({'save-model-path': 'GRU', 'pretrained-model-path': None, 'n_epochs': 1, 'batch_size': 256}),
}
else:
method = {
'DAE': DAE({'save-model-path': 'DAE', 'pretrained-model-path': None}),
'RNN': RNN({'save-model-path': 'RNN', 'pretrained-model-path': None}),
'Seq2Point': Seq2Point({'save-model-path': 'Seq2Point', 'pretrained-model-path': None}),
'Seq2Seq': Seq2Seq({'save-model-path': 'Seq2Seq', 'pretrained-model-path': None}),
'GRU': WindowGRU({'save-model-path': 'GRU', 'pretrained-model-path': None}),
}
if test:
method = {
'DAE': DAE({'save-model-path': 'DAE', 'pretrained-model-path': 'DAE'}),
'RNN': RNN({'save-model-path': 'RNN', 'pretrained-model-path': 'RNN'}),
'Seq2Point': Seq2Point({'save-model-path': 'Seq2Point', 'pretrained-model-path': 'Seq2Point'}),
'Seq2Seq': Seq2Seq({'save-model-path': 'Seq2Seq', 'pretrained-model-path': 'Seq2Seq'}),
'GRU': WindowGRU({'save-model-path': 'GRU', 'pretrained-model-path': 'GRU'}),
}
ex_train_microwave = {
'power': {
'mains': ['apparent', 'active'],
'appliance': ['apparent', 'active']
},
'sample_rate': 6,
'appliances': ['microwave'],
'methods': method,
'isState': False,
'train': {
'datasets': {
'redd': {
'path': path,
'buildings': {
1: {
'start_time': '2011-04-18',
'end_time': '2011-05-24'
},
3: {
'start_time': '2011-04-16',
'end_time': '2011-05-30'
}
}
}
}
},
'test': {
'datasets': {
'redd': {
'path': path,
'buildings': {
2: {
'start_time': '2011-04-17',
'end_time': '2011-05-22'
},
}
}
},
},
}
#%%
API(ex_train_microwave)