def calc_L(matrix): (x, y) = np.shape(matrix) return np.row_stack((np.mat(np.ones((1, y))), Sigmoid(matrix)))