ReLU Activation Function
Neural Units & Activations DS practice problem on Onlearn.
Difficulty: easy.
Topics: Understanding Implement ReLU Activation Function, Rectified Linear Unit, Thresholding Logic, Vanishing Gradient Mitigation, Piecewise Function Definition, Sparsity Induction, Deep Learning Foundations, Mathematical Analysis, Computational Programming, Neural Network Architecture, Optimization Theory, Activation Functions, Scalar Operations, Non-linear Transformations, Gradient Flow Dynamics, Unit-level Computation.
Write a Python function relu that implements the Rectified Linear Unit (ReLU) activation function. The function should take a single float as input and return the value after applying the ReLU function. The ReLU function returns the input if it's greater than 0, otherwise, it returns 0.