SURE-tools 2.1.30__py3-none-any.whl → 2.1.32__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of SURE-tools might be problematic. Click here for more details.
- SURE/PerturbFlow.py +4 -6
- SURE/SURE.py +22 -9
- {sure_tools-2.1.30.dist-info → sure_tools-2.1.32.dist-info}/METADATA +1 -1
- {sure_tools-2.1.30.dist-info → sure_tools-2.1.32.dist-info}/RECORD +8 -8
- {sure_tools-2.1.30.dist-info → sure_tools-2.1.32.dist-info}/WHEEL +0 -0
- {sure_tools-2.1.30.dist-info → sure_tools-2.1.32.dist-info}/entry_points.txt +0 -0
- {sure_tools-2.1.30.dist-info → sure_tools-2.1.32.dist-info}/licenses/LICENSE +0 -0
- {sure_tools-2.1.30.dist-info → sure_tools-2.1.32.dist-info}/top_level.txt +0 -0
SURE/PerturbFlow.py
CHANGED
|
@@ -73,7 +73,7 @@ class PerturbFlow(nn.Module):
|
|
|
73
73
|
config_enum: str = 'parallel',
|
|
74
74
|
use_cuda: bool = False,
|
|
75
75
|
seed: int = 42,
|
|
76
|
-
|
|
76
|
+
zero_bias: bool = True,
|
|
77
77
|
dtype = torch.float32, # type: ignore
|
|
78
78
|
):
|
|
79
79
|
super().__init__()
|
|
@@ -97,7 +97,7 @@ class PerturbFlow(nn.Module):
|
|
|
97
97
|
self.post_layer_fct = post_layer_fct
|
|
98
98
|
self.post_act_fct = post_act_fct
|
|
99
99
|
self.hidden_layer_activation = hidden_layer_activation
|
|
100
|
-
self.
|
|
100
|
+
self.use_bias = not zero_bias
|
|
101
101
|
|
|
102
102
|
self.codebook_weights = None
|
|
103
103
|
|
|
@@ -198,7 +198,7 @@ class PerturbFlow(nn.Module):
|
|
|
198
198
|
if self.cell_factor_size>0:
|
|
199
199
|
self.cell_factor_effect = nn.ModuleList()
|
|
200
200
|
for i in np.arange(self.cell_factor_size):
|
|
201
|
-
if self.
|
|
201
|
+
if self.use_bias:
|
|
202
202
|
self.cell_factor_effect.append(MLP(
|
|
203
203
|
[self.latent_dim+1] + self.decoder_hidden_layers + [self.latent_dim],
|
|
204
204
|
activation=activate_fct,
|
|
@@ -207,11 +207,10 @@ class PerturbFlow(nn.Module):
|
|
|
207
207
|
post_act_fct=post_act_fct,
|
|
208
208
|
allow_broadcast=self.allow_broadcast,
|
|
209
209
|
use_cuda=self.use_cuda,
|
|
210
|
-
bias=True,
|
|
211
210
|
)
|
|
212
211
|
)
|
|
213
212
|
else:
|
|
214
|
-
self.cell_factor_effect.append(
|
|
213
|
+
self.cell_factor_effect.append(ZeroBiasMLP(
|
|
215
214
|
[self.latent_dim+1] + self.decoder_hidden_layers + [self.latent_dim],
|
|
216
215
|
activation=activate_fct,
|
|
217
216
|
output_activation=None,
|
|
@@ -219,7 +218,6 @@ class PerturbFlow(nn.Module):
|
|
|
219
218
|
post_act_fct=post_act_fct,
|
|
220
219
|
allow_broadcast=self.allow_broadcast,
|
|
221
220
|
use_cuda=self.use_cuda,
|
|
222
|
-
bias=False,
|
|
223
221
|
)
|
|
224
222
|
)
|
|
225
223
|
|
SURE/SURE.py
CHANGED
|
@@ -111,6 +111,7 @@ class SURE(nn.Module):
|
|
|
111
111
|
config_enum: str = 'parallel',
|
|
112
112
|
use_cuda: bool = False,
|
|
113
113
|
seed: int = 42,
|
|
114
|
+
zero_bias: bool = True,
|
|
114
115
|
dtype = torch.float32, # type: ignore
|
|
115
116
|
):
|
|
116
117
|
super().__init__()
|
|
@@ -134,6 +135,7 @@ class SURE(nn.Module):
|
|
|
134
135
|
self.post_layer_fct = post_layer_fct
|
|
135
136
|
self.post_act_fct = post_act_fct
|
|
136
137
|
self.hidden_layer_activation = hidden_layer_activation
|
|
138
|
+
self.use_bias = not zero_bias
|
|
137
139
|
|
|
138
140
|
self.codebook_weights = None
|
|
139
141
|
|
|
@@ -232,15 +234,26 @@ class SURE(nn.Module):
|
|
|
232
234
|
)
|
|
233
235
|
|
|
234
236
|
if self.cell_factor_size>0:
|
|
235
|
-
self.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
237
|
+
if self.use_bias:
|
|
238
|
+
self.cell_factor_effect = MLP(
|
|
239
|
+
[self.latent_dim + self.cell_factor_size] + self.decoder_hidden_layers + [self.latent_dim],
|
|
240
|
+
activation=activate_fct,
|
|
241
|
+
output_activation=None,
|
|
242
|
+
post_layer_fct=post_layer_fct,
|
|
243
|
+
post_act_fct=post_act_fct,
|
|
244
|
+
allow_broadcast=self.allow_broadcast,
|
|
245
|
+
use_cuda=self.use_cuda,
|
|
246
|
+
)
|
|
247
|
+
else:
|
|
248
|
+
self.cell_factor_effect = ZeroBiasMLP(
|
|
249
|
+
[self.latent_dim + self.cell_factor_size] + self.decoder_hidden_layers + [self.latent_dim],
|
|
250
|
+
activation=activate_fct,
|
|
251
|
+
output_activation=None,
|
|
252
|
+
post_layer_fct=post_layer_fct,
|
|
253
|
+
post_act_fct=post_act_fct,
|
|
254
|
+
allow_broadcast=self.allow_broadcast,
|
|
255
|
+
use_cuda=self.use_cuda,
|
|
256
|
+
)
|
|
244
257
|
|
|
245
258
|
self.decoder_concentrate = MLP(
|
|
246
259
|
[self.latent_dim] + self.decoder_hidden_layers + [self.input_size],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
SURE/PerturbFlow.py,sha256=
|
|
2
|
-
SURE/SURE.py,sha256=
|
|
1
|
+
SURE/PerturbFlow.py,sha256=BoaNDubCKpsYJcwipZxrSCpol4nVvCttP28MizHffzY,51650
|
|
2
|
+
SURE/SURE.py,sha256=ghagk4vO3xrAXwdyYTIv7y0X2KXr1R2baXH8lqvUl7k,48094
|
|
3
3
|
SURE/__init__.py,sha256=NOJI_K-eCqPgStXXvgl3wIEMp6d8saMTDYLJ7Ga9MqE,293
|
|
4
4
|
SURE/assembly/__init__.py,sha256=jxZLURXKPzXe21LhrZ09LgZr33iqdjlQy4oSEj5gR2Q,172
|
|
5
5
|
SURE/assembly/assembly.py,sha256=6IMdelPOiRO4mUb4dC7gVCoF1Uvfw86-Map8P_jnUag,21477
|
|
@@ -17,9 +17,9 @@ SURE/utils/__init__.py,sha256=QJUOfrXzdWSmoM0P3LH8oKEHttzCWqpDy2UF0F0dtN4,673
|
|
|
17
17
|
SURE/utils/custom_mlp.py,sha256=rHnx9jEef02zfCUdbYVCmbuHcDdIBmRgt__wpdpZvYg,8104
|
|
18
18
|
SURE/utils/queue.py,sha256=E_5PA5EWcBoGAZj8BkKQnkCK0p4C-4-xcTPqdIXaPXU,1892
|
|
19
19
|
SURE/utils/utils.py,sha256=IUHjDDtYaAYllCWsZyIzqQwaLul6fJRvHRH4vIYcR-c,8462
|
|
20
|
-
sure_tools-2.1.
|
|
21
|
-
sure_tools-2.1.
|
|
22
|
-
sure_tools-2.1.
|
|
23
|
-
sure_tools-2.1.
|
|
24
|
-
sure_tools-2.1.
|
|
25
|
-
sure_tools-2.1.
|
|
20
|
+
sure_tools-2.1.32.dist-info/licenses/LICENSE,sha256=TFHKwmrAViXQbSX5W-NDItkWFjm45HWOeUniDrqmnu0,1065
|
|
21
|
+
sure_tools-2.1.32.dist-info/METADATA,sha256=MdjeArB0rKjnH3MbWPA51badwykP2QQHvM3iAYldQFk,2651
|
|
22
|
+
sure_tools-2.1.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
+
sure_tools-2.1.32.dist-info/entry_points.txt,sha256=-nJI8rVe_qqrR0HmfAODzj-JNfEqCcSsyVh6okSqyHk,83
|
|
24
|
+
sure_tools-2.1.32.dist-info/top_level.txt,sha256=BtFTebdiJeqra4r6mm-uEtwVRFLZ_IjYsQ7OnalrOvY,5
|
|
25
|
+
sure_tools-2.1.32.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|