Skip to content

L2 regularization for constant optimization #23

@Smantii

Description

@Smantii

Hi,

is there a way to penalize the magnitude of the constants (via, e.g., L2 regularization)? I am trying to fit a SymbolicRegressor with some noisy data and sometimes I get very large values for some constants.
I looked inside the library and it seems that it is possible to choose, as constant optimizer, adamax and amsgrad:

def __init_sgd_update_rule(self):
        if self.sgd_update_rule == 'constant':
            return op.ConstantUpdateRule(0, self.sgd_learning_rate)
        elif self.sgd_update_rule == 'momentum':
            return op.MomentumUpdateRule(0, self.sgd_learning_rate, self.sgd_beta)
        elif self.sgd_update_rule == 'rmsprop':
            return op.RmsPropUpdateRule(0, self.sgd_learning_rate, self.sgd_beta, self.sgd_epsilon)
        elif self.sgd_update_rule == 'adamax':
            return op.AdaMaxUpdateRule(0, self.sgd_learning_rate, self.sgd_beta, self.sgd_beta2)
        elif self.sgd_update_rule == 'amsgrad':
            return op.AmsGradUpdateRule(0, self.sgd_learning_rate, self.sgd_epsilon, self.sgd_beta, self.sgd_beta2)

        raise ValueError('Unknown update rule {}'.format(self.sgd_update_rule))

In the pytorch implementation of these optimizers there is a parameter weight_decay for the $L^2$ regularization and I was guessing if it is possible to do so also for pyoperon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions