Module ml4opf.layers.hypersimplex_repair
Differentiable repair layer for the hyper-simplex constraint, ∑x=X, x̲≤x≤x̅.
Classes
class HyperSimplexRepair (xmin: torch.Tensor | None = None,
xmax: torch.Tensor | None = None,
X: torch.Tensor | None = None)-
Repair layer for the hyper-simplex constraint ∑x=X, x̲≤x≤x̅.
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Ancestors
- torch.nn.modules.module.Module
Methods
def forward(self,
x: torch.Tensor,
xmin: torch.Tensor | None = None,
xmax: torch.Tensor | None = None,
X: torch.Tensor | None = None) ‑> Callable[..., Any]-
Project onto ∑x=X, x̲≤x≤x̅