Skip to content

Main content

Activation: HardTanh Inverse Preimage Tool

Describe the preimage of hardtanh/clamp: lower/upper rays include their endpoint, interior is singleton and outside is empty; infinite rays are represented symbolically.

Loading tool…

Description

Outputs outside [lower,upper] have no preimage; lower gives a lower-ray, upper an upper-ray and strict interior a singleton.

Hardtanh clamps its input to supplied lower and upper output bounds. Interior outputs have one preimage, while each saturated endpoint corresponds to an unbounded input ray. An endpoint can have zero excess distance while still being classified as saturated.

Outputs outside [lower,upper] have no preimage; lower gives a lower-ray, upper an upper-ray and strict interior a singleton.

When to use this tool

Use Activation: HardTanh Inverse Preimage when checking the stated clamped-tanh saturation or inverse-region convention.

How to use the tool and how it works

  1. Enter y, lower, upper. 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 result. Expand result to inspect the returned fields.

Require lower<upper. Outputs outside [lower,upper] have no preimage; lower gives a lower-ray, upper an upper-ray and strict interior a singleton. Return y as the boundary marker.1

Input fieldMeaning and unitsAccepted input
yYRequired. Finite number.
lowerLowerRequired. Finite number.
upperUpperRequired. Finite number.
Output fieldInterpretationReturned shape
resultObject containing the operation-specific returned members listed below.Required. Object.
result.hasPreimageHas PreimageCalculated result member: boolean.
result.kindKindCalculated result member: string.
result.boundaryReturned y boundary marker; inspect kind/hasPreimage before interpreting a singleton or ray.Calculated result member: number.
json
{
  "input": {
    "y": -1,
    "lower": -1,
    "upper": 1
  },
  "output": {
    "result": {
      "hasPreimage": true,
      "kind": "lower-ray",
      "boundary": -1
    }
  }
}

Limitations and assumptions

  • The rays are (-∞,lower] and [upper,∞); boundary is retained even for an empty preimage and must be read with hasPreimage/kind.
  • Outputs are nested inside result. 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/hardtanh-inverse-preimage — tool.io

Similar or alternative tools