geneflowdecoder 0.1.3__tar.gz → 0.1.4__tar.gz
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.
- {geneflowdecoder-0.1.3/src/geneflowdecoder.egg-info → geneflowdecoder-0.1.4}/PKG-INFO +1 -1
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/pyproject.toml +1 -1
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder/_core.py +13 -5
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder/_version.py +1 -1
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4/src/geneflowdecoder.egg-info}/PKG-INFO +1 -1
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/LICENSE +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/README.md +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/setup.cfg +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder/__init__.py +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder.egg-info/SOURCES.txt +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder.egg-info/dependency_links.txt +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder.egg-info/requires.txt +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder.egg-info/top_level.txt +0 -0
- {geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/tests/test_api.py +0 -0
|
@@ -393,11 +393,19 @@ class GeneFlowDecoder(nn.Module):
|
|
|
393
393
|
if self.freeze_z:
|
|
394
394
|
z = z.detach()
|
|
395
395
|
B, G = x_t.shape
|
|
396
|
-
t_emb = self.time_mlp(self._sincos(t)).unsqueeze(1)
|
|
397
|
-
gids = self._gene_ids[:G].unsqueeze(0).expand(B, -1)
|
|
398
|
-
h = self.backbone(gids, z) + t_emb
|
|
399
|
-
|
|
400
|
-
|
|
396
|
+
t_emb = self.time_mlp(self._sincos(t)).unsqueeze(1) # [B,1,d]
|
|
397
|
+
gids = self._gene_ids[:G].unsqueeze(0).expand(B, -1) # [B,G]
|
|
398
|
+
h = self.backbone(gids, z) + t_emb # [B,G,d]
|
|
399
|
+
|
|
400
|
+
# ★ 关键:只对特征维 d 做线性,结果天然是 [B, G]
|
|
401
|
+
v = self.vel_proj(h.squeeze(-2) if h.ndim == 2 else h) # [B,G,d]→[B,G]
|
|
402
|
+
if v.ndim == 3:
|
|
403
|
+
v = v.squeeze(-1) # [B,G,1]→[B,G]
|
|
404
|
+
if v.ndim != 2 or v.shape != (B, G):
|
|
405
|
+
raise RuntimeError(
|
|
406
|
+
f"_velocity shape bug: got {tuple(v.shape)}, expected ({B},{G}). "
|
|
407
|
+
f"检查 vel_proj 是否为 nn.Linear(d, 1) 而非 nn.Linear(d, n_genes)"
|
|
408
|
+
)
|
|
401
409
|
return v
|
|
402
410
|
|
|
403
411
|
# ----------------------------------------------------------------
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
__version__ = "0.1.
|
|
2
|
+
__version__ = "0.1.4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{geneflowdecoder-0.1.3 → geneflowdecoder-0.1.4}/src/geneflowdecoder.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|