- class usencrypt.ai.regularizers.Regularizer#
Base class for regularizers.
Regularizer objects introduce penalties to a model’s cost function. This is done by applying them on desired layers using their
This is a base class and it is not intended to be called directly. Users are expected to instantiate each of its subclasses directly.
- Available regularizers
In the case of L2 regularization, the penalty can be passed into supported layers (e.g.,
usencrypt.ai.nn.layers.FCLayer) as either a
bias_regularizerargument, as follows:
>>> import usencrypt as ue >>> l2_reg = ue.ai.regularizers.L2() >>> layer = ue.ai.nn.layers.FCLayer(3, 4, weight_regularizer=l2_reg)