SURE-tools 2.2.19__py3-none-any.whl → 2.3.2__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/__init__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  from .SURE import SURE
2
2
  from .DensityFlow import DensityFlow
3
+ from .PerturbE import PerturbE
3
4
 
4
5
  from . import utils
5
6
  from . import codebook
@@ -9,4 +10,4 @@ from . import atac
9
10
  from . import flow
10
11
  from . import perturb
11
12
 
12
- __all__ = ['SURE', 'DensityFlow', 'flow', 'perturb', 'atac', 'utils', 'codebook']
13
+ __all__ = ['SURE', 'DensityFlow', 'PerturbE', 'flow', 'perturb', 'atac', 'utils', 'codebook']
SURE/utils/custom_mlp.py CHANGED
@@ -240,12 +240,49 @@ class ZeroBiasMLP(nn.Module):
240
240
  y = self.mlp(x)
241
241
  mask = torch.zeros_like(y)
242
242
  if len(y.shape)==2:
243
- mask[x[1][:,0]>0,:] = 1
243
+ if type(x)==list:
244
+ mask[x[1][:,0]>0,:] = 1
245
+ else:
246
+ mask[x[:,0]>0,:] = 1
244
247
  elif len(y.shape)==3:
245
- mask[:,x[1][:,0]>0,:] = 1
248
+ if type(x)==list:
249
+ mask[:,x[1][:,0]>0,:] = 1
250
+ else:
251
+ mask[:,x[:,0]>0,:] = 1
246
252
  return y*mask
247
253
 
248
254
 
255
+
256
+ class ZeroBiasMLP2(nn.Module):
257
+ def __init__(
258
+ self,
259
+ mlp_sizes,
260
+ activation=nn.ReLU,
261
+ output_activation=None,
262
+ post_layer_fct=lambda layer_ix, total_layers, layer: None,
263
+ post_act_fct=lambda layer_ix, total_layers, layer: None,
264
+ allow_broadcast=False,
265
+ use_cuda=False,
266
+ ):
267
+ # init the module object
268
+ super().__init__()
269
+ self.mlp = MLP(mlp_sizes=mlp_sizes,
270
+ activation=activation,
271
+ output_activation=output_activation,
272
+ post_layer_fct=post_layer_fct,
273
+ post_act_fct=post_act_fct,
274
+ allow_broadcast=allow_broadcast,
275
+ use_cuda=use_cuda,
276
+ bias=True)
277
+
278
+ # pass through our sequential for the output!
279
+ def forward(self, x):
280
+ y = self.mlp(x)
281
+ mask = torch.zeros_like(y)
282
+ x_sum = torch.sum(x, dim=1)
283
+ mask[x_sum>0,:] = 1
284
+ return y*mask
285
+
249
286
  class HDMLP(nn.Module):
250
287
  def __init__(
251
288
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SURE-tools
3
- Version: 2.2.19
3
+ Version: 2.3.2
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,7 @@
1
- SURE/DensityFlow.py,sha256=FQ5LT-5xo_O3Qa5I0hxYBMq8f7HvapxfwTQj-oc3iyI,56086
1
+ SURE/DensityFlow.py,sha256=YvaE9aPbAC2U7WhTye5i2AMtcw0BI_qS3gv9SP4aE0k,56676
2
+ SURE/PerturbE.py,sha256=nomWc8nl4WkihhaITsAVXc-wTp1OTXfypQYP4kTz7JQ,51685
2
3
  SURE/SURE.py,sha256=MXs7iuvcj-lU4dJ_MwKegpL2Rqk2HB4eFfAgHRA3RtA,47744
3
- SURE/__init__.py,sha256=NVp22RCHrhSwHNMomABC-eftoCYvt7vV1XOzim-UZHE,293
4
+ SURE/__init__.py,sha256=Q6J9HwAMxI42Boj8QCVbIDTAr0YyLY9Qj2ewTkM0uUw,336
4
5
  SURE/assembly/__init__.py,sha256=jxZLURXKPzXe21LhrZ09LgZr33iqdjlQy4oSEj5gR2Q,172
5
6
  SURE/assembly/assembly.py,sha256=6IMdelPOiRO4mUb4dC7gVCoF1Uvfw86-Map8P_jnUag,21477
6
7
  SURE/assembly/atlas.py,sha256=ALjmVWutm_tOHTcT1aqOxmuCEQw-XzrtDoMCV_8oXLk,21794
@@ -14,12 +15,12 @@ SURE/flow/plot_quiver.py,sha256=UbmuScUcgbQHeMmjKmgqxjrIjHhiHx0VWct16UMMwuE,8110
14
15
  SURE/perturb/__init__.py,sha256=8TP1dSUhXiZzKpFebHZmm8XMMGbUz_OfQ10xu-6uPPY,43
15
16
  SURE/perturb/perturb.py,sha256=ey7cxsM1tO1MW4UaE_MLpLHK87CjvXzn2CBPtvv1VZ0,6116
16
17
  SURE/utils/__init__.py,sha256=YF5jB-PAHJQ40OlcZ7BCZbsN2q1JKuPT6EppilRXQqM,680
17
- SURE/utils/custom_mlp.py,sha256=HuNb7f8-6RFjsvfEu1XOuNpLrHZkGYHgf8TpJfPSNO0,9382
18
+ SURE/utils/custom_mlp.py,sha256=Rn_PQouxPMSda-KKBYrwVVv3GFFuUmCLxp8cV5LszZo,10580
18
19
  SURE/utils/queue.py,sha256=E_5PA5EWcBoGAZj8BkKQnkCK0p4C-4-xcTPqdIXaPXU,1892
19
20
  SURE/utils/utils.py,sha256=IUHjDDtYaAYllCWsZyIzqQwaLul6fJRvHRH4vIYcR-c,8462
20
- sure_tools-2.2.19.dist-info/licenses/LICENSE,sha256=TFHKwmrAViXQbSX5W-NDItkWFjm45HWOeUniDrqmnu0,1065
21
- sure_tools-2.2.19.dist-info/METADATA,sha256=F2Obio0gRQMcBdPPcsyS8MhNnsy2J0px2twO4XlPtys,2678
22
- sure_tools-2.2.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- sure_tools-2.2.19.dist-info/entry_points.txt,sha256=-nJI8rVe_qqrR0HmfAODzj-JNfEqCcSsyVh6okSqyHk,83
24
- sure_tools-2.2.19.dist-info/top_level.txt,sha256=BtFTebdiJeqra4r6mm-uEtwVRFLZ_IjYsQ7OnalrOvY,5
25
- sure_tools-2.2.19.dist-info/RECORD,,
21
+ sure_tools-2.3.2.dist-info/licenses/LICENSE,sha256=TFHKwmrAViXQbSX5W-NDItkWFjm45HWOeUniDrqmnu0,1065
22
+ sure_tools-2.3.2.dist-info/METADATA,sha256=NDI2_X4N1FIZkNSBdksNPATk-XtSAxUJJs7Hlx3OTSI,2677
23
+ sure_tools-2.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ sure_tools-2.3.2.dist-info/entry_points.txt,sha256=-nJI8rVe_qqrR0HmfAODzj-JNfEqCcSsyVh6okSqyHk,83
25
+ sure_tools-2.3.2.dist-info/top_level.txt,sha256=BtFTebdiJeqra4r6mm-uEtwVRFLZ_IjYsQ7OnalrOvY,5
26
+ sure_tools-2.3.2.dist-info/RECORD,,