pretrain
¶
pretrain
¶
pretrain(
adata_list: List[AnnData],
n_epochs: int = 100,
patch_size: Optional[int] = None,
batch_size: int = 128,
learning_rate: float = 0.0001,
GPU: Union[bool, str] = True,
random_state: int = None,
weight_dir: Optional[str] = None,
)
Pretrain STANDS basic extractors using spatial data. After the completion of pre-training, the weights will be automatically saved.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata_list |
List[AnnData]
|
input spatial data (to be trained). |
required |
n_epochs |
int
|
Number of training epochs. |
100
|
patch_size |
Optional[int]
|
Patch size for H&E images. |
None
|
batch_size |
int
|
Batch size for training. |
128
|
learning_rate |
float
|
Learning rate for the optimizer. |
0.0001
|
GPU |
Union[bool, str]
|
Whether to use GPU for training, and GPU ID (i.e., cuda:0) |
True
|
random_state |
int
|
Random seed for reproducibility. |
None
|
weight_dir |
Optional[str]
|
Directory path to save the pretrained model weights. |
None
|