Skip to content

Commit 5ffe601

Browse files
tianyizheng02github-actions
and
github-actions
authored
Fix mypy errors in maths/sigmoid_linear_unit.py (TheAlgorithms#8786)
* updating DIRECTORY.md * Fix mypy errors in sigmoid_linear_unit.py * updating DIRECTORY.md * updating DIRECTORY.md --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent 5b0890b commit 5ffe601

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

maths/sigmoid_linear_unit.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import numpy as np
1818

1919

20-
def sigmoid(vector: np.array) -> np.array:
20+
def sigmoid(vector: np.ndarray) -> np.ndarray:
2121
"""
2222
Mathematical function sigmoid takes a vector x of K real numbers as input and
2323
returns 1/ (1 + e^-x).
@@ -29,17 +29,15 @@ def sigmoid(vector: np.array) -> np.array:
2929
return 1 / (1 + np.exp(-vector))
3030

3131

32-
def sigmoid_linear_unit(vector: np.array) -> np.array:
32+
def sigmoid_linear_unit(vector: np.ndarray) -> np.ndarray:
3333
"""
3434
Implements the Sigmoid Linear Unit (SiLU) or swish function
3535
3636
Parameters:
37-
vector (np.array): A numpy array consisting of real
38-
values.
37+
vector (np.ndarray): A numpy array consisting of real values
3938
4039
Returns:
41-
swish_vec (np.array): The input numpy array, after applying
42-
swish.
40+
swish_vec (np.ndarray): The input numpy array, after applying swish
4341
4442
Examples:
4543
>>> sigmoid_linear_unit(np.array([-1.0, 1.0, 2.0]))

0 commit comments

Comments
 (0)