In [9]:
def NN_model(X,Y,n_h, num_iterations, learning_rate):
    
    n_x = X.shape[0] # size of an input layer = number of features 
    n_y = Y.shape[0] # size of an output layer
    parameters = initialize_parameters(n_x, n_h, n_y)
    
    #unpack parameters
    W1 = parameters["W1"]
    b1 = parameters["b1"]
    W2 = parameters["W2"]
    b2 = parameters["b2"]
    
    for i in range(num_iterations):
        A2, cache = forward_pass(X, parameters)
        cost  = cost_calculation(A2, Y)
        grads = backward_pass(parameters, cache, X, Y)
        parameters = update_parameters(parameters, learning_rate, grads)
        
    return parameters