Quire

Ramp function

From Quire, the open reference·Piecewise function that clamps its input to be non-negative·2 min read
Graph of the ramp function
Graph of the ramp function Image: source and license

The ramp function is a unary real function, whose graph is shaped like a ramp. It can be expressed by numerous definitions, for example "0 for negative inputs, output equals input for non-negative inputs". The term "ramp" can also be used for other functions obtained by scaling and shifting, and the function in this article is the unit ramp function (slope 1, starting at 0).

In mathematics, the ramp function is also known as the positive part.

In machine learning, it is commonly known as a ReLU activation function[1][2] or a rectifier in analogy to half-wave rectification in electrical engineering. In statistics (when used as a likelihood function) it is known as a tobit model.

This function has numerous applications in mathematics and engineering, and goes by various names, depending on the context. There are differentiable variants of the ramp function.

Definitions#edit

The ramp function (R(x) : R → R0+) may be defined analytically in several ways. Possible definitions are:

It could approximated as close as desired by choosing an increasing positive value {\displaystyle a>0}.

Applications#edit

The ramp function has numerous applications in engineering, such as in the theory of digital signal processing.

Payoff and profits from buying a call option
Payoff and profits from buying a call option Image: source and license

In finance, the payoff of a call option is a ramp (shifted by strike price). Horizontally flipping a ramp yields a put option, while vertically flipping (taking the negative) corresponds to selling or being "short" an option. In finance, the shape is widely called a "hockey stick", due to the shape being similar to an ice hockey stick.

A mirrored pair of hinge functions with a knot at x=3.1
A mirrored pair of hinge functions with a knot at x=3.1 Image: source and license

In statistics, hinge functions of multivariate adaptive regression splines (MARS) are ramps, and are used to build regression models.

Analytic properties#edit

Non-negativity#edit

In the whole domain the function is non-negative, so its absolute value is itself, i.e. {\displaystyle \forall x\in \mathbb {R} :R(x)\geq 0} and {\displaystyle \left|R(x)\right|=R(x)}

Proof

by the mean of definition 2, it is non-negative in the first quarter, and zero in the second; so everywhere it is non-negative.

Derivative#edit

Its derivative is the Heaviside step function: {\displaystyle R'(x)=H(x)\quad {\mbox{for x\neq 0.}

Second derivative#edit

The ramp function satisfies the differential equation: {\displaystyle {\frac {d^{2{dx^{2R(x-x_{0})=\delta (x-x_{0}),} where δ(x) is the Dirac delta. This means that R(x) is a Green's function for the second derivative operator. Thus, any function, f(x), with an integrable second derivative, f″(x), will satisfy the equation: {\displaystyle f(x)=f(a)+(x-a)f'(a)+\int _{a}^{b}R(x-s)f''(s)\,ds\quad {\mbox{for a<x<b.}

Antiderivative#edit

Ramp function has the following antiderivative:

{{mathimg|7f327a73b06982cbcd9366bb4a47b52b9bf479f9|width=43.556ex|height=6.343ex|va=-2.338ex|alt={\displaystyle \int {R(x)dx}={\frac {x^{2}+x\vert x\vert }{4+C={\frac {x}{2R(x)+C\,,}}}

where {\displaystyle C} is the integration constant.

Fourier transform#edit

{{mathimg|2ab4b6b2f77a5f670fcc024ba7652c74e86b805c|width=54.978ex|height=6.343ex|va=-2.505ex|alt={\displaystyle {\mathcal {F{\big \{}R(x){\big \(f)=\int _{-\infty }^{\infty }R(x)e^{-2\pi ifx}\,dx={\frac {i\delta '(f)}{4\pi -{\frac {1}{4\pi ^{2}f^{2,}}} where δ(x) is the Dirac delta (in this formula, its derivative appears).

Laplace transform#edit

The single-sided Laplace transform of R(x) is given as follows,[4] {\displaystyle {\mathcal {L{\big \{}R(x){\big \(s)=\int _{0}^{\infty }e^{-sx}R(x)dx={\frac {1}{s^{2.}

Algebraic properties#edit

Iteration invariance#edit

Every iterated function of the ramp mapping is itself, as {\displaystyle R{\big (}R(x){\big )}=R(x).}

Proof

{{mathimg|be2c5a533e91a5ee04b263963c8a5bb62e2d10fe|width=52.548ex|height=5.676ex|va=-1.838ex|alt={\displaystyle R{\big (}R(x){\big )}:={\frac {R(x)+|R(x)|}{2={\frac {R(x)+R(x)}{2=R(x).}}} This applies the non-negative property.

See also#edit

References#edit

  1. ^ Brownlee, Jason (8 January 2019). "A Gentle Introduction to the Rectified Linear Unit (ReLU)". Machine Learning Mastery. Retrieved 8 April 2021.
  2. ^ Liu, Danqing (30 November 2017). "A Practical Guide to ReLU". Medium. Retrieved 8 April 2021.
  3. ^ Weisstein, Eric W. "Ramp Function". MathWorld.
  4. ^ "The Laplace Transform of Functions". lpsa.swarthmore.edu. Retrieved 2019-04-05.

This article is mirrored from “Ramp function” on English Wikipedia, revision 1352857425, written by Wikipedia's contributors and licensed CC BY-SA 4.0. Editing it here creates a Quire copy with its own history.

Synced with Wikipedia revision 1352857425 · just now