cristal.helper_classes.regularizer module#

Regularization methods for score functions.

class cristal.helper_classes.regularizer.CombRegularizer#

Bases: BaseRegularizer

Regularizer for the combinatorial regularization method : \(reg = \begin{pmatrix} d + n \\ d \end{pmatrix}\).

static regularizer(n, d, C)#

Compute the combinatorial regularization factor.

Return type:

float

class cristal.helper_classes.regularizer.ConstantRegularizer#

Bases: BaseRegularizer

Regularizer that applies a constant factor C : : \(reg = C\).

static regularizer(n, d, C)#

Compute the constant regularization factor.

Return type:

float

class cristal.helper_classes.regularizer.IMPLEMENTED_REGULARIZATION_OPTIONS(*values)#

Bases: Enum

The implemented regularization classes.

COMB = <class 'cristal.helper_classes.regularizer.CombRegularizer'>#
CONSTANT = <class 'cristal.helper_classes.regularizer.ConstantRegularizer'>#
VU = <class 'cristal.helper_classes.regularizer.VuRegularizer'>#
VU_C = <class 'cristal.helper_classes.regularizer.VuCRegularizer'>#
class cristal.helper_classes.regularizer.VuCRegularizer#

Bases: BaseRegularizer

Regularizer for the Vu_C regularization method : \(reg = \frac{n^{3d/2}}{C}\).

See https://arxiv.org/abs/1910.14458 for more details.

static regularizer(n, d, C)#

Compute the Vu_C regularization factor.

Return type:

float

class cristal.helper_classes.regularizer.VuRegularizer#

Bases: BaseRegularizer

Regularizer for the Vu regularization method : \(reg = n^{3d/2}\).

See https://arxiv.org/abs/1910.14458 for more details.

static regularizer(n, d, C)#

Compute the Vu regularization factor.

Return type:

float