terminator.utils.model.loss_fn.construct_loss_fn

terminator.utils.model.loss_fn.construct_loss_fn(hparams)[source]

Construct a combined loss function based on the inputted hparams

Parameters:

hparams (dict) – The fully constructed hparams (see terminator/utils/model/default_hparams.py). It should contain an entry for ‘loss_config’ in the format {loss_fn_name : scaling_factor}. For example, .. code-block :

{

‘nlcpl’: 1, ‘etab_norm_penalty’: 0.01

}

Returns:

The constructed loss function

Return type:

_loss_fn