Skip to content

Incorrect NMNIST Labels #34

Description

@BKHMSI

You are assigning the labels incorrectly.

In this function:

def _concat_dir_content(content):
    ims = []
    labels = []
    names = []
    for idx, (name, data) in enumerate(content.items()):
        if not isinstance(data, (list, tuple)):
            data = [data]
        ims += data
        labels += [idx for _ in range(len(data))]
        names += [name for _ in range(len(data))]
    df = pd.DataFrame({"sample": ims, "label": labels})
    return df, name

The labels you are passing to the DataFrame should be list(map(int, names)) for N-MNIST not the index of the current directory as the order might differ. It shouldn't make a difference in the training, but it's semantically incorrect.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions