pyqt_data_analysis/libdataanalysis/8-Kmeans代码实现/utils/hypothesis/sigmoid.py

10 lines
155 B
Python
Raw Normal View History

2024-06-08 19:26:36 +08:00
"""Sigmoid function"""
import numpy as np
def sigmoid(matrix):
"""Applies sigmoid function to NumPy matrix"""
return 1 / (1 + np.exp(-matrix))