<p>For reference, the <code>hard sigmoid function</code> may be defined differently in different places. In Courbariaux et al. 2016 [1] it's defined as:</p>

<blockquote>
  <p>σ is the “hard sigmoid” function: σ(x) = clip((x + 1)/2, 0, 1) =
  max(0, min(1, (x + 1)/2))</p>
</blockquote>

<p>The intent is to provide a probability value (hence constraining it to be between <code>0</code> and <code>1</code>) for use in stochastic binarization of neural network parameters (e.g. weight, activation, gradient). You use the probability <code>p = σ(x)</code> returned from the hard sigmoid function to set the parameter <code>x</code> to <code>+1</code> with <code>p</code> probability, or <code>-1</code> with probability <code>1-p</code>.</p>

<p>[1] <a href="https://arxiv.org/abs/1602.02830" rel="nofollow">https://arxiv.org/abs/1602.02830</a> - "Binarized Neural Networks: Training Deep Neural Networks with Weights and Activations Constrained to +1 or -1", Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, Yoshua Bengio, (Submitted on 9 Feb 2016 (v1), last revised 17 Mar 2016 (this version, v3))</p>
How is Hard Sigmoid defined
<p>I am working on Deep Nets using keras. There is an activation "hard sigmoid". Whats its mathematical definition ?</p>

<p>I know what is Sigmoid. Someone asked similar question on Quora: <a href="https://www.quora.com/What-is-hard-sigmoid-in-artificial-neural-networks-Why-is-it-faster-than-standard-sigmoid-Are-there-any-disadvantages-over-the-standard-sigmoid" rel="noreferrer">https://www.quora.com/What-is-hard-sigmoid-in-artificial-neural-networks-Why-is-it-faster-than-standard-sigmoid-Are-there-any-disadvantages-over-the-standard-sigmoid</a></p>

<p>But I could not find the precise mathematical definition anywhere ?</p>