torchcell.trainers.int_hetero_cell.DiffusionRegressionTask
- class DiffusionRegressionTask(model: Module, cell_graph: Tensor, optimizer_config: dict[str, Any], lr_scheduler_config: dict[str, Any] | None, batch_size: int | None = None, clip_grad_norm: bool = False, clip_grad_norm_max_norm: float = 0.1, plot_sample_ceiling: int = 1000, plot_every_n_epochs: int = 10, loss_func: Module | None = None, grad_accumulation_schedule: dict[Any, int] | None = None, device: str = 'cuda', inverse_transform: Module | None = None, execution_mode: str = 'training')[source]
Bases:
RegressionTaskRegressionTaskfor a diffusion decoder (006hetero_cell_bipartite_dango_diff_gi).loss_funcmust be aDiffusionLoss(or None for evaluation only): any other loss would train on the placeholders. Two differences, both from the model’s contract: in training modeGeneInteractionDiffreturns all-zero placeholders instead of predictions (its diffusion loss trains the decoder from the targets andz_p), so train-stage predictions are not scored; and validation and test score the MSE of the sampled predictions, logged as{stage}/inference_mse, instead of calling the diffusion loss, which ignores the predictions.train/avg_diffusion_lossandval/avg_inference_mseare the epoch means of those per-batch losses.