Skip to content

Main content

HardSigmoid Linear Branch Preimage Tool

Invert only the open linear branch of clamp(slope*x+intercept,0,1).

Loading tool…

Description

Invert the linear branch as (output-intercept)/slope and return its two input breakpoints.

Hard sigmoid clamps slope*x+intercept into [0,1]. Only outputs strictly between the saturation limits belong to the invertible linear branch; saturated endpoint outputs correspond to rays rather than one finite inverse. Implementations can choose different slopes and intercepts.

Invert the linear branch as (output-intercept)/slope and return its two input breakpoints.

When to use this tool

Use HardSigmoid Linear Branch Preimage when checking the stated hard-sigmoid linear inverse convention.

How to use the tool and how it works

  1. Enter output, slope, intercept. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read input, branchLower, branchUpper. Use the output convention below.

Require slope>0 and output strictly between zero and one for clamp(slope*x+intercept,0,1). Invert the linear branch as (output-intercept)/slope and return its two input breakpoints.1

Input fieldMeaning and unitsAccepted input
outputStrictly between zero and one; saturated output rays are excluded.Required. Finite number; strictly above 0; strictly below 1.
slopeSlopeRequired. Finite number; strictly above 0.
interceptInterceptRequired. Finite number.
Output fieldInterpretationReturned shape
inputInputRequired. Finite number.
branchLowerBranch LowerRequired. Finite number.
branchUpperBranch UpperRequired. Finite number.
json
{
  "input": {
    "output": 0.5,
    "slope": 0.25,
    "intercept": 0.5
  },
  "output": {
    "input": 0,
    "branchLower": -2,
    "branchUpper": 2
  }
}

Limitations and assumptions

  • Saturated output rays at zero/one are excluded; the tool does not invert a particular library's hard-sigmoid convention automatically.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the complete explicit function and the intended parameter, branch and numerical conventions for symbolic, tensor or model-level differentiation; assess training behavior independently.

References

  1. Calculation and input contract: activation/hardsigmoid-linear-branch-preimage — tool.io

Similar or alternative tools