Source code for secml.ml.classifiers.regularizer.c_regularizer

"""
.. module:: CRegularizer
   :synopsis: Interface for Regularizer Functions

.. moduleauthor:: Marco Melis <marco.melis@unica.it>
.. moduleauthor:: Ambra Demontis <ambra.demontis@unica.it>

"""
from abc import ABCMeta, abstractmethod

from secml.core import CCreator


[docs]class CRegularizer(CCreator, metaclass=ABCMeta): """Abstract class that defines basic methods for regularizer functions.""" __super__ = 'CRegularizer'
[docs] @abstractmethod def regularizer(self, *args, **kwargs): """Gets value of regularizer.""" raise NotImplementedError()
[docs] def dregularizer(self, *args, **kwargs): """Gets the derivative of regularizer.""" raise NotImplementedError()