SURE-tools 2.1.21__py3-none-any.whl → 2.1.24__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 CHANGED
@@ -196,7 +196,7 @@ class PerturbFlow(nn.Module):
196
196
  if self.cell_factor_size>0:
197
197
  self.cell_factor_effect = nn.ModuleList()
198
198
  for i in np.arange(self.cell_factor_size):
199
- self.cell_factor_effect.append(MLP(
199
+ self.cell_factor_effect.append(ZeroBiasMLP(
200
200
  [self.latent_dim+1] + hidden_sizes + [self.latent_dim],
201
201
  activation=activate_fct,
202
202
  output_activation=None,
SURE/SURE.py CHANGED
@@ -10,7 +10,7 @@ from torch.distributions.utils import logits_to_probs, probs_to_logits, clamp_pr
10
10
  from torch.distributions import constraints
11
11
  from torch.distributions.transforms import SoftmaxTransform
12
12
 
13
- from .utils.custom_mlp import MLP, Exp
13
+ from .utils.custom_mlp import MLP, Exp, ZeroBiasMLP
14
14
  from .utils.utils import CustomDataset, CustomDataset2, CustomDataset4, tensor_to_numpy, convert_to_tensor
15
15
 
16
16
 
@@ -232,7 +232,7 @@ class SURE(nn.Module):
232
232
  )
233
233
 
234
234
  if self.cell_factor_size>0:
235
- self.cell_factor_effect = MLP(
235
+ self.cell_factor_effect = ZeroBiasMLP(
236
236
  [self.latent_dim + self.cell_factor_size] + self.decoder_hidden_layers + [self.latent_dim],
237
237
  activation=activate_fct,
238
238
  output_activation=None,
SURE/utils/custom_mlp.py CHANGED
@@ -212,3 +212,33 @@ class MLP(nn.Module):
212
212
 
213
213
 
214
214
 
215
+
216
+ class ZeroBiasMLP(nn.Module):
217
+ def __init__(
218
+ self,
219
+ mlp_sizes,
220
+ activation=nn.ReLU,
221
+ output_activation=None,
222
+ post_layer_fct=lambda layer_ix, total_layers, layer: None,
223
+ post_act_fct=lambda layer_ix, total_layers, layer: None,
224
+ allow_broadcast=False,
225
+ use_cuda=False,
226
+ ):
227
+ # init the module object
228
+ super().__init__()
229
+ self.mlp = MLP(mlp_sizes=mlp_sizes,
230
+ activation=activation,
231
+ output_activation=output_activation,
232
+ post_layer_fct=post_layer_fct,
233
+ post_act_fct=post_act_fct,
234
+ allow_broadcast=allow_broadcast,
235
+ use_cuda=use_cuda,
236
+ bias=False)
237
+
238
+ # pass through our sequential for the output!
239
+ def forward(self, x):
240
+ y = self.mlp(x)
241
+ mask = torch.zeros_like(y)
242
+ mask[x[1][:,0]>0,:] = 1
243
+ return y*mask
244
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SURE-tools
3
- Version: 2.1.21
3
+ Version: 2.1.24
4
4
  Summary: Succinct Representation of Single Cells
5
5
  Home-page: https://github.com/ZengFLab/SURE
6
6
  Author: Feng Zeng
@@ -1,6 +1,5 @@
1
- SURE/PerturbFlow.py,sha256=P5YebRbhyEIueyStdaMkFvLq43MJSBCcYd-pI09eTBQ,50938
2
- SURE/SURE.py,sha256=xMD6VBYsgk-bZ_xBWzpdGyxEAleonNRoPkZAxAX467s,47444
3
- SURE/SURE2.py,sha256=8wlnMwb1xuf9QUksNkWdWx5ZWq-xIy9NLx8RdUnE82o,48501
1
+ SURE/PerturbFlow.py,sha256=gHrIHTAmFsG3FwS1ov7K3KwRMS0aw_IFQM-3HDIWnaA,50946
2
+ SURE/SURE.py,sha256=AxYfuR86I4w3_pUQp--GmqKbWXeF6SaffP1yikN3M2k,47465
4
3
  SURE/__init__.py,sha256=NOJI_K-eCqPgStXXvgl3wIEMp6d8saMTDYLJ7Ga9MqE,293
5
4
  SURE/assembly/__init__.py,sha256=jxZLURXKPzXe21LhrZ09LgZr33iqdjlQy4oSEj5gR2Q,172
6
5
  SURE/assembly/assembly.py,sha256=6IMdelPOiRO4mUb4dC7gVCoF1Uvfw86-Map8P_jnUag,21477
@@ -12,16 +11,15 @@ SURE/codebook/codebook.py,sha256=ZlN6gRX9Gj2D2u3P5KeOsbZri0MoMAiJo9lNeL-MK-I,171
12
11
  SURE/flow/__init__.py,sha256=rsAjYsh1xVIrxBCuwOE0Q_6N5th1wBgjJceV0ABPG3c,183
13
12
  SURE/flow/flow_stats.py,sha256=3F3waCuEbIQ7bsiGga4cUvJphYdWA307SyGwEh8EzM8,10514
14
13
  SURE/flow/plot_quiver.py,sha256=wC42yLKfXYOGrrd4u9AbZS_6QiPUJ9QBXaOso55LjdA,8110
15
- SURE/flow/quiver.py,sha256=_euFqSaRrDoZ_oOabOx20LOoUTJ__XPhLW-vzLNQfAo,1859
16
14
  SURE/perturb/__init__.py,sha256=ouxShhbxZM4r5Gf7GmKiutrsmtyq7QL8rHjhgF0BU08,32
17
15
  SURE/perturb/perturb.py,sha256=CqO3xPfNA3cG175tadDidKvGsTu_yKfJRRLn_93awKM,3303
18
16
  SURE/utils/__init__.py,sha256=Htqv4KqVKcRiaaTBsR-6yZ4LSlbhbzutjNKXGD9-uds,660
19
- SURE/utils/custom_mlp.py,sha256=IlW5L_YEhtn0guHlGyvGLRjJ5JOIWs4qB7BPi1Dmq9U,7116
17
+ SURE/utils/custom_mlp.py,sha256=PCnXhJdK_g6z51JJqCdrNGBoOU_SjN5XYAOhB_2BxNo,8105
20
18
  SURE/utils/queue.py,sha256=E_5PA5EWcBoGAZj8BkKQnkCK0p4C-4-xcTPqdIXaPXU,1892
21
19
  SURE/utils/utils.py,sha256=IUHjDDtYaAYllCWsZyIzqQwaLul6fJRvHRH4vIYcR-c,8462
22
- sure_tools-2.1.21.dist-info/licenses/LICENSE,sha256=TFHKwmrAViXQbSX5W-NDItkWFjm45HWOeUniDrqmnu0,1065
23
- sure_tools-2.1.21.dist-info/METADATA,sha256=5pPz0o1rpF7udNtmSfrCFE14qcuhl-86De2HkA_fUww,2651
24
- sure_tools-2.1.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- sure_tools-2.1.21.dist-info/entry_points.txt,sha256=-nJI8rVe_qqrR0HmfAODzj-JNfEqCcSsyVh6okSqyHk,83
26
- sure_tools-2.1.21.dist-info/top_level.txt,sha256=BtFTebdiJeqra4r6mm-uEtwVRFLZ_IjYsQ7OnalrOvY,5
27
- sure_tools-2.1.21.dist-info/RECORD,,
20
+ sure_tools-2.1.24.dist-info/licenses/LICENSE,sha256=TFHKwmrAViXQbSX5W-NDItkWFjm45HWOeUniDrqmnu0,1065
21
+ sure_tools-2.1.24.dist-info/METADATA,sha256=Tv1Ta5sY6IpoQvgJ8tc8vNCqosV8_DX13WN5VYLRuTo,2651
22
+ sure_tools-2.1.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ sure_tools-2.1.24.dist-info/entry_points.txt,sha256=-nJI8rVe_qqrR0HmfAODzj-JNfEqCcSsyVh6okSqyHk,83
24
+ sure_tools-2.1.24.dist-info/top_level.txt,sha256=BtFTebdiJeqra4r6mm-uEtwVRFLZ_IjYsQ7OnalrOvY,5
25
+ sure_tools-2.1.24.dist-info/RECORD,,