terminator.utils.model.loss_fn¶
Loss functions for TERMinator, and a customizable loss function constructor built from the included components.
In order to use the customizable loss function constructor construct_loss_fn, loss functions
must have the signature loss(etab, E_idx, data), where
lossis the name of the loss fn
etabis the outputted etab from TERMinator
E_idxis the edge index outputted from TERMinator
datais the training data dictionary
- Additionally, the function must return two outputs
loss_contribution, norm_count, where loss_contributionis the computed loss contribution by the functionnorm_countis a normalizing constant associated with the loss (e.g. when averaging across losses in batches,
the average loss will be \(\frac{\sum_i loss_contribution}{\sum_i norm_count}\))
Functions
|
Construct a combined loss function based on the inputted hparams |
|
Take the norm of all etabs and scale it by the total number of residues involved |
|
Take the norm of all etabs and scale it by the total number of residues involved |
|
Take the norm of all etabs and scale it by the total number of residues involved |
|
Negative log composite psuedo-likelihood Averaged nlcpl per residue, across batches p(a_i,m ; a_j,n) = softmax [ E_s(a_i,m) + E_s(a_j,n) + E_p(a_i,m ; a_j,n) + sum_(u != m,n) [ E_p(a_i,m; A_u) + E_p(A_u, a_j,n) ] ] |
|
Negative log composite psuedo-likelihood Averaged nlcpl per residue, across batches p(a_i,m ; a_j,n) = |
|
Alias of nlcpl_full |
|
Negative log psuedo-likelihood Returns negative log psuedolikelihoods per residue, with padding residues masked |
|
Return the ratio of the scaled norm of pair energies vs self energies in an etab |
|
Compute the mean squared error between the etab's predicted energies for peptide-protein complexes and experimental energies derived from SORTCERY. |