File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1717import 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]))
You can’t perform that action at this time.
0 commit comments