keisoku

ReLU Function Calculator

Compute the ReLU function relu(x)=max(0,x) and its derivative. Visualize this popular neural network activation function.

Input

Enter x to compute the ReLU function relu(x)=max(0,x) and its derivative.

Enter a real number (e.g. 1.5, -2).

Result

relu(1.5) =

1.5

Derivative relu'(1.5)

1

State

Active (passes input)

Input x

1.5

ReLU function graph

How it works

  • ReLU (rectified linear unit) is defined as relu(x)=max(0,x): it passes positive inputs through unchanged and outputs 0 for any input of 0 or below.
  • Its derivative is 1 when x>0 and 0 when x<0. At x=0 the derivative is not mathematically defined, but machine learning implementations conventionally use 0.
  • ReLU is a widely used activation function in neural networks because it mitigates the vanishing gradient problem and is computationally cheap.
  • When the input is 0 or below, both the output and the gradient are 0, which can cause the so-called dying ReLU problem where a neuron stops learning.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. ReLU Function Calculator