Skip to content

Main content

Activation: Hardshrink Threshold Decision Tool

Apply hardshrink with strict outside-threshold retention and zero on the inclusive threshold interval.

Loading tool…

Description

retained means abs(x)>threshold; return x for retained values and zero otherwise.

Hardshrink removes values inside a symmetric threshold interval and leaves survivors unchanged. Softshrink also subtracts the threshold from surviving magnitudes. Equality policies determine which boundary values are removed; a threshold decision alone does not imply statistical significance.

retained means abs(x)>threshold; return x for retained values and zero otherwise.

When to use this tool

Use Activation: Hardshrink Threshold Decision when checking the stated hard/soft-shrink threshold or inverse-region convention.

How to use the tool and how it works

  1. Enter x, threshold. 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 threshold in [0,10^12]. retained means abs(x)>threshold; return x for retained values and zero otherwise.1

Input fieldMeaning and unitsAccepted input
xFinite scalar input coordinate; use the mathematical scale specified above.Required. Finite number.
thresholdSupplied symmetric or one-sided activation threshold as defined above.Required. Finite number.
Output fieldInterpretationReturned shape
resultObject containing the operation-specific returned members listed below.Required. Object.
result.retainedRetainedCalculated result member: boolean.
result.outputOutputCalculated result member: number.
json
{
  "input": {
    "x": 2,
    "threshold": 2
  },
  "output": {
    "result": {
      "retained": false,
      "output": 0
    }
  }
}

Limitations and assumptions

  • Equality is removed; unlike softshrink, surviving magnitudes are unchanged and no statistical selection interpretation is implied.
  • 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/hardshrink-threshold-decision — tool.io

Similar or alternative tools