mboudiaf / pytorch-meta-dataset

A non-official 100% PyTorch implementation of META-DATASET benchmark for few-shot classification
59 stars 9 forks source link

Buggy code in example.py? #3

Closed jfb54 closed 3 years ago

jfb54 commented 3 years ago

example.py has the following lines of code:

        use_bilevel_ontology_list = [False]*len(datasets)
        # Enable ontology aware sampling for Omniglot and ImageNet.
        if 'omniglot' in datasets:
            use_bilevel_ontology_list[datasets.index('omniglot')] = True
        if 'imagenet' in datasets:
            use_bilevel_ontology_list[datasets.index('imagenet')] = True

        use_bilevel_ontology_list = use_bilevel_ontology_list
        use_dag_ontology_list = [False]*len(datasets)

shouldn't it be:

        use_bilevel_ontology_list = [False]*len(datasets)
        use_dag_ontology_list = [False]*len(datasets)

        # Enable ontology aware sampling for Omniglot and ImageNet.
        if 'omniglot' in datasets:
            use_bilevel_ontology_list[datasets.index('omniglot')] = True
        if 'ilsvrc_2012' in datasets:
            use_dag_ontology_list[datasets.index('imagenet')] = True

as the 'imagenet' dataset is actually called 'ilsvrc_2012' and it should use the DAG ontology.

mboudiaf commented 3 years ago

Completely true. Actually even the last line should read:

            use_dag_ontology_list[datasets.index('ilsvrc_2012')] = True

Will correct this immediatly.

jfb54 commented 3 years ago

Thanks!

sudarshan1994 commented 3 years ago

Thanks for your implementation @mboudiaf !

Just wanted to point out that the code still has one buggy line as pointed out by @jfb54:use_bilevel_ontology_list[datasets.index('ilsvrc_2012')] = True I guess it should be use_dag_ontology_list

mboudiaf commented 3 years ago

Hey @sudarshan1994, you're right ! this should be fixed ! Let me know if you find anything else suspicious :)