# Smooth approximation of ramp function

I would like to build a function approaching a ramp function with some parameters defining:

• the activation threshold
• the linear slope
• the 'distance' to the discontinuity, i.e how close we are from the ramp function.

I have started to work on this by combining rational and exponential functions, but I have trouble having isolating the very parameters that control all of this...

• i get linear slope and distance, but what is activation threshold? is it the minimum value? – Saketh Malyala Jan 24 at 18:50
• It is the value for which the the function starts to increase. But it just results in translating the function along x, so there was no point to bring this out. – Liris Jan 25 at 19:57

As explained in this related post one of the simplest approximations to the ramp function (which is the integral of the Heaviside step) is the following $$R(x) = {x \over 2}\left( {1 + {x \over {\sqrt {x^{\,2} + \varepsilon ^{\,2} } }}} \right)\quad \left| {\;\varepsilon < < 1} \right.$$