def reverse_one_hot(y_):
    """
    Function to reverse one-hot coding
    E.g.: [[0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0]] --> [[5], [0], [3]] 
    """
    flat_y = []
    for index, entry in enumerate(y_, start=0):
    #   print("---  y_ [", index, "]:",  entry)
        for bit, code in enumerate(entry):
            if(code > 0):
                flat_y.append(bit)

    return flat_y