train

deepinv.train(model: ~torch.nn.modules.module.Module, physics: ~deepinv.physics.forward.Physics, optimizer: ~torch.optim.optimizer.Optimizer, train_dataloader: ~torch.utils.data.dataloader.DataLoader, epochs: int = 100, losses: ~deepinv.loss.loss.Loss | ~typing.List[~deepinv.loss.loss.Loss] = SupLoss(   (metric): MSELoss() ), eval_dataloader: ~torch.utils.data.dataloader.DataLoader | None = None, *args, **kwargs)[source]

Alias function for training a model using deepinv.Trainer class.

This function creates a Trainer instance and returns the trained model.

Warning

This function is deprecated and will be removed in future versions. Please use deepinv.Trainer instead.

Parameters:
Returns:

Trained model.