text_plain_output_1.png
import numpy as np

import numpy as np # linear algebra

def sigmoid(z):
    return 1.0 / (1 + np.exp(-z))

def z(theta, x):
    assert theta.shape[1] == 1
    assert theta.shape[0] == x.shape[1]
    return np.dot(x, theta)

a = np.array([[1, 2], [3, 4]])
b = np.array([[4, 1], [2, 2]])
print('a.T*b is:', np.dot(a.T, b))
print('a*b.T is:', np.dot(a, b.T))
a = np.array([1, 1])
b = np.array([2, 3])
print(a.shape)
print(b.T.shape)
print('a*b is: ', np.dot(a, b.T))