LInfNorm#
- class fl_sim.regularizers.LInfNorm(coeff: float = 1.0)[源代码]#
基类:
RegularizerL-infinity norm regularizer.
- 参数:
coeff (float, default 1.0) -- The coefficient of the regularizer.
- eval(params: Iterable[Parameter], coeff: float | None = None) float[源代码]#
Evaluate the regularizer on the given 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][源代码]#
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.
- 参数:
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.
- 返回:
The proximity operator of the regularizer evaluated on the given parameters.
- 返回类型:
Iterable[torch.nn.parameter.Parameter]