peal.training.criterions.mixed_bce_mse_criterion

peal.training.criterions.mixed_bce_mse_criterion(model, y_pred, y_target, latent_code=None)[source]

BCE on the discrete outputs plus weighted MSE on the continuous ones.

Output columns before model.config.data.output_split are logits of binary attributes and are scored with BCEWithLogitsLoss(pos_weight=model.config.task.mixed_bce_pos_weight); the remaining columns are regression targets scored with MSE and weighted by model.config.task.bce_mse_mix.

Returns:

Scalar loss.

Return type:

torch.Tensor