mlcolvar.core.loss.ReduceEigenvaluesLoss¶
- class mlcolvar.core.loss.ReduceEigenvaluesLoss(mode: str = 'sum', n_eig: int = 0, invert_sign: bool = True)[source]¶
Bases:
ModuleCalculate a monotonic function f(x) of the eigenvalues, by default the sum.
By default it returns -f(x) to be used as loss function to maximize eigenvalues in gradient descent schemes.
- The following reduce functions are implemented:
sum : sum_i (lambda_i)
sum2 : sum_i (lambda_i)**2
gap : (lambda_1-lambda_2)
its : sum_i (1/log(lambda_i))
single : (lambda_i)
single2 : (lambda_i)**2
- __init__(mode: str = 'sum', n_eig: int = 0, invert_sign: bool = True)[source]¶
Constructor.
- Parameters:
mode (str, optional) – Function of the eigenvalues to optimize (see notes). Default is
'sum'.n_eig (int, optional) – Number of eigenvalues to include in the loss (default: 0 –> all). In case of
'single'and'single2'is used to specify which eigenvalue to use.invert_sign (bool, optional) – Whether to return the opposite of the function (in order to be minimized with GD methods). Default is
True.
Methods
Attributes
T_destination
call_super_init
dump_patches
training