Perform the Hard Sigmoid activation function on an input matrix:
C[i][j]=hard_sigmoid(A[i][j])
The Hard Sigmoid function is defined as:
hard_sigmoid(x)=⎩⎨⎧016x+3if x≤−3if x≥3otherwise
Input:
- Matrix A of size M×N containing floating-point values
Output:
- Matrix C of size M×N containing the Hard Sigmoid activation values
Notes:
- Both matrices A and C are stored in row-major order
- The Hard Sigmoid function is a piecewise linear approximation of the standard Sigmoid function