Skip to content

Commit 5915c75

Browse files
add model template
1 parent 5c9fea0 commit 5915c75

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

benchmark/domains/setup.py

Whitespace-only changes.
File renamed without changes.

benchmark/template.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import numpy as np
2+
from anndata import AnnData
3+
4+
VALID_MODEL_NAMES = ["STAGATE", "SEDR", "GraphST", "SpaceFlow"]
5+
6+
7+
class Model:
8+
def __init__(self, model_name: str, hidden_dim: int) -> None:
9+
super().__init__()
10+
assert model_name in VALID_MODEL_NAMES
11+
12+
self.model_name = model_name
13+
self.hidden_dim = hidden_dim
14+
15+
self.build_model()
16+
17+
def build_model(self) -> None:
18+
raise NotImplementedError
19+
20+
def train(self) -> None:
21+
raise NotImplementedError
22+
23+
def inference(adata: AnnData) -> np.ndarray:
24+
raise NotImplementedError
25+
26+
def __call__(self, adata: AnnData) -> np.ndarray:
27+
self.train()
28+
adata.obsm[self.model_name] = self.inference(adata)
29+
return adata.obsm[self.model_name]

install.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Install
22

3-
## SEDR
3+
## SEDR (Quentin)
44

55
[Github](https://github.com/JinmiaoChenLab/SEDR), [Docs](https://sedr.readthedocs.io/en/latest/Installation.html)
66

@@ -15,7 +15,7 @@ python setup.py build
1515
python setup.py.install
1616
```
1717

18-
## STAGATE
18+
## STAGATE (Quentin)
1919

2020
[Github](https://github.com/QIFEIDKN/STAGATE_pyG), [Docs](https://stagate.readthedocs.io/en/latest/Installation_pyG.html)
2121

@@ -30,7 +30,7 @@ python setup.py build
3030
python setup.py install
3131
```
3232

33-
## GraphST
33+
## GraphST ()
3434

3535
[Github](https://github.com/JinmiaoChenLab/GraphST), [Docs](https://deepst-tutorials.readthedocs.io/en/latest/)
3636

@@ -49,7 +49,7 @@ python setup.py build
4949
python setup.py install
5050
```
5151

52-
## SpaceFlow
52+
## SpaceFlow (Hakim)
5353

5454
[Github](https://github.com/hongleir/SpaceFlow), Docs
5555

0 commit comments

Comments
 (0)