mlcolvar.core.loss.FisherDiscriminantLoss¶
- class mlcolvar.core.loss.FisherDiscriminantLoss(n_states: int, lda_mode: str = 'standard', reduce_mode: str = 'sum', lorentzian_reg: float | None = None, invert_sign: bool = True)[source]¶
Bases:
ModuleFisher’s discriminant ratio.
Computes the sum (or another reducing functions) of the eigenvalues of the ratio between the Fisher’s scatter matrices. This is the same loss function used in
DeepLDA.- __init__(n_states: int, lda_mode: str = 'standard', reduce_mode: str = 'sum', lorentzian_reg: float | None = None, invert_sign: bool = True)[source]¶
Constructor.
- Parameters:
n_states (int) – The number of states. Labels are in the range
[0, n_states-1].lda_mode (str) – Either
'standard'or'harmonic'. This determines how the scatter matrices are computed (see alsoLDA). The default is'standard'.reduce_mode (str) – This determines how the eigenvalues are reduced, e.g.,
sum,sum2(see alsoReduceEigenvaluesLoss). The default is'sum'.lorentzian_reg (float, optional) – The magnitude of the regularization for Lorentzian regularization. If not provided, this is automatically set.
invert_sign (bool, optional) – Whether to return the negative Fisher’s discriminant ratio in order to be minimized with gradient descent methods. Default is
True.
Methods
Attributes
T_destination
call_super_init
dump_patches
training