def update_weights(Y_prediction,Y_truth,beta,current_D):
    """
        This function updates weights for adaboost function
        using current weights, current_D, and beta values.
        Inputs: Y_prediction --> Array contains predicted output labels
                Y_truth --> Array contains ground truth labels
                beta --> scalar, current beta value
                current_D --> Array contains current weights, shape = (m,)
                where m is total number of samples
        Output: D_next --> weights for the next iteration of adaboots, shape (m,)
    """
    # Select only correct predictions and scale them with beta value
    D = current_D
    D[Y_truth == Y_prediction] *= beta
    D_next = D/sum(D) #normalize
    #print("always should be equal to one: ", sum(D_next/sum(D_next)))
    return D_next