mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Fix minor typing errors in maths/ (#8959)
* updating DIRECTORY.md * types(maths): Fix pylance issues in maths * reset(vsc): Reset settings changes * Update maths/jaccard_similarity.py Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com> * revert(erosion_operation): Revert erosion_operation * test(jaccard_similarity): Add doctest to test alternative_union * types(newton_raphson): Add typehints to func bodies --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7618a92fee
commit
490e645ed3
@@ -13,7 +13,7 @@ This script is inspired by a corresponding research paper.
|
||||
import numpy as np
|
||||
|
||||
|
||||
def sigmoid(vector: np.array) -> np.array:
|
||||
def sigmoid(vector: np.ndarray) -> np.ndarray:
|
||||
"""
|
||||
Mathematical function sigmoid takes a vector x of K real numbers as input and
|
||||
returns 1/ (1 + e^-x).
|
||||
@@ -25,7 +25,7 @@ def sigmoid(vector: np.array) -> np.array:
|
||||
return 1 / (1 + np.exp(-vector))
|
||||
|
||||
|
||||
def gaussian_error_linear_unit(vector: np.array) -> np.array:
|
||||
def gaussian_error_linear_unit(vector: np.ndarray) -> np.ndarray:
|
||||
"""
|
||||
Implements the Gaussian Error Linear Unit (GELU) function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user