if __name__ == '__main__': a = random.randn(3, 5).astype(np.float32) print sigmoid(a) print expit(a) print '' b = random.randn(5, 2).astype(np.float32) print dot(a, b) print np.dot(a, b) print '' c = random.randn(1, 2).astype(np.float32) print add(b, c) print b + c print '' print sigmoid(a) print add_random(sigmoid(a), True) print add_random(sigmoid(a), False) print '' print a print sum(a) print np.sum(a, axis = 0) print '' d = random.randn(5, 2).astype(np.float32) print b print d print square_error(d, b)
def sum_1(): return worker_inner.sum(A)