torch.distributions.greater_than_eq
function greater_than_eq(lower_bound: number): _GreaterThanCreates a constraint for values greater than or equal to a lower bound.
Returns a constraint that validates whether tensor values satisfy x >= lower_bound. Similar to greater_than but includes the boundary value. Useful for:
- Distribution parameters that can equal zero (e.g., some concentration parameters)
- Non-negative value constraints
- Parameter validation in distributions allowing boundary values
- Inclusive range constraints
- Inclusive boundary: Uses = (includes the boundary value)
- Closed interval: Defines constraint for interval [lower_bound, ∞)
- Boundary-inclusive: Allows values equal to lower_bound (differs from greater_than)
Parameters
lower_boundnumber- The lower bound value (values must be = this)
Returns
_GreaterThan– A constraint object that validates x = lower_boundExamples
const nonnegative = torch.distributions.constraints.greater_than_eq(0);
const weights = torch.tensor([0, 0.5, 1.0]);
nonnegative.check(weights); // Validates all values >= 0
// Zero is allowed with this constraint
const zero = torch.tensor([0]);
nonnegative.check(zero); // Returns true (unlike greater_than)See Also
- PyTorch torch.distributions.constraints.greater_than_eq()
- greater_than - Strictly greater than (excludes boundary)
- interval - Two-sided interval constraint
- constraints - Other available constraints