import numpy as np
import math as m
A = np.array([3,4,5]).reshape(3, 1)
B = np.zeros((3,1))
for i in range(len(A)):
B[i] = m.exp(A[i])
B
B = np.exp(A)
B
def sigmoid(x):
# we will use np.exp() so that we can calculate sigmoid function of a matrix or of a vector
s = 1/(1 + np.exp(x))
return s
sigmoid(0)
# this line of code would not work if we had used math.exp() insted od np.exp()
sigmoid([1,0,5])