mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Optimized recursive_bubble_sort (#2410)
* optimized recursive_bubble_sort * Fixed doctest error due whitespace * reduce loop times for optimization * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -16,20 +16,20 @@ import numpy as np
|
||||
|
||||
def relu(vector: List[float]):
|
||||
"""
|
||||
Implements the relu function
|
||||
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
|
||||
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.
|
||||
Returns:
|
||||
relu_vec (np.array): The input numpy array, after applying
|
||||
relu.
|
||||
|
||||
>>> vec = np.array([-1, 0, 5])
|
||||
>>> relu(vec)
|
||||
array([0, 0, 5])
|
||||
>>> vec = np.array([-1, 0, 5])
|
||||
>>> relu(vec)
|
||||
array([0, 0, 5])
|
||||
"""
|
||||
|
||||
# compare two arrays and then return element-wise maxima.
|
||||
|
Reference in New Issue
Block a user