Implement sigmoid function using Numpy Last Updated : 03 Oct, 2019 Comments Improve Suggest changes Like Article Like Report With the help of Sigmoid activation function, we are able to reduce the loss during the time of training because it eliminates the gradient problem in machine learning model while training. Python3 1=1 # Import matplotlib, numpy and math import matplotlib.pyplot as plt import numpy as np import math x = np.linspace(-10, 10, 100) z = 1/(1 + np.exp(-x)) plt.plot(x, z) plt.xlabel("x") plt.ylabel("Sigmoid(X)") plt.show() Output : Example #1 : Python3 1=1 # Import matplotlib, numpy and math import matplotlib.pyplot as plt import numpy as np import math x = np.linspace(-100, 100, 200) z = 1/(1 + np.exp(-x)) plt.plot(x, z) plt.xlabel("x") plt.ylabel("Sigmoid(X)") plt.show() Output : Comment More infoAdvertise with us Next Article Implement sigmoid function using Numpy J jitender_1998 Follow Improve Article Tags : Technical Scripter Python Python-numpy Practice Tags : python Similar Reads numpy.interp() function - Python numpy.interp() function returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x. Syntax : numpy.interp(x, xp, fp, left = None, right = None, period = None) Parameters : x : [array_like] The x-coordinates at which to evaluate the 2 min read Numpy matrix.I function | Python With the help ofnumpy.matrix.I() function we can get the multiplicative inverse of the same size as of our given matrix. Syntax : numpy.matrix.I() Return : [matrix object] If self is non-singular, ret is such that ret * self == self * ret == np.matrix(np.eye(self[0, :].size) all return True. Return 1 min read numpy.nanstd() function - Python numpy.nanstd() function compute the standard deviation along the specified axis, while ignoring NaNs. Syntax : numpy.nanstd(arr, axis = None, dtype = None, out = None, ddof = 0, keepdims) Parameters : arr : [array_like] Calculate the standard deviation of the non-NaN values. axis : [{int, tuple of i 2 min read numpy.i0() function | Python numpy.i0() function is the modified Bessel function of the first kind, order 0. it's usually denoted by I0. Syntax : numpy.i0(x) Parameters : x : [array_like, dtype float or complex] Argument of the Bessel function. Return : [ndarray, shape = x.shape, dtype = x.dtype] The modified Bessel function ev 1 min read numpy.ma.masked_values() function | Python numpy.ma.masked_values() function return a MaskedArray, masked where the data in array arr are approximately equal to value, determined using isclose. The default tolerances for masked_values are the same as those for isclose. Syntax : numpy.ma.masked_values(arr, value, rtol = 1e-05, atol = 1e-08, c 2 min read Like