NullRegularizer#
- class fl_sim.regularizers.NullRegularizer(coeff: float = 1.0)[source]#
Bases:
Regularizer
Null regularizer, or equivalently the zero function.
- Parameters:
coeff (float, default 1.0) – The coefficient of the regularizer.
- eval(params: Iterable[Parameter], coeff: float | None = None) float [source]#
Evaluate the regularizer on the given parameters.
- Parameters:
params (Iterable[torch.nn.parameter.Parameter]) – The parameters to be evaluated on.
coeff (float, optional) – The coefficient of the regularizer. If None, use the default value.
- prox_eval(params: Iterable[Parameter], coeff: float | None = None) Iterable[Parameter] [source]#
Evaluate the proximity operator of the regularizer on the given parameters.
i.e. evaluate the following function:
\[\mathrm{prox}_{\lambda R}(\mathbf{w}) = \arg\min_{\mathbf{u}} \frac{1}{2s} \lVert \mathbf{u} - \mathbf{w} \rVert_2^2 + \lambda R(\mathbf{u})\]where \(R\) is the regularizer.
- Parameters:
params (Iterable[torch.nn.parameter.Parameter]) – The parameters to be evaluated on.
coeff (float, optional) – The coefficient of the regularizer. If None, use the default value.
- Returns:
The proximity operator of the regularizer evaluated on the given parameters.
- Return type:
Iterable[torch.nn.parameter.Parameter]