cellflow.model.CellFlow.train¶
- CellFlow.train(num_iterations, batch_size=1024, valid_freq=1000, callbacks=[], monitor_metrics=[], out_of_core_dataloading=False)[source]¶
Train the model.
Note
A low value of
'valid_freq'results in long training because predictions are time-consuming compared to training steps.- Parameters:
num_iterations (
int) – Number of iterations to train the model.batch_size (
int) – Batch size.valid_freq (
int) – Frequency of validation.callbacks (
Sequence[BaseCallback]) –Callbacks to perform at each validation step. There are two types of callbacks: - Callbacks for computations should inherit from
ComputationCallbacksee e.g.cellflow.training.Metrics.Callbacks for logging should inherit from
LoggingCallbacksee e.g.WandbLogger.
out_of_core_dataloading (
bool) – IfTrue, use out-of-core dataloading. Uses thecellflow.data._dataloader.OOCTrainSamplerto load data that does not fit into GPU memory.
- Return type:
- Returns:
: Updates the following fields:
cellflow.model.CellFlow.dataloader- the training dataloader.cellflow.model.CellFlow.solver- the trained solver.