Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cellflow/model/_cellflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ def train(
callbacks: Sequence[BaseCallback] = [],
monitor_metrics: Sequence[str] = [],
out_of_core_dataloading: bool = False,
seed: int = 0,
) -> None:
"""Train the model.

Expand Down Expand Up @@ -547,6 +548,8 @@ def train(
out_of_core_dataloading
If :obj:`True`, use out-of-core dataloading. Uses the :class:`cellflow.data._dataloader.OOCTrainSampler`
to load data that does not fit into GPU memory.
seed
Random seed, only used if `out_of_core_dataloading` is `True`.

Returns
-------
Expand All @@ -562,7 +565,7 @@ def train(
raise ValueError("Model not initialized. Please call `prepare_model` first.")

if out_of_core_dataloading:
self._dataloader = OOCTrainSampler(data=self.train_data, batch_size=batch_size)
self._dataloader = OOCTrainSampler(data=self.train_data, seed=seed, batch_size=batch_size)
else:
self._dataloader = TrainSampler(data=self.train_data, batch_size=batch_size)
validation_loaders = {k: ValidationSampler(v) for k, v in self.validation_data.items() if k != "predict_kwargs"}
Expand Down
Loading