m = X.shape[0]

random_indices = np.random.randint(m, size=100)
#display_data(X[random_indices])
print('Display selected inputs')
#input()

print('Tests nn_cost_function with default data')

test_theta1 = weights['Theta1']
test_theta2 = weights['Theta2']

nn_params = np.concatenate((test_theta1.T.ravel(), test_theta2.T.ravel()))

_lambda = 0
j = compute_cost(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y_test, _lambda)
print('\nCost without reg', j)
print('(this value should be about 0.287629) \n')

_lambda = 1
j = compute_cost(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y_test, _lambda)
print('\nReal cost', j)
print('(this value should be about 0.383770) \n')

print('\nEvaluating sigmoid gradient...\n')

g = sigmoid_gradient(np.array([1, -0.5, 0, 0.5, 1]))
print('Sigmoid gradient evaluated at [1 -0.5 0 0.5 1]:\n  ')
print(g)
print('\n\n')
 def cost_function(p):
     return compute_cost(p, input_layer_size, hidden_layer_size, num_labels, x, y, _lambda, yk, x_bias)