Class StairObj

Class Documentation

class StairObj

The StairObj class is used to implement a staircase function as an activation function.

This class precomputes activation values at discrete points (knots) and uses these values to approximate the activation function for any input within a specified range.

Public Functions

inline float GetHiKnot() const

Gets the upper bound of the knot range.

Returns:

The upper bound of the knot range.

inline std::vector<float> &GetKnots()

Gets the vector of knot positions.

Returns:

Reference to the vector of knot positions.

float Funct(float x) const

Computes the staircase function value for a given input.

Parameters:

x – Input value.

Returns:

Staircase function value.

explicit StairObj(int nbBins)

Constructs a StairObj with a specified number of bins.

Parameters:

nbBins – Number of bins for the staircase function.