-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphase_keys.py
209 lines (199 loc) · 4.23 KB
/
phase_keys.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import coinstac_node_ops.local as ops_local
import coinstac_node_ops.remote as ops_remote
import coinstac_masking.local as mask_local
import coinstac_masking.remote as mask_remote
import coinstac_decentralized_row_means.local as drm_local
import coinstac_decentralized_row_means.remote as drm_remote
import coinstac_spatially_constrained_ica.local as scica_local
import coinstac_spatially_constrained_ica.remote as scica_remote
import coinstac_backreconstruction.local as br_local
import coinstac_backreconstruction.remote as br_remote
import coinstac_decentralized_pca.local as dpca_local
import coinstac_decentralized_pca.remote as dpca_remote
import coinstac_gica.local as gica_local
import coinstac_gica.remote as gica_remote
# Init
"""
INIT_LOCAL = [
dict(
do=[
ops_local.local_load_datasets,
ops_local.local_output_to_cache,
ops_local.local_input_to_cache,
ops_local.local_dump_cache,
ops_local.local_clear_cache
],
recv=[],
send='local_clear_cache'
)
]
INIT_REMOTE = [
dict(
do=[
ops_remote.remote_noop,
],
recv=INIT_LOCAL[0].get("send"),
send='remote_noop'
)
]
# Masking
MASKING_LOCAL = [
dict(
do=[
ops_local.local_input_to_cache,
ops_local.local_load_cache,
ops_local.local_cache_to_input,
mask_local.masking_local_1
],
recv='remote_noop',
send='masking_local_1'
)
]
MASKING_REMOTE = [
dict(
do=[
mask_remote.masking_remote_1
],
recv='masking_local_1',
send='masking_remote_1'
)
]
# Row Means
ROW_MEANS_LOCAL = [
dict(
do=[drm_local.drm_local_1],
recv='masking_remote_1',
send='drm_local_1',
)
]
ROW_MEANS_REMOTE = [
dict(
do=[
drm_remote.drm_remote_1,
ops_remote.remote_output_to_cache,
ops_remote.remote_dump_cache
],
recv=ROW_MEANS_LOCAL[0].get('send'),
send='remote_dump_cache',
)
]
"""
NOOP_LOCAL = [
dict(
do=[
ops_local.local_noop
],
recv=[],
send='local_noop',
args=[
[]
],
kwargs=[
{}
]
)
]
NOOP_REMOTE = [
dict(
do=[
ops_remote.remote_noop
],
recv="local_noop",
send='remote_noop',
args=[
[]
],
kwargs=[
{}
]
)
]
INIT_LOCAL = [
dict(
do=[
ops_local.local_load_datasets,
ops_local.local_output_to_input,
mask_local.masking_local_1,
ops_local.local_output_to_cache,
ops_local.local_cache_to_input,
drm_local.drm_local_1,
],
recv=[],
send='local_init',
args=[
[],
[],
[],
[],
[]
],
kwargs=[
{},
{},
{},
{},
{}
],
)
]
INIT_REMOTE = [
dict(
do=[
drm_remote.drm_remote_1,
ops_remote.remote_output_to_cache,
ops_remote.remote_dump_cache_to_mat
],
recv=INIT_LOCAL[0].get("send"),
send='remote_init',
args=[
[],
[],
[]
],
kwargs=[
{},
{},
{}
],
)
]
# Spatially Constrained ICA
SPATIALLY_CONSTRAINED_ICA_LOCAL = [
dict(
do=[
scica_local.scica_local_1,
ops_local.local_output_to_cache,
ops_local.local_dump_cache_to_npy,
ops_local.local_clear_cache
],
recv=[],
send='scica_local_1',
args=[
[],
[],
[],
[]
],
kwargs=[
{},
{},
{},
{}
],
)
]
SPATIALLY_CONSTRAINED_ICA_REMOTE = [
dict(
do=[
ops_remote.remote_noop
],
recv=SPATIALLY_CONSTRAINED_ICA_LOCAL[0].get('send'),
send='scica_remote_noop',
args=[
[]
],
kwargs=[
{}
],
)
]