this script demonstrates the implementation of the relu function it s a kind of activation function defined as the positive part of its argument in the context of neural network the function takes a vector of k real numbers as input and then argmaxx 0 after through relu the element of the vector always 0 or real number script inspired from its corresponding wikipedia article https en wikipedia orgwikirectifierneuralnetworks implements the relu function parameters vector np array list tuple a numpy array of shape 1 n consisting of real values or a similar list tuple returns reluvec np array the input numpy array after applying relu vec np array1 0 5 reluvec array0 0 5 compare two arrays and then return elementwise maxima implements the relu function parameters vector np array list tuple a numpy array of shape 1 n consisting of real values or a similar list tuple returns relu_vec np array the input numpy array after applying relu vec np array 1 0 5 relu vec array 0 0 5 compare two arrays and then return element wise maxima 0 0 5
from __future__ import annotations

import numpy as np


def relu(vector: list[float]):
    

    
    return np.maximum(0, vector)


if __name__ == "__main__":
    print(np.array(relu([-1, 0, 5])))