avalanche icon indicating copy to clipboard operation
avalanche copied to clipboard

WIP: optional task and class labels in AvalancheDataset

Open AntonioCarta opened this issue 3 years ago • 1 comments

Still a work in progress

AvalancheDatasets are doing many different things together:

  • advanced indexing
  • management of class/task labels
  • management of transformations
  • efficient concat/subset operations needed for replay

This PR separates all these features into different components. The advantage is that now we can do naturally some things that were a bit clunky such as:

  • having datasets without class/task labels
  • easily add new dataset types without having to worry about compatibility with task labels/collate_fn and other details of supervised datasets.

AntonioCarta avatar Sep 05 '22 15:09 AntonioCarta

Oh no! It seems there are some PEP8 errors! 😕 Don't worry, you can fix them! 💪 Here's a report about the errors and where you can find them:

avalanche/evaluation/metrics/detection.py:443:81: E501 line too long (84 > 80 characters)
avalanche/training/storage_policy.py:36:81: E501 line too long (95 > 80 characters)
avalanche/training/storage_policy.py:110:81: E501 line too long (93 > 80 characters)
avalanche/training/storage_policy.py:286:81: E501 line too long (84 > 80 characters)
avalanche/training/storage_policy.py:442:81: E501 line too long (83 > 80 characters)
avalanche/training/storage_policy.py:450:81: E501 line too long (87 > 80 characters)
avalanche/training/storage_policy.py:460:81: E501 line too long (82 > 80 characters)
avalanche/training/storage_policy.py:474:81: E501 line too long (82 > 80 characters)
avalanche/training/storage_policy.py:489:81: E501 line too long (82 > 80 characters)
avalanche/training/plugins/agem.py:38:81: E501 line too long (91 > 80 characters)
avalanche/training/supervised/icarl.py:148:81: E501 line too long (81 > 80 characters)
avalanche/benchmarks/classic/comniglot.py:151:1: E303 too many blank lines (3)
avalanche/benchmarks/classic/endless_cl_sim.py:18:81: E501 line too long (92 > 80 characters)
avalanche/benchmarks/classic/endless_cl_sim.py:137:81: E501 line too long (89 > 80 characters)
avalanche/benchmarks/classic/endless_cl_sim.py:140:81: E501 line too long (88 > 80 characters)
avalanche/benchmarks/generators/benchmark_generators.py:714:81: E501 line too long (100 > 80 characters)
avalanche/benchmarks/generators/benchmark_generators.py:736:81: E501 line too long (105 > 80 characters)
avalanche/benchmarks/generators/benchmark_generators.py:739:81: E501 line too long (98 > 80 characters)
avalanche/benchmarks/generators/benchmark_generators.py:761:81: E501 line too long (105 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:22:81: E501 line too long (82 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:24:81: E501 line too long (93 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:25:81: E501 line too long (91 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:62:1: E302 expected 2 blank lines, found 1
avalanche/benchmarks/utils/classification_dataset.py:101:81: E501 line too long (93 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:227:81: E501 line too long (86 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:233:81: E501 line too long (81 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:301:81: E501 line too long (86 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:311:81: E501 line too long (93 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:316:81: E501 line too long (99 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:321:81: E501 line too long (100 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:437:9: E741 ambiguous variable name 'l'
avalanche/benchmarks/utils/classification_dataset.py:477:5: E121 continuation line under-indented for hanging indent
avalanche/benchmarks/utils/classification_dataset.py:477:5: E125 continuation line with same indent as next logical line
avalanche/benchmarks/utils/classification_dataset.py:681:81: E501 line too long (99 > 80 characters)
avalanche/benchmarks/utils/classification_dataset.py:772:81: E501 line too long (81 > 80 characters)
avalanche/benchmarks/utils/data.py:105:81: E501 line too long (85 > 80 characters)
avalanche/benchmarks/utils/data.py:107:81: E501 line too long (84 > 80 characters)
avalanche/benchmarks/utils/data.py:208:81: E501 line too long (87 > 80 characters)
avalanche/benchmarks/utils/data.py:217:81: E501 line too long (92 > 80 characters)
avalanche/benchmarks/utils/data.py:299:81: E501 line too long (97 > 80 characters)
avalanche/benchmarks/utils/data.py:318:81: E501 line too long (82 > 80 characters)
avalanche/benchmarks/utils/data.py:319:81: E501 line too long (96 > 80 characters)
avalanche/benchmarks/utils/data.py:339:5: E121 continuation line under-indented for hanging indent
avalanche/benchmarks/utils/data.py:339:5: E125 continuation line with same indent as next logical line
avalanche/benchmarks/utils/data.py:373:81: E501 line too long (117 > 80 characters)
avalanche/benchmarks/utils/data.py:378:81: E501 line too long (103 > 80 characters)
avalanche/benchmarks/utils/data.py:454:81: E501 line too long (86 > 80 characters)
avalanche/benchmarks/utils/data.py:482:81: E501 line too long (102 > 80 characters)
avalanche/benchmarks/utils/data.py:557:81: E501 line too long (83 > 80 characters)
avalanche/benchmarks/utils/data.py:561:81: E501 line too long (96 > 80 characters)
avalanche/benchmarks/utils/data.py:572:81: E501 line too long (82 > 80 characters)
avalanche/benchmarks/utils/data.py:589:81: E501 line too long (81 > 80 characters)
avalanche/benchmarks/utils/data.py:593:81: E501 line too long (91 > 80 characters)
avalanche/benchmarks/utils/data.py:605:81: E501 line too long (92 > 80 characters)
avalanche/benchmarks/utils/data.py:615:81: E501 line too long (83 > 80 characters)
avalanche/benchmarks/utils/data.py:633:81: E501 line too long (83 > 80 characters)
avalanche/benchmarks/utils/data.py:646:81: E501 line too long (85 > 80 characters)
avalanche/benchmarks/utils/data.py:647:81: E501 line too long (87 > 80 characters)
avalanche/benchmarks/utils/data.py:658:81: E501 line too long (94 > 80 characters)
avalanche/benchmarks/utils/data.py:703:81: E501 line too long (83 > 80 characters)
avalanche/benchmarks/utils/data.py:707:81: E501 line too long (83 > 80 characters)
avalanche/benchmarks/utils/data_attribute.py:18:27: E252 missing whitespace around parameter equals
avalanche/benchmarks/utils/data_attribute.py:18:28: E252 missing whitespace around parameter equals
avalanche/benchmarks/utils/data_attribute.py:94:81: E501 line too long (83 > 80 characters)
avalanche/benchmarks/utils/flattened_data.py:80:13: E741 ambiguous variable name 'l'
avalanche/benchmarks/utils/flattened_data.py:104:81: E501 line too long (92 > 80 characters)
avalanche/benchmarks/utils/flattened_data.py:138:81: E501 line too long (81 > 80 characters)
avalanche/benchmarks/utils/flattened_data.py:145:10: W292 no newline at end of file
avalanche/benchmarks/utils/transform_groups.py:3:81: E501 line too long (85 > 80 characters)
avalanche/benchmarks/utils/transform_groups.py:25:81: E501 line too long (82 > 80 characters)
avalanche/benchmarks/utils/transforms.py:147:81: E501 line too long (87 > 80 characters)
avalanche/benchmarks/scenarios/generic_benchmark_creation.py:584:81: E501 line too long (94 > 80 characters)
avalanche/benchmarks/scenarios/lazy_dataset_sequence.py:55:81: E501 line too long (84 > 80 characters)
avalanche/benchmarks/scenarios/lazy_dataset_sequence.py:65:81: E501 line too long (91 > 80 characters)
avalanche/benchmarks/scenarios/lazy_dataset_sequence.py:200:81: E501 line too long (89 > 80 characters)
avalanche/benchmarks/scenarios/new_instances/ni_scenario.py:24:81: E501 line too long (100 > 80 characters)
avalanche/benchmarks/scenarios/new_instances/ni_scenario.py:158:81: E501 line too long (92 > 80 characters)
avalanche/benchmarks/scenarios/new_classes/nc_scenario.py:21:81: E501 line too long (100 > 80 characters)
avalanche/benchmarks/scenarios/new_classes/nc_utils.py:17:81: E501 line too long (86 > 80 characters)
tests/test_avalanche_classification_dataset.py:45:81: E501 line too long (95 > 80 characters)
tests/test_avalanche_classification_dataset.py:101:81: E501 line too long (85 > 80 characters)
tests/test_avalanche_classification_dataset.py:123:81: E501 line too long (86 > 80 characters)
tests/test_avalanche_classification_dataset.py:522:81: E501 line too long (89 > 80 characters)
tests/test_avalanche_classification_dataset.py:566:81: E501 line too long (89 > 80 characters)
tests/test_avalanche_classification_dataset.py:567:81: E501 line too long (92 > 80 characters)
tests/test_avalanche_classification_dataset.py:580:81: E501 line too long (92 > 80 characters)
tests/test_avalanche_classification_dataset.py:679:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:680:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:1005:81: E501 line too long (93 > 80 characters)
tests/test_avalanche_classification_dataset.py:1085:81: E501 line too long (84 > 80 characters)
tests/test_avalanche_classification_dataset.py:1095:81: E501 line too long (98 > 80 characters)
tests/test_avalanche_classification_dataset.py:1096:81: E501 line too long (87 > 80 characters)
tests/test_avalanche_classification_dataset.py:1101:81: E501 line too long (86 > 80 characters)
tests/test_avalanche_classification_dataset.py:1115:81: E501 line too long (82 > 80 characters)
tests/test_avalanche_classification_dataset.py:1130:81: E501 line too long (84 > 80 characters)
tests/test_avalanche_classification_dataset.py:1138:81: E501 line too long (83 > 80 characters)
tests/test_avalanche_classification_dataset.py:1139:81: E501 line too long (83 > 80 characters)
tests/test_avalanche_classification_dataset.py:1144:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:1201:81: E501 line too long (84 > 80 characters)
tests/test_avalanche_classification_dataset.py:1242:81: E501 line too long (84 > 80 characters)
tests/test_avalanche_classification_dataset.py:1268:81: E501 line too long (85 > 80 characters)
tests/test_avalanche_classification_dataset.py:1350:81: E501 line too long (89 > 80 characters)
tests/test_avalanche_classification_dataset.py:1390:81: E501 line too long (89 > 80 characters)
tests/test_avalanche_classification_dataset.py:1557:81: E501 line too long (82 > 80 characters)
tests/test_avalanche_classification_dataset.py:1565:81: E501 line too long (94 > 80 characters)
tests/test_avalanche_classification_dataset.py:1572:81: E501 line too long (83 > 80 characters)
tests/test_avalanche_classification_dataset.py:1585:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:1626:81: E501 line too long (83 > 80 characters)
tests/test_avalanche_classification_dataset.py:1637:81: E501 line too long (83 > 80 characters)
tests/test_avalanche_classification_dataset.py:1661:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:1674:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:1683:81: E501 line too long (81 > 80 characters)
tests/test_avalanche_classification_dataset.py:1693:81: E501 line too long (94 > 80 characters)
tests/test_avalanche_classification_dataset.py:1703:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_classification_dataset.py:1717:81: E501 line too long (91 > 80 characters)
tests/test_avalanche_classification_dataset.py:1857:81: E501 line too long (93 > 80 characters)
tests/test_avalanche_classification_dataset.py:1873:81: E501 line too long (93 > 80 characters)
tests/test_avalanche_dataset.py:29:81: E501 line too long (115 > 80 characters)
tests/test_avalanche_dataset.py:31:81: E501 line too long (95 > 80 characters)
tests/test_avalanche_dataset.py:77:81: E501 line too long (86 > 80 characters)
tests/test_avalanche_dataset.py:81:81: E501 line too long (89 > 80 characters)
tests/test_avalanche_dataset.py:99:81: E501 line too long (86 > 80 characters)
tests/test_avalanche_dataset.py:109:81: E501 line too long (86 > 80 characters)
tests/test_avalanche_dataset.py:113:81: E501 line too long (88 > 80 characters)
tests/test_avalanche_dataset.py:114:81: E501 line too long (84 > 80 characters)
tests/test_avalanche_dataset.py:166:81: E501 line too long (85 > 80 characters)
tests/test_avalanche_dataset.py:173:81: E501 line too long (85 > 80 characters)
tests/test_custom_streams.py:20:81: E501 line too long (94 > 80 characters)
tests/test_custom_streams.py:28:81: E501 line too long (94 > 80 characters)
tests/test_custom_streams.py:36:81: E501 line too long (94 > 80 characters)
tests/test_custom_streams.py:119:81: E501 line too long (94 > 80 characters)
tests/test_custom_streams.py:127:81: E501 line too long (94 > 80 characters)
tests/test_high_level_generators.py:120:81: E501 line too long (81 > 80 characters)
tests/test_high_level_generators.py:141:21: E131 continuation line unaligned for hanging indent
tests/test_high_level_generators.py:142:21: E131 continuation line unaligned for hanging indent
tests/test_high_level_generators.py:143:21: E131 continuation line unaligned for hanging indent
tests/test_high_level_generators.py:144:21: E131 continuation line unaligned for hanging indent
tests/test_high_level_generators.py:145:21: E131 continuation line unaligned for hanging indent
tests/test_high_level_generators.py:146:21: E131 continuation line unaligned for hanging indent
tests/test_high_level_generators.py:167:81: E501 line too long (81 > 80 characters)
tests/test_high_level_generators.py:532:81: E501 line too long (86 > 80 characters)
tests/test_nc_mt_scenario.py:296:81: E501 line too long (93 > 80 characters)
tests/test_nc_mt_scenario.py:304:81: E501 line too long (91 > 80 characters)
tests/test_nc_sit_scenario.py:15:81: E501 line too long (100 > 80 characters)
tests/test_nc_sit_scenario.py:318:81: E501 line too long (93 > 80 characters)
tests/test_nc_sit_scenario.py:326:81: E501 line too long (91 > 80 characters)
tests/test_nc_sit_scenario.py:381:81: E501 line too long (93 > 80 characters)
tests/test_nc_sit_scenario.py:389:81: E501 line too long (91 > 80 characters)
tests/test_ni_sit_scenario.py:169:81: E501 line too long (93 > 80 characters)
tests/test_ni_sit_scenario.py:177:81: E501 line too long (91 > 80 characters)
tests/unit_tests_utils.py:94:1: E302 expected 2 blank lines, found 1
tests/evaluation/test_image_samples.py:39:81: E501 line too long (83 > 80 characters)
tests/training/test_plugins.py:367:81: E501 line too long (81 > 80 characters)
tests/training/test_plugins.py:368:81: E501 line too long (84 > 80 characters)
tests/training/test_replay.py:191:81: E501 line too long (82 > 80 characters)
tests/benchmarks/test_data_attribute.py:27:81: E501 line too long (85 > 80 characters)
tests/benchmarks/test_data_attribute.py:42:81: E501 line too long (86 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:25:81: E501 line too long (90 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:32:81: E501 line too long (90 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:40:81: E501 line too long (84 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:48:81: E501 line too long (87 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:100:81: E501 line too long (90 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:107:81: E501 line too long (90 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:115:81: E501 line too long (84 > 80 characters)
tests/benchmarks/scenarios/test_classification_scenario.py:123:81: E501 line too long (87 > 80 characters)
examples/detection.py:30:81: E501 line too long (100 > 80 characters)
examples/detection_examples_utils.py:7:81: E501 line too long (100 > 80 characters)
examples/detection_lvis.py:27:81: E501 line too long (100 > 80 characters)
2       E121 continuation line under-indented for hanging indent
2       E125 continuation line with same indent as next logical line
6       E131 continuation line unaligned for hanging indent
2       E252 missing whitespace around parameter equals
2       E302 expected 2 blank lines, found 1
1       E303 too many blank lines (3)
150     E501 line too long (84 > 80 characters)
2       E741 ambiguous variable name 'l'
1       W292 no newline at end of file

ContinualAI-bot avatar Sep 05 '22 15:09 ContinualAI-bot

New PR at #1142

AntonioCarta avatar Oct 06 '22 10:10 AntonioCarta