Commit 3c58850 1 parent 135a7f8 commit 3c58850 Copy full SHA for 3c58850
File tree 2 files changed +15
-8
lines changed
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -110,15 +110,21 @@ def _init_dataset(self):
110
110
111
111
def __len__ (self ) -> int :
112
112
if self .sample_cells is not None :
113
- return min (self .sample_cells , len ( self .shuffled_obs_ilocs ) )
113
+ return min (self .sample_cells , self .n_obs )
114
114
115
115
if self .training :
116
- n_obs = len (self .shuffled_obs_ilocs )
117
- return min (n_obs , max (Nums .MIN_DATASET_LENGTH , int (n_obs * Nums .MAX_DATASET_LENGTH_RATIO )))
116
+ return self ._clipped_dataset_length ()
118
117
119
118
assert self .single_adata , "Multi-adata mode not supported for inference"
120
119
121
- return len (self .obs_ilocs )
120
+ return self .n_obs
121
+
122
+ @property
123
+ def n_obs (self ):
124
+ return sum (adata .n_obs for adata in self .adatas )
125
+
126
+ def _clipped_dataset_length (self ) -> int :
127
+ return min (self .n_obs , max (Nums .MIN_DATASET_LENGTH , int (self .n_obs * Nums .MAX_DATASET_LENGTH_RATIO )))
122
128
123
129
def __getitem__ (self , index : int ) -> dict [str , Data ]:
124
130
"""Gets a sample from the dataset, with one "main" graph and its corresponding "view" graph (only during training).
Original file line number Diff line number Diff line change 6
6
import novae
7
7
from novae ._constants import Nums
8
8
9
- Nums .WARMUP_EPOCHS = 4
10
- Nums .WARMUP_ILOCS = 7
9
+ Nums .WARMUP_EPOCHS = 3
10
+ Nums .WARMUP_ILOCS = 6
11
11
Nums .LEVEL_SUBSELECT = 10
12
12
13
- suffix = "_sub_select11 "
13
+ suffix = "_sub_select12 "
14
14
15
15
path = Path ("/gpfs/workdir/blampeyq/novae/data/_lung_robustness" )
16
16
41
41
# model.fine_tune(adatas, min_prototypes_ratio=0.5, reference="largest")
42
42
# model.compute_representations(adatas)
43
43
44
- obs_key = model .assign_domains (adatas , level = 7 )
44
+ # obs_key = model.assign_domains(adatas, level=7)
45
+ obs_key = model .assign_domains (adatas )
45
46
46
47
model .plot_prototype_weights ()
47
48
plt .savefig (path / f"prototype_weights{ suffix } .pdf" , bbox_inches = "tight" )
You can’t perform that action at this time.
0 commit comments